Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
1789 fschmid 7
 
3540 cbradney 8
 
3 paul 9
#include "mpalette.h"
10
#include "mpalette.moc"
3457 avox 11
 
3 paul 12
#include <cmath>
13
#include <qpoint.h>
14
#include <qwmatrix.h>
68 Franz 15
#include <qmessagebox.h>
5705 jghali 16
#include <qtoolbutton.h>
713 cbradney 17
#include <qradiobutton.h>
1502 tsoots 18
#include <qobjectlist.h>
3934 cbradney 19
 
20
#include "arrowchooser.h"
121 Franz 21
#include "autoform.h"
3934 cbradney 22
#include "commonstrings.h"
4689 mrdocs 23
#include "colorm.h"
3934 cbradney 24
#include "cpalette.h"
25
#include "sccombobox.h"
26
#include "scfonts.h"
173 Franz 27
#include "scribus.h"
5243 cbradney 28
#include "scribuscore.h"
4695 cbradney 29
#include "scraction.h"
3934 cbradney 30
#include "scribusview.h"
31
#include "selection.h"
32
#include "spalette.h"
710 cbradney 33
#include "styleselect.h"
3934 cbradney 34
#include "tabmanager.h"
806 cbradney 35
#include "units.h"
1263 tsoots 36
#include "undomanager.h"
2531 craig 37
#include "util.h"
5184 avox 38
#include "text/nlsconfig.h"
504 cbradney 39
 
40
using namespace std;
41
 
3 paul 42
 
3205 craig 43
 
265 Franz 44
LabelButton::LabelButton(QWidget* parent, QString text1, QString text2) : QLabel(parent)
45
{
46
        state = true;
47
        setTexts(text1, text2);
48
}
49
 
50
void LabelButton::setTexts(QString text1, QString text2)
51
{
52
        TextA = text1;
53
        TextB = text2;
54
        if (state)
55
                setText(TextA);
56
        else
57
                setText(TextB);
58
}
59
 
60
bool LabelButton::getState()
61
{
62
        return state;
63
}
64
 
266 Franz 65
void LabelButton::enterEvent(QEvent*)
66
{
67
        setFrameStyle( QFrame::Panel | QFrame::Raised );
68
        setLineWidth( 2 );
69
}
70
 
71
void LabelButton::leaveEvent(QEvent*)
72
{
73
        setFrameStyle( QFrame::Panel | QFrame::Plain );
74
        setLineWidth( 0 );
75
}
76
 
77
void LabelButton::mousePressEvent(QMouseEvent*)
78
{
79
        setFrameStyle( QFrame::Panel | QFrame::Sunken );
80
        setLineWidth( 2 );
81
}
82
 
265 Franz 83
void LabelButton::mouseReleaseEvent(QMouseEvent*)
84
{
85
        state = !state;
86
        if (state)
87
                setText(TextA);
88
        else
89
                setText(TextB);
266 Franz 90
        setFrameStyle( QFrame::Panel | QFrame::Raised );
91
        setLineWidth( 2 );
265 Franz 92
        emit clicked();
93
}
94
 
68 Franz 95
NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
217 Franz 96
{}
68 Franz 97
 
332 Franz 98
void NameWidget::focusOutEvent(QFocusEvent *e)
68 Franz 99
{
100
        emit Leaved();
332 Franz 101
        QLineEdit::focusOutEvent(e);
68 Franz 102
}
103
 
4313 cbradney 104
Mpalette::Mpalette( QWidget* parent) : ScrPaletteBase( parent, "PropertiesPalette", false, 0)
3 paul 105
{
5257 cbradney 106
        m_MainWindow=0;
107
        doc=0;
217 Franz 108
        HaveDoc = false;
109
        HaveItem = false;
215 Franz 110
        RoVal = 0;
1843 cbradney 111
        Umrech = 1.0;
1448 cbradney 112
        setIcon( loadIcon("AppIcon.png") );
217 Franz 113
        setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
3 paul 114
 
1502 tsoots 115
        _userActionOn = false;
116
        userActionSniffer = new UserActionSniffer();
117
        connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(mspinboxStartUserAction()));
118
        connect(userActionSniffer, SIGNAL(actionEnd()), this, SLOT(mspinboxFinishUserAction()));
119
 
217 Franz 120
        MpalLayout = new QVBoxLayout( this, 5, 1, "MpalLayout");
1448 cbradney 121
        setOrientation(Qt::Vertical);
122
        QFont f(font());
217 Franz 123
        f.setPointSize(f.pointSize()-1);
124
        setFont(f);
332 Franz 125
 
2148 fschmid 126
        TabStack = new QToolBox( this, "TabStack" );
332 Franz 127
 
217 Franz 128
        page = new QWidget( TabStack, "page" );
129
        pageLayout = new QVBoxLayout( page, 0, 5, "pageLayout");
3 paul 130
 
2207 cbradney 131
        NameGroup = new QGroupBox( "Name", page, "NameGroup" );
217 Franz 132
        NameGroup->setColumnLayout(0, Qt::Vertical );
133
        NameGroup->layout()->setSpacing( 4 );
134
        NameGroup->layout()->setMargin( 5 );
135
        NameGroupLayout = new QHBoxLayout( NameGroup->layout() );
136
        NameGroupLayout->setAlignment( Qt::AlignTop );
215 Franz 137
        NameEdit = new NameWidget(NameGroup);
217 Franz 138
        NameGroupLayout->addWidget( NameEdit );
139
        pageLayout->addWidget( NameGroup );
68 Franz 140
 
2207 cbradney 141
        GeoGroup = new QGroupBox( "Geometry", page, "GeoGroup" );
217 Franz 142
        GeoGroup->setColumnLayout(0, Qt::Vertical );
143
        GeoGroup->layout()->setSpacing( 4 );
144
        GeoGroup->layout()->setMargin( 5 );
145
        GeoGroupLayout = new QGridLayout( GeoGroup->layout() );
146
        GeoGroupLayout->setAlignment( Qt::AlignTop );
332 Franz 147
 
333 Franz 148
        Xpos = new MSpinBox( -3000, 3000, GeoGroup, 2 );
1502 tsoots 149
        installSniffer(Xpos);
217 Franz 150
        GeoGroupLayout->addWidget( Xpos, 0, 1 );
333 Franz 151
        Ypos = new MSpinBox( -3000, 3000, GeoGroup, 2 );
1502 tsoots 152
        installSniffer(Ypos);
217 Franz 153
        GeoGroupLayout->addWidget( Ypos, 1, 1 );
154
        Width = new MSpinBox( GeoGroup, 2 );
1502 tsoots 155
        installSniffer(Width);
217 Franz 156
        GeoGroupLayout->addWidget( Width, 2, 1 );
157
        Height = new MSpinBox( GeoGroup, 2 );
1502 tsoots 158
        installSniffer(Height);
217 Franz 159
        GeoGroupLayout->addWidget( Height, 3, 1 );
348 Franz 160
 
2207 cbradney 161
        xposLabel = new QLabel( Xpos, "&X-Pos:", GeoGroup, "xposLabel" );
348 Franz 162
        GeoGroupLayout->addWidget( xposLabel, 0, 0 );
2207 cbradney 163
        yposLabel = new QLabel( Ypos, "&Y-Pos:", GeoGroup, "yposLabel" );
348 Franz 164
        GeoGroupLayout->addWidget( yposLabel, 1, 0 );
2207 cbradney 165
        widthLabel = new QLabel( Width, "&Width:", GeoGroup, "widthLabel" );
348 Franz 166
        GeoGroupLayout->addWidget( widthLabel, 2, 0 );
2207 cbradney 167
        heightLabel = new QLabel( Height, "&Height:", GeoGroup, "heightLabel" );
348 Franz 168
        GeoGroupLayout->addWidget( heightLabel, 3, 0 );
169
 
2606 cbradney 170
        keepFrameWHRatioButton = new LinkButton( GeoGroup );
171
        keepFrameWHRatioButton->setToggleButton( true );
172
        keepFrameWHRatioButton->setAutoRaise( true );
173
        keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
174
        keepFrameWHRatioButton->setOn(true);
175
        GeoGroupLayout->addMultiCellWidget( keepFrameWHRatioButton, 2, 3, 2, 2 );
217 Franz 176
        Rot = new MSpinBox( GeoGroup, 2);
177
        Rot->setWrapping( true );
1502 tsoots 178
        installSniffer(Rot);
2207 cbradney 179
        rotationLabel = new QLabel( Rot, "&Rotation:", GeoGroup, "rotationLabel" );
348 Franz 180
        GeoGroupLayout->addWidget( rotationLabel, 4, 0 );
217 Franz 181
        GeoGroupLayout->addWidget( Rot, 4, 1 );
2207 cbradney 182
        basepointLabel = new QLabel( "Basepoint:", GeoGroup, "basepointLabel" );
332 Franz 183
        GeoGroupLayout->addWidget( basepointLabel, 5, 0 );
184
        RotationGroup = new QButtonGroup( "", GeoGroup, "RotationGroup" );
217 Franz 185
        RotationGroup->setFrameShape( QButtonGroup::NoFrame );
186
        RotationGroup->setColumnLayout(0, Qt::Vertical );
187
        RotationGroup->layout()->setSpacing( 0 );
188
        RotationGroup->layout()->setMargin( 0 );
189
        RotationGroupLayout = new QHBoxLayout( RotationGroup->layout() );
190
        RotationGroupLayout->setAlignment( Qt::AlignTop );
191
        Layout12 = new QGridLayout( 0, 1, 1, 0, 0, "Layout12");
192
        TopLeft = new QRadioButton( RotationGroup, "TopLeft" );
283 Franz 193
        TopLeft->setText( "" );
217 Franz 194
        TopLeft->setChecked( true );
195
        Layout12->addWidget( TopLeft, 0, 0, Qt::AlignCenter );
196
        Line1 = new QFrame( RotationGroup, "Line1" );
197
        Line1->setMinimumSize( QSize( 20, 4 ) );
198
        Line1->setMaximumSize( QSize( 20, 4 ) );
199
        Line1->setFrameShape( QFrame::HLine );
200
        Line1->setFrameShadow( QFrame::Plain );
201
        Line1->setLineWidth( 3 );
202
        Line1->setFrameShape( QFrame::HLine );
203
        Layout12->addWidget( Line1, 0, 1, Qt::AlignCenter );
204
        TopRight = new QRadioButton( RotationGroup, "TopRight" );
283 Franz 205
        TopRight->setText( "" );
217 Franz 206
        Layout12->addWidget( TopRight, 0, 2, Qt::AlignCenter );
207
        Line2 = new QFrame( RotationGroup, "Line2" );
208
        Line2->setMinimumSize( QSize( 4, 20 ) );
209
        Line2->setMaximumSize( QSize( 4, 20 ) );
210
        Line2->setFrameShape( QFrame::VLine );
211
        Line2->setFrameShadow( QFrame::Plain );
212
        Line2->setLineWidth( 3 );
213
        Line2->setFrameShape( QFrame::VLine );
214
        Layout12->addWidget( Line2, 1, 0, Qt::AlignCenter );
215
        Center = new QRadioButton( RotationGroup, "Center" );
283 Franz 216
        Center->setText( "" );
217 Franz 217
        Layout12->addWidget( Center, 1, 1, Qt::AlignCenter );
218
        Line4 = new QFrame( RotationGroup, "Line4" );
219
        Line4->setMinimumSize( QSize( 4, 20 ) );
220
        Line4->setMaximumSize( QSize( 4, 20 ) );
221
        Line4->setFrameShadow( QFrame::Plain );
222
        Line4->setLineWidth( 3 );
223
        Line4->setFrameShape( QFrame::VLine );
224
        Layout12->addWidget( Line4, 1, 2, Qt::AlignCenter );
225
        BottomLeft = new QRadioButton( RotationGroup, "BottomLeft" );
283 Franz 226
        BottomLeft->setText( "" );
217 Franz 227
        Layout12->addWidget( BottomLeft, 2, 0, Qt::AlignCenter );
228
        Line5 = new QFrame( RotationGroup, "Line5" );
229
        Line5->setMinimumSize( QSize( 20, 4 ) );
230
        Line5->setMaximumSize( QSize( 20, 4 ) );
231
        Line5->setFrameShape( QFrame::HLine );
232
        Line5->setFrameShadow( QFrame::Plain );
233
        Line5->setLineWidth( 3 );
234
        Line5->setFrameShape( QFrame::HLine );
235
        Layout12->addWidget( Line5, 2, 1, Qt::AlignCenter );
236
        BottomRight = new QRadioButton( RotationGroup, "BottomRight" );
283 Franz 237
        BottomRight->setText( "" );
217 Franz 238
        Layout12->addWidget( BottomRight, 2, 2, Qt::AlignCenter );
239
        RotationGroupLayout->addLayout( Layout12 );
240
        QSpacerItem* spacer12 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
241
        RotationGroupLayout->addItem( spacer12 );
242
        GeoGroupLayout->addWidget( RotationGroup, 5, 1 );
243
        pageLayout->addWidget( GeoGroup );
3 paul 244
 
217 Franz 245
        layout60 = new QHBoxLayout( 0, 0, 5, "layout60");
3 paul 246
 
2207 cbradney 247
        LayerGroup = new QGroupBox( "Level", page, "LayerGroup" );
217 Franz 248
        LayerGroup->setColumnLayout(0, Qt::Vertical );
249
        LayerGroup->layout()->setSpacing( 4 );
250
        LayerGroup->layout()->setMargin( 5 );
251
        LayerGroupLayout = new QGridLayout( LayerGroup->layout() );
252
        LayerGroupLayout->setAlignment( Qt::AlignTop );
253
        Zup = new QToolButton( LayerGroup, "Zup" );
254
        Zup->setMaximumSize( QSize( 22, 22 ) );
5179 cbradney 255
        Zup->setPixmap(loadIcon("16/go-up.png"));
217 Franz 256
        LayerGroupLayout->addWidget( Zup, 0, 0 );
257
        ZDown = new QToolButton( LayerGroup, "ZDown" );
258
        ZDown->setMaximumSize( QSize( 22, 22 ) );
5179 cbradney 259
        ZDown->setPixmap(loadIcon("16/go-down.png"));
217 Franz 260
        LayerGroupLayout->addWidget( ZDown, 1, 0 );
261
        ZTop = new QToolButton( LayerGroup, "ZTop" );
262
        ZTop->setMaximumSize( QSize( 22, 22 ) );
5179 cbradney 263
        ZTop->setPixmap(loadIcon("16/go-top.png"));
217 Franz 264
        LayerGroupLayout->addWidget( ZTop, 0, 1 );
265
        ZBottom = new QToolButton( LayerGroup, "ZBottom" );
266
        ZBottom->setMaximumSize( QSize( 22, 22 ) );
5179 cbradney 267
        ZBottom->setPixmap(loadIcon("16/go-bottom.png"));
217 Franz 268
        LayerGroupLayout->addWidget( ZBottom, 1, 1 );
332 Franz 269
        LevelTxt = new QLabel( "  0", LayerGroup, "LevelTxt" );
272 Franz 270
        LevelTxt->setAlignment( Qt::AlignCenter );
271
        LayerGroupLayout->addMultiCellWidget( LevelTxt, 0, 1, 2, 2 );
3 paul 272
 
217 Franz 273
        layout60->addWidget( LayerGroup );
274
        QSpacerItem* spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
275
        layout60->addItem( spacer2 );
3 paul 276
 
217 Franz 277
        Layout44 = new QGridLayout( 0, 1, 1, 8, 4, "Layout44");
278
        FlipH = new QToolButton( page, "MirrorH" );
5208 cbradney 279
        FlipH->setPixmap(loadIcon("16/flip-object-horizontal.png"));
217 Franz 280
        FlipH->setToggleButton( true );
281
        Layout44->addWidget( FlipH, 0, 0 );
282
        FlipV = new QToolButton( page, "MirrorV" );
5208 cbradney 283
        FlipV->setPixmap(loadIcon("16/flip-object-vertical.png"));
217 Franz 284
        FlipV->setToggleButton( true );
285
        Layout44->addWidget( FlipV, 1, 0 );
286
        Locked = new QToolButton( page, "Lock" );
287
        Locked->setToggleButton( true );
215 Franz 288
        QIconSet a = QIconSet();
5169 cbradney 289
        a.setPixmap(loadIcon("16/lock.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::On);
290
        a.setPixmap(loadIcon("16/lock-unlocked.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off);
215 Franz 291
        Locked->setIconSet(a);
217 Franz 292
        Layout44->addWidget( Locked, 0, 1 );
293
        NoPrint = new QToolButton( page, "NoPrint" );
294
        NoPrint->setToggleButton( true );
215 Franz 295
        QIconSet a2 = QIconSet();
217 Franz 296
        a2.setPixmap(loadIcon("NoPrint.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::On);
297
        a2.setPixmap(loadIcon("DateiPrint16.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off);
215 Franz 298
        NoPrint->setIconSet(a2);
217 Franz 299
        Layout44->addWidget( NoPrint, 1, 1 );
300
        NoResize = new QToolButton( page, "NoResize" );
301
        NoResize->setToggleButton( true );
215 Franz 302
        QIconSet a3 = QIconSet();
217 Franz 303
        a3.setPixmap(loadIcon("framenoresize.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::On);
304
        a3.setPixmap(loadIcon("frameresize.png"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off);
215 Franz 305
        NoResize->setIconSet(a3);
217 Franz 306
        Layout44->addWidget( NoResize, 0, 2 );
307
        layout60->addLayout( Layout44 );
68 Franz 308
 
217 Franz 309
        pageLayout->addLayout( layout60 );
3 paul 310
 
217 Franz 311
        QSpacerItem* spacer13 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
312
        pageLayout->addItem( spacer13 );
2207 cbradney 313
        idXYZItem=TabStack->addItem( page, "X, Y, &Z" );
3 paul 314
 
217 Franz 315
        page_2 = new QWidget( TabStack, "page_2" );
316
        pageLayout_2 = new QVBoxLayout( page_2, 0, 5, "pageLayout_2");
3 paul 317
 
332 Franz 318
        ShapeGroup = new QButtonGroup( "", page_2, "ShapeGroup" );
217 Franz 319
        ShapeGroup->setFrameShape( QButtonGroup::NoFrame );
320
        ShapeGroup->setExclusive( true );
321
        ShapeGroup->setColumnLayout(0, Qt::Vertical );
322
        ShapeGroup->layout()->setSpacing( 2 );
323
        ShapeGroup->layout()->setMargin( 0 );
324
        ShapeGroupLayout = new QHBoxLayout( ShapeGroup->layout() );
325
        ShapeGroupLayout->setAlignment( Qt::AlignTop );
2207 cbradney 326
        SRect = new QLabel( "Shape:", ShapeGroup, "SRect" );
217 Franz 327
        ShapeGroupLayout->addWidget( SRect );
328
        SCustom = new Autoforms( ShapeGroup );
329
        ShapeGroupLayout->addWidget( SCustom );
330
        pageLayout_2->addWidget( ShapeGroup );
3 paul 331
 
217 Franz 332
        EditShape = new QToolButton( page_2, "EditShape" );
333
        pageLayout_2->addWidget( EditShape );
3 paul 334
 
217 Franz 335
        Layout13 = new QHBoxLayout( 0, 0, 2, "Layout13");
3 paul 336
 
217 Franz 337
        RoundRect = new MSpinBox( page_2, 1 );
2208 cbradney 338
        rndcornersLabel = new QLabel( RoundRect, "R&ound\nCorners:", page_2, "rndcornersLabel" );
348 Franz 339
        Layout13->addWidget( rndcornersLabel );
217 Franz 340
        Layout13->addWidget( RoundRect );
341
        pageLayout_2->addLayout( Layout13 );
3 paul 342
 
217 Franz 343
        TabStack2 = new QWidgetStack( page_2, "TabStack2" );
344
        TabStack2->setFrameShape( QWidgetStack::NoFrame );
68 Franz 345
 
217 Franz 346
        page_2a = new QWidget( TabStack2, "page" );
347
        pageLayout_2a = new QVBoxLayout( page_2a, 0, 5, "pageLayout_2");
2207 cbradney 348
        Distance = new QGroupBox( "Distance of Text", page_2a, "Distance" );
217 Franz 349
        Distance->setColumnLayout(0, Qt::Vertical );
350
        Distance->layout()->setSpacing( 2 );
351
        Distance->layout()->setMargin( 5 );
352
        DistanceLayout = new QGridLayout( Distance->layout() );
353
        DistanceLayout->setAlignment( Qt::AlignTop );
348 Franz 354
 
333 Franz 355
        DCol = new QSpinBox(Distance, "Cols" );
356
    DCol->setMaxValue( 3000 );
357
    DCol->setMinValue( 1 );
2208 cbradney 358
        columnsLabel = new QLabel( DCol, "Colu&mns:", Distance, "columnsLabel" );
348 Franz 359
        DistanceLayout->addWidget( columnsLabel, 0, 0 );
217 Franz 360
        DistanceLayout->addWidget( DCol, 0, 1 );
333 Franz 361
 
1194 fschmid 362
        dGap = new MSpinBox( 0, 300, Distance, 1 );
2208 cbradney 363
        colgapLabel = new LabelButton( Distance, "&Gap:", "&Width:");
1194 fschmid 364
        colgapLabel->setBuddy(dGap);
348 Franz 365
        DistanceLayout->addWidget( colgapLabel, 1, 0 );
1194 fschmid 366
        DistanceLayout->addWidget( dGap, 1, 1 );
333 Franz 367
 
368
        DTop = new MSpinBox( 0, 300, Distance, 1 );
2208 cbradney 369
        topLabel = new QLabel( DTop, "To&p:", Distance, "topLabel" );
348 Franz 370
        DistanceLayout->addWidget( topLabel, 2, 0 );
217 Franz 371
        DistanceLayout->addWidget( DTop, 2, 1 );
333 Franz 372
 
373
        DBottom = new MSpinBox( 0, 300, Distance, 1 );
2208 cbradney 374
        bottomLabel = new QLabel( DBottom, "&Bottom:", Distance, "bottomLabel" );
348 Franz 375
        DistanceLayout->addWidget( bottomLabel, 3, 0 );
217 Franz 376
        DistanceLayout->addWidget( DBottom, 3, 1 );
333 Franz 377
 
378
        DLeft = new MSpinBox( 0, 300, Distance, 1 );
2208 cbradney 379
        leftLabel = new QLabel( DLeft, "&Left:", Distance, "leftLabel" );
348 Franz 380
        DistanceLayout->addWidget( leftLabel, 4, 0 );
217 Franz 381
        DistanceLayout->addWidget( DLeft, 4, 1 );
333 Franz 382
 
383
        DRight = new MSpinBox( 0, 300, Distance, 1 );
2208 cbradney 384
        rightLabel = new QLabel( DRight, "&Right:", Distance, "rightLabel" );
348 Franz 385
        DistanceLayout->addWidget( rightLabel, 5, 0 );
217 Franz 386
        DistanceLayout->addWidget( DRight, 5, 1 );
333 Franz 387
 
2636 cbradney 388
        TabsButton = new QToolButton( Distance, "T&abulators..." );
215 Franz 389
        DistanceLayout->addMultiCellWidget( TabsButton, 6, 6, 0, 1 );
390
        pageLayout_2a->addWidget(Distance);
217 Franz 391
        TabStack2->addWidget( page_2a, 0 );
68 Franz 392
 
217 Franz 393
        page_2b = new QWidget( TabStack2, "page" );
394
        pageLayout_2b = new QVBoxLayout( page_2b, 0, 5, "pageLayout_2");
2208 cbradney 395
        Distance2 = new QGroupBox( "Path Text Properties", page_2b, "Distance" );
217 Franz 396
        Distance2->setColumnLayout(0, Qt::Vertical );
397
        Distance2->layout()->setSpacing( 2 );
398
        Distance2->layout()->setMargin( 5 );
399
        DistanceLayout2 = new QGridLayout( Distance2->layout() );
400
        DistanceLayout2->setAlignment( Qt::AlignTop );
332 Franz 401
        showcurveCheckBox = new QCheckBox( Distance2, "showcurveCheckBox" );
2208 cbradney 402
        showcurveCheckBox->setText( "Show Curve" );
332 Franz 403
        DistanceLayout2->addMultiCellWidget( showcurveCheckBox, 0, 0, 0, 1 );
2208 cbradney 404
        startoffsetLabel = new QLabel( "Start Offset:", Distance2, "startoffsetLabel" );
332 Franz 405
        DistanceLayout2->addWidget( startoffsetLabel, 1, 0);
387 Franz 406
        Dist = new MSpinBox( 0, 30000, Distance2, 1 );
217 Franz 407
        Dist->setLineStep(10);
408
        DistanceLayout2->addWidget( Dist, 1, 1);
333 Franz 409
 
2208 cbradney 410
        distfromcurveLabel = new QLabel( "Distance from Curve:", Distance2, "distfromcurveLabel" );
332 Franz 411
        DistanceLayout2->addWidget( distfromcurveLabel, 2, 0);
333 Franz 412
        LineW = new MSpinBox( -300, 300, Distance2, 1 );
215 Franz 413
        LineW->setLineStep(10);
217 Franz 414
        DistanceLayout2->addWidget( LineW, 2, 1);
215 Franz 415
        pageLayout_2b->addWidget(Distance2);
217 Franz 416
        TabStack2->addWidget( page_2b, 1 );
134 Franz 417
 
4477 fschmid 418
        page_2c = new QWidget( TabStack2, "page" );
419
        pageLayout_2c = new QVBoxLayout( page_2c, 0, 5, "pageLayout_2");
420
        Distance3 = new QButtonGroup( "Fill Rule", page_2c, "Distance" );
421
        Distance3->setColumnLayout(0, Qt::Vertical );
422
        Distance3->layout()->setSpacing( 2 );
423
        Distance3->layout()->setMargin( 5 );
424
        DistanceLayout3 = new QVBoxLayout( Distance3->layout() );
425
        DistanceLayout3->setAlignment( Qt::AlignTop );
426
        EvenOdd = new QRadioButton( "Even-Odd", Distance3, "EvenOdd" );
427
        DistanceLayout3->addWidget( EvenOdd );
428
        NonZero = new QRadioButton( "Non Zero", Distance3, "NonZero" );
429
        DistanceLayout3->addWidget( NonZero );
430
        EvenOdd->setChecked( true );
431
        pageLayout_2c->addWidget(Distance3);
432
        TabStack2->addWidget( page_2c, 2 );
433
 
217 Franz 434
        pageLayout_2->addWidget( TabStack2 );
351 Franz 435
 
5620 jghali 436
        textFlowOptions = new QButtonGroup( page_2, "textFlowOptions" );
437
        textFlowOptions->setColumnLayout(0, Qt::Vertical );
438
        textFlowOptions->layout()->setSpacing( 5 );
439
        textFlowOptions->layout()->setMargin( 10 );
440
        textFlowOptionsLayout = new QVBoxLayout( textFlowOptions->layout() );
441
        textFlowOptionsLayout->setAlignment( Qt::AlignTop );
442
        textFlowOptions->setCheckable( false );
443
        textFlowOptions->setExclusive( true );
5705 jghali 444
        textFlowDisabled = new QToolButton( textFlowOptions, "textFlowDisabled" );
445
        textFlowDisabled->setToggleButton( true );
446
        textFlowDisabled->setTextPosition( QToolButton::BesideIcon );
447
        textFlowDisabled->setUsesTextLabel( true );
448
        textFlowDisabled->setTextLabel( "Disabled" );
449
        textFlowDisabled->setPixmap(loadIcon("flow-none.png"));
5620 jghali 450
        textFlowOptionsLayout->addWidget( textFlowDisabled );
5705 jghali 451
        textFlowUsesFrameShape  = new QToolButton( textFlowOptions, "textFlowUsesObjectFrame" );
452
        textFlowUsesFrameShape->setToggleButton( true );
453
        textFlowUsesFrameShape->setTextPosition( QToolButton::BesideIcon );
454
        textFlowUsesFrameShape->setUsesTextLabel( true );
455
        textFlowUsesFrameShape->setTextLabel( "Use &Frame Shape" );
456
        textFlowUsesFrameShape->setPixmap(loadIcon("flow-frame.png"));
5620 jghali 457
        textFlowOptionsLayout->addWidget( textFlowUsesFrameShape );
5705 jghali 458
        textFlowUsesBoundingBox = new QToolButton( textFlowOptions, "textFlowUsesBoundingBox" );
459
        textFlowUsesBoundingBox->setToggleButton( true );
460
        textFlowUsesBoundingBox->setTextPosition( QToolButton::BesideIcon );
461
        textFlowUsesBoundingBox->setUsesTextLabel( true );
462
        textFlowUsesBoundingBox->setTextLabel( "Use &Bounding Box" );
463
        textFlowUsesBoundingBox->setPixmap(loadIcon("flow-bounding.png"));
5620 jghali 464
        textFlowOptionsLayout->addWidget( textFlowUsesBoundingBox );
5705 jghali 465
        textFlowUsesContourLine = new QToolButton( textFlowOptions, "textFlowUsesContourLine" );
466
        textFlowUsesContourLine->setToggleButton( true );
467
        textFlowUsesContourLine->setTextPosition( QToolButton::BesideIcon );
468
        textFlowUsesContourLine->setUsesTextLabel( true );
469
        textFlowUsesContourLine->setTextLabel( "&Use Contour Line" );
470
        textFlowUsesContourLine->setPixmap(loadIcon("flow-contour.png"));
5620 jghali 471
        textFlowOptionsLayout->addWidget( textFlowUsesContourLine );
472
        pageLayout_2->addWidget( textFlowOptions  );
351 Franz 473
 
217 Franz 474
        QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
475
        pageLayout_2->addItem( spacer6 );
2207 cbradney 476
        idShapeItem=TabStack->addItem( page_2, "&Shape" );
3 paul 477
 
217 Franz 478
        page_3 = new QWidget( TabStack, "page_3" );
479
        pageLayout_3 = new QVBoxLayout( page_3, 0, 5, "pageLayout_3");
2230 fschmid 480
        pageLayout_3->setAlignment( Qt::AlignLeft );
3 paul 481
 
217 Franz 482
        layout47 = new QHBoxLayout( 0, 0, 5, "layout47");
3 paul 483
 
217 Franz 484
        layout46 = new QVBoxLayout( 0, 0, 5, "layout46");
3 paul 485
 
217 Franz 486
        layout41 = new QGridLayout( 0, 1, 1, 0, 5, "layout41");
2230 fschmid 487
        layout41->setAlignment( Qt::AlignLeft );
3 paul 488
 
2834 cbradney 489
        Fonts = new FontComboH(page_3);
2508 fschmid 490
        Fonts->setMaximumSize(200, 80);
2230 fschmid 491
        layout41->addMultiCellWidget( Fonts, 0, 0, 0, 3 );
3 paul 492
 
2247 fschmid 493
        Size = new MSpinBox( 0.5, 2048, page_3, 1 );
217 Franz 494
        Size->setPrefix( "" );
2230 fschmid 495
        fontsizeLabel = new QLabel( "", page_3, "fontsizeLabel" );
496
        fontsizeLabel->setPixmap(loadIcon("Zeichen.xpm"));
348 Franz 497
        layout41->addWidget( fontsizeLabel, 1, 0 );
217 Franz 498
        layout41->addWidget( Size, 1, 1 );
2242 fschmid 499
        ChBase = new MSpinBox( -100, 100, page_3, 1 );
2230 fschmid 500
        ChBase->setValue( 0 );
501
        ChBaseTxt = new QLabel("", page_3, "ChBaseTxt" );
502
        ChBaseTxt->setPixmap(loadIcon("textbase.png"));
503
        layout41->addWidget( ChBaseTxt, 1, 2 );
504
        layout41->addWidget( ChBase, 1, 3 );
2285 fschmid 505
        LineSp = new MSpinBox( page_3, 1 );
506
        layout41->addWidget( LineSp, 2, 1 );
2309 fschmid 507
        lineSpacingPop = new QPopupMenu();
508
        lineSpacingPop->insertItem( tr("Fixed Linespacing"));
509
        lineSpacingPop->insertItem( tr("Automatic Linespacing"));
510
        lineSpacingPop->insertItem( tr("Align to Baseline Grid"));
4963 cbradney 511
        linespacingButton = new QToolButton(page_3, "linespacingButton" );
512
        linespacingButton->setText("");
513
        linespacingButton->setPixmap(loadIcon("linespacing.png"));
514
        linespacingButton->setPopup(lineSpacingPop);
515
        linespacingButton->setPopupDelay(400);
516
        linespacingButton->setAutoRaise(true);
517
        layout41->addWidget( linespacingButton, 2, 0 );
2285 fschmid 518
        Extra = new MSpinBox( page_3, 1 );
519
        layout41->addWidget( Extra, 2, 3 );
520
        trackingLabel = new QLabel( "", page_3, "trackingLabel" );
521
        trackingLabel->setText("");
522
        trackingLabel->setPixmap(loadIcon("textkern.png"));
523
        layout41->addWidget( trackingLabel, 2, 2 );
2242 fschmid 524
        ChScale = new MSpinBox( 10, 400, page_3, 1 );
217 Franz 525
        ChScale->setValue( 100 );
2230 fschmid 526
        ScaleTxt = new QLabel("", page_3, "ScaleTxt" );
527
        ScaleTxt->setPixmap(loadIcon("textscaleh.png"));
2285 fschmid 528
        layout41->addWidget( ScaleTxt, 3, 0 );
529
        layout41->addWidget( ChScale, 3 , 1 );
2242 fschmid 530
        ChScaleV = new MSpinBox( 10, 400, page_3, 1 );
2230 fschmid 531
        ChScaleV->setValue( 100 );
532
        ScaleTxtV = new QLabel("", page_3, "ScaleTxtV" );
533
        ScaleTxtV->setPixmap(loadIcon("textscalev.png"));
2285 fschmid 534
        layout41->addWidget( ScaleTxtV, 3, 2 );
535
        layout41->addWidget( ChScaleV, 3, 3 );
536
 
2230 fschmid 537
        layout46->addLayout( layout41 );
68 Franz 538
 
217 Franz 539
        layout23 = new QHBoxLayout( 0, 0, 5, "layout23");
2370 fschmid 540
        layout23->setAlignment( Qt::AlignLeft );
332 Franz 541
        StrokeIcon = new QLabel( "", page_3, "StrokeIcon" );
217 Franz 542
        StrokeIcon->setPixmap(loadIcon("Stiftalt.xpm"));
543
        StrokeIcon->setScaledContents( false );
544
        layout23->addWidget( StrokeIcon );
4689 mrdocs 545
        TxStroke = new ColorCombo( false, page_3, "TxStroke" );
217 Franz 546
        layout23->addWidget( TxStroke );
2370 fschmid 547
        ShadeTxt1 = new QLabel( "", page_3, "ShadeTxt" );
548
        ShadeTxt1->setPixmap(loadIcon("shade.png"));
215 Franz 549
        layout23->addWidget( ShadeTxt1 );
173 Franz 550
        PM1 = new ShadeButton(page_3);
217 Franz 551
        layout23->addWidget( PM1 );
552
        layout46->addLayout( layout23 );
553
        layout24 = new QHBoxLayout( 0, 0, 5, "layout24");
2370 fschmid 554
        layout24->setAlignment( Qt::AlignLeft );
332 Franz 555
        FillIcon = new QLabel( "", page_3, "FillIcon" );
217 Franz 556
        FillIcon->setPixmap(loadIcon("fill.png"));
557
        layout24->addWidget( FillIcon );
4689 mrdocs 558
        TxFill = new ColorCombo( false, page_3, "TxFill" );
217 Franz 559
        layout24->addWidget( TxFill );
2370 fschmid 560
        ShadeTxt2 = new QLabel("", page_3, "ShadeTxt" );
561
        ShadeTxt2->setPixmap(loadIcon("shade.png"));
215 Franz 562
        layout24->addWidget( ShadeTxt2 );
173 Franz 563
        PM2 = new ShadeButton(page_3);
217 Franz 564
        layout24->addWidget( PM2 );
565
        layout46->addLayout( layout24 );
68 Franz 566
 
217 Franz 567
        Layout1 = new QHBoxLayout( 0, 0, 0, "Layout1");
2230 fschmid 568
        Layout1->setAlignment( Qt::AlignLeft );
167 Franz 569
        SeStyle = new StyleSelect(page_3);
570
        Layout1->addWidget(SeStyle);
217 Franz 571
        Revert = new QToolButton( page_3, "Bold" );
572
        Revert->setMaximumSize( QSize( 22, 22 ) );
573
        Revert->setText("");
574
        Revert->setPixmap(loadIcon("Revers.png"));
575
        Revert->setToggleButton( true );
576
        Layout1->addWidget( Revert );
577
        QSpacerItem* spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
578
        Layout1->addItem( spacer7 );
579
        layout46->addLayout( Layout1 );
580
        layout47->addLayout( layout46 );
581
        pageLayout_3->addLayout( layout47 );
3 paul 582
 
217 Franz 583
        GroupAlign = new AlignSelect(page_3);
584
        pageLayout_3->addWidget( GroupAlign );
3 paul 585
 
244 Franz 586
        GroupBox3aLayout = new QGridLayout( 0, 1, 1, 0, 5, "Layout25");
2230 fschmid 587
        GroupBox3aLayout->setAlignment( Qt::AlignLeft );
348 Franz 588
        Spal = new Spalette(page_3);
2208 cbradney 589
        styleLabel = new QLabel( Spal, "St&yle:", page_3, "styleLabel" );
332 Franz 590
        GroupBox3aLayout->addWidget( styleLabel, 0, 0 );
244 Franz 591
        GroupBox3aLayout->addWidget( Spal, 0, 1 );
3680 cbradney 592
        langCombo = new ScComboBox( false, page_3, "Lang" );
2208 cbradney 593
        langLabel = new QLabel( langCombo, "Lan&guage:", page_3, "langLabel" );
348 Franz 594
        GroupBox3aLayout->addWidget( langLabel, 1, 0 );
332 Franz 595
        GroupBox3aLayout->addWidget( langCombo, 1, 1 );
244 Franz 596
        pageLayout_3->addLayout(GroupBox3aLayout);
68 Franz 597
 
217 Franz 598
        QSpacerItem* spacer8 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
599
        pageLayout_3->addItem( spacer8 );
2207 cbradney 600
        idTextItem=TabStack->addItem( page_3, "&Text" );
3 paul 601
 
217 Franz 602
        page_4 = new QWidget( TabStack, "page_4" );
603
        pageLayout_4 = new QVBoxLayout( page_4, 0, 5, "pageLayout_4");
3 paul 604
 
2208 cbradney 605
        FreeScale = new QRadioButton( "&Free Scaling", page_4, "FreeScale" );
217 Franz 606
        FreeScale->setChecked( true );
607
        pageLayout_4->addWidget( FreeScale );
3 paul 608
 
217 Franz 609
        layout43 = new QGridLayout( 0, 1, 1, 0, 5, "layout43");
4821 cbradney 610
        imageXOffsetSpinBox = new MSpinBox( page_4, 2 );
611
        installSniffer(imageXOffsetSpinBox);
612
        xposImgLabel = new QLabel( imageXOffsetSpinBox, "&X-Pos:", page_4, "xposImgLabel" );
348 Franz 613
        layout43->addWidget( xposImgLabel, 0, 0 );
4821 cbradney 614
        layout43->addWidget( imageXOffsetSpinBox, 0, 1 );
615
        imageYOffsetSpinBox = new MSpinBox( page_4, 2 );
616
        installSniffer(imageYOffsetSpinBox);
617
        yposImgLabel = new QLabel( imageYOffsetSpinBox, "&Y-Pos:", page_4, "yposImgLabel" );
348 Franz 618
        layout43->addWidget( yposImgLabel, 1, 0 );
4821 cbradney 619
        layout43->addWidget( imageYOffsetSpinBox, 1, 1 );
620
        imageXScaleSpinBox = new MSpinBox( page_4, 1 );
621
        installSniffer(imageXScaleSpinBox);
622
        xscaleLabel = new QLabel( imageXScaleSpinBox, "X-Sc&ale:", page_4, "xscaleLabel" );
348 Franz 623
        layout43->addWidget( xscaleLabel, 2, 0 );
4821 cbradney 624
        layout43->addWidget( imageXScaleSpinBox, 2, 1 );
625
        imageYScaleSpinBox = new MSpinBox( page_4, 1 );
626
        installSniffer(imageYScaleSpinBox);
627
        yscaleLabel = new QLabel( imageYScaleSpinBox, "Y-Scal&e:", page_4, "yscaleLabel" );
348 Franz 628
        layout43->addWidget( yscaleLabel, 3, 0 );
4821 cbradney 629
        layout43->addWidget( imageYScaleSpinBox, 3, 1 );
2606 cbradney 630
        keepImageWHRatioButton = new LinkButton( page_4 );
631
        keepImageWHRatioButton->setToggleButton( true );
632
        keepImageWHRatioButton->setAutoRaise( true );
633
        keepImageWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
634
        layout43->addMultiCellWidget( keepImageWHRatioButton, 2, 3, 2, 2 );
2389 fschmid 635
        imgDpiX = new MSpinBox( page_4, 1 );
4828 cbradney 636
        installSniffer(imgDpiX);
2389 fschmid 637
        imgDPIXLabel = new QLabel( imgDpiX, "Actual X-DPI:", page_4, "imgDPIYLabel" );
638
        layout43->addWidget( imgDPIXLabel, 4, 0 );
639
        layout43->addWidget( imgDpiX, 4, 1 );
640
        imgDpiY = new MSpinBox( page_4, 1 );
4828 cbradney 641
        installSniffer(imgDpiY);
2389 fschmid 642
        imgDPIYLabel = new QLabel( imgDpiY, "Actual Y-DPI:", page_4, "imgDPIYLabel" );
643
        layout43->addWidget( imgDPIYLabel, 5, 0 );
644
        layout43->addWidget( imgDpiY, 5, 1 );
2606 cbradney 645
        keepImageDPIRatioButton = new LinkButton( page_4 );
646
        keepImageDPIRatioButton->setToggleButton( true );
647
        keepImageDPIRatioButton->setAutoRaise( true );
648
        keepImageDPIRatioButton->setMaximumSize( QSize( 15, 32767 ) );
649
        layout43->addMultiCellWidget( keepImageDPIRatioButton, 4, 5, 2, 2 );
217 Franz 650
        pageLayout_4->addLayout( layout43 );
3 paul 651
 
217 Franz 652
        Layout24 = new QVBoxLayout( 0, 0, 3, "Layout24");
3 paul 653
 
217 Franz 654
        FrameScale = new QRadioButton( page_4, "FixedScale" );
2208 cbradney 655
        FrameScale->setText( "Scale &To Frame Size" );
217 Franz 656
        Layout24->addWidget( FrameScale );
3 paul 657
 
217 Franz 658
        Layout18 = new QHBoxLayout( 0, 0, 6, "Layout18");
3 paul 659
 
217 Franz 660
        Frame4 = new QFrame( page_4, "Frame4" );
661
        Frame4->setMinimumSize( QSize( 15, 2 ) );
662
        Frame4->setMaximumSize( QSize( 15, 10 ) );
663
        Frame4->setFrameShape( QFrame::NoFrame );
664
        Frame4->setFrameShadow( QFrame::Plain );
665
        Layout18->addWidget( Frame4 );
3 paul 666
 
217 Franz 667
        Aspect = new QCheckBox( page_4, "Aspect" );
668
        Aspect->setEnabled( false );
2208 cbradney 669
        Aspect->setText( "P&roportional" );
217 Franz 670
        Aspect->setChecked( true );
215 Franz 671
 
217 Franz 672
        Layout18->addWidget( Aspect );
673
        Layout24->addLayout( Layout18 );
674
        pageLayout_4->addLayout( Layout24 );
129 Franz 675
 
332 Franz 676
        GroupBoxCM = new QGroupBox( "", page_4, "GroupBoxcm" );
217 Franz 677
        GroupBoxCM->setColumnLayout(0, Qt::Vertical );
678
        GroupBoxCM->layout()->setSpacing( 2 );
679
        GroupBoxCM->layout()->setMargin( 5 );
680
        GroupBoxCM->setFrameShape( QFrame::NoFrame );
681
        GroupBoxCM->setFrameShadow( QFrame::Plain );
682
        GroupBoxCMLayout = new QVBoxLayout( GroupBoxCM->layout() );
683
        GroupBoxCMLayout->setAlignment( Qt::AlignTop );
2207 cbradney 684
        TextCms1 = new QLabel( GroupBoxCM, "xposLabel" );
215 Franz 685
        GroupBoxCMLayout->addWidget( TextCms1 );
3680 cbradney 686
        InputP = new ScComboBox( false, GroupBoxCM, "InputP" );
217 Franz 687
        GroupBoxCMLayout->addWidget(InputP);
2207 cbradney 688
        TextCms2 = new QLabel( GroupBoxCM, "TextCms2" );
215 Franz 689
        GroupBoxCMLayout->addWidget(TextCms2);
3680 cbradney 690
        MonitorI = new ScComboBox( false, GroupBoxCM, "MonitorI" );
217 Franz 691
        GroupBoxCMLayout->addWidget(MonitorI);
692
        pageLayout_4->addWidget(GroupBoxCM);
68 Franz 693
 
217 Franz 694
        QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
695
        pageLayout_4->addItem( spacer9 );
2207 cbradney 696
        idImageItem=TabStack->addItem( page_4, "&Image" );
3 paul 697
 
217 Franz 698
        page_5 = new QWidget( TabStack, "page_5" );
699
        pageLayout_5 = new QVBoxLayout( page_5, 0, 5, "pageLayout_5");
3 paul 700
 
217 Franz 701
        Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2");
3680 cbradney 702
        LineMode = new ScComboBox( false, page_5, "LMode" );
2208 cbradney 703
        LineModeT = new QLabel( LineMode, "&Basepoint:", page_5, "LModeText" );
348 Franz 704
        Layout13_2->addWidget( LineModeT );
217 Franz 705
        Layout13_2->addWidget( LineMode );
215 Franz 706
        LMode = false;
217 Franz 707
        QSpacerItem* spacer10 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
708
        Layout13_2->addItem( spacer10 );
709
        pageLayout_5->addLayout( Layout13_2 );
3 paul 710
 
217 Franz 711
        Layout12_2 = new QGridLayout( 0, 1, 1, 0, 3, "Layout12_2");
348 Franz 712
        LStyle = new LineCombo(page_5);
2207 cbradney 713
        linetypeLabel = new QLabel( LStyle, "T&ype of Line:", page_5, "linetypeLabel" );
2148 fschmid 714
        Layout12_2->addWidget( linetypeLabel, 0, 0 );
715
        Layout12_2->addWidget( LStyle, 0, 1 );
740 fschmid 716
        startArrow = new ArrowChooser(page_5, true);
2148 fschmid 717
        Layout12_2->addWidget( startArrow, 2, 0 );
740 fschmid 718
        endArrow = new ArrowChooser(page_5, false);
2148 fschmid 719
        Layout12_2->addWidget( endArrow, 2, 1 );
2207 cbradney 720
        startArrowText = new QLabel( startArrow, "Start Arrow:", page_5, "startArrowText" );
2148 fschmid 721
        Layout12_2->addWidget( startArrowText, 1, 0 );
2207 cbradney 722
        endArrowText = new QLabel( endArrow, "End Arrow:", page_5, "endArrowText" );
2148 fschmid 723
        Layout12_2->addWidget( endArrowText, 1, 1 );
5241 fschmid 724
        LSize = new MSpinBox( page_5, 3 );
2207 cbradney 725
        linewidthLabel = new QLabel(LSize, "Line &Width:", page_5, "linewidthLabel" );
2148 fschmid 726
        Layout12_2->addWidget( linewidthLabel, 3, 0 );
727
        Layout12_2->addWidget( LSize, 3, 1 );
3680 cbradney 728
        LJoinStyle = new ScComboBox( false, page_5, "LJoin" );
2207 cbradney 729
        edgesLabel = new QLabel( LJoinStyle, "Ed&ges:", page_5, "edgesLabel" );
2148 fschmid 730
        Layout12_2->addWidget( edgesLabel, 4, 0 );
731
        Layout12_2->addWidget( LJoinStyle, 4, 1 );
3680 cbradney 732
        LEndStyle = new ScComboBox( false, page_5, "LCap" );
2207 cbradney 733
        endingsLabel = new QLabel( LEndStyle, "&Endings:", page_5, "endingsLabel" );
2148 fschmid 734
        Layout12_2->addWidget( endingsLabel, 5, 0 );
735
        Layout12_2->addWidget( LEndStyle, 5, 1 );
217 Franz 736
        pageLayout_5->addLayout( Layout12_2 );
3 paul 737
 
232 Franz 738
        TabStack3 = new QWidgetStack( page_5, "TabStack3" );
739
        TabStack3->setFrameShape( QWidgetStack::NoFrame );
740
 
741
        page_5a = new QWidget( TabStack3, "page" );
742
        pageLayout_5a = new QVBoxLayout( page_5a, 0, 5, "pageLayout_5a");
743
        StyledLine = new QListBox(page_5a, "StyledL");
2208 cbradney 744
        StyledLine->insertItem( "No Style", 0);
232 Franz 745
        pageLayout_5a->addWidget(StyledLine);
746
        TabStack3->addWidget( page_5a, 0 );
27 Franz 747
 
232 Franz 748
        page_5b = new QWidget( TabStack3, "page" );
749
        pageLayout_5b = new QVBoxLayout( page_5b, 0, 5, "pageLayout_5a");
2208 cbradney 750
        TLines = new QGroupBox( "Cell Lines", page_5b, "Distance" );
232 Franz 751
        TLines->setColumnLayout(0, Qt::Vertical );
752
        TLines->layout()->setSpacing( 2 );
753
        TLines->layout()->setMargin( 5 );
754
        TLineLayout = new QVBoxLayout( TLines->layout() );
755
        TLineLayout->setAlignment( Qt::AlignTop );
756
        TopLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 757
        TopLine->setText( "Line at Top" );
232 Franz 758
        TLineLayout->addWidget(TopLine);
759
        LeftLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 760
        LeftLine->setText( "Line at the Left" );
232 Franz 761
        TLineLayout->addWidget(LeftLine);
762
        RightLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 763
        RightLine->setText( "Line at the Right " );
232 Franz 764
        TLineLayout->addWidget(RightLine);
765
        BottomLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 766
        BottomLine->setText( "Line at Bottom" );
232 Franz 767
        TLineLayout->addWidget(BottomLine);
768
        pageLayout_5b->addWidget(TLines);
769
        TabStack3->addWidget( page_5b, 1 );
770
        pageLayout_5->addWidget( TabStack3 );
2207 cbradney 771
        idLineItem=TabStack->addItem( page_5, "&Line" );
5320 fschmid 772
 
773
        page_6 = new QWidget( TabStack, "page_6" );
774
        pageLayout_6 = new QVBoxLayout( page_6, 0, 5, "pageLayout_6");
775
 
776
        Cpal = new Cpalette(page_6);
777
        pageLayout_6->addWidget( Cpal );
778
 
779
        OverP = new QButtonGroup( "Overprinting", page_6, "Distance" );
780
        OverP->setColumnLayout(0, Qt::Vertical );
781
        OverP->layout()->setSpacing( 2 );
782
        OverP->layout()->setMargin( 5 );
783
        OverPLayout = new QVBoxLayout( OverP->layout() );
784
        OverPLayout->setAlignment( Qt::AlignTop );
785
        KnockOut = new QRadioButton( "Knockout", OverP, "KnockOut" );
786
        OverPLayout->addWidget( KnockOut );
787
        Overprint = new QRadioButton( "Overprint", OverP, "Overprint" );
788
        OverPLayout->addWidget( Overprint );
789
        KnockOut->setChecked( true );
790
        pageLayout_6->addWidget(OverP);
791
 
792
        idColorsItem=TabStack->addItem(page_6, "&Colors" );
217 Franz 793
        MpalLayout->addWidget( TabStack );
332 Franz 794
 
2199 cbradney 795
        languageChange();
216 Franz 796
 
217 Franz 797
        connect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
798
        connect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
799
        connect(Width, SIGNAL(valueChanged(int)), this, SLOT(NewW()));
800
        connect(Height, SIGNAL(valueChanged(int)), this, SLOT(NewH()));
801
        connect(Rot, SIGNAL(valueChanged(int)), this, SLOT(NewR()));
802
        connect(RoundRect, SIGNAL(valueChanged(int)), this, SLOT(NewRR()));
803
        connect(LineSp, SIGNAL(valueChanged(int)), this, SLOT(NewLsp()));
804
        connect(Size, SIGNAL(valueChanged(int)), this, SLOT(NewSize()));
805
        connect(Extra, SIGNAL(valueChanged(int)), this, SLOT(NewExtra()));
4821 cbradney 806
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(HChange()));
807
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(VChange()));
808
        connect(imageXOffsetSpinBox, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY()));
809
        connect(imageYOffsetSpinBox, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY()));
2389 fschmid 810
        connect(imgDpiX, SIGNAL(valueChanged(int)), this, SLOT(HChangeD()));
811
        connect(imgDpiY, SIGNAL(valueChanged(int)), this, SLOT(VChangeD()));
217 Franz 812
        connect(LSize, SIGNAL(valueChanged(int)), this, SLOT(NewLS()));
813
        connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLSty()));
814
        connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLJoin()));
815
        connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLEnd()));
816
        connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLMode()));
2606 cbradney 817
        connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
818
        connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
4699 cbradney 819
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
820
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
217 Franz 821
        connect(GroupAlign, SIGNAL(State(int)), this, SLOT(NewAli(int)));
822
        connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
823
        connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
2247 fschmid 824
        connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(int)), this, SLOT(newShadowOffs()));
825
        connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(int)), this, SLOT(newShadowOffs()));
2257 fschmid 826
        connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newOutlineW()));
2262 fschmid 827
        connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(newUnderline()));
828
        connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newUnderline()));
2272 fschmid 829
        connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(newStrike()));
830
        connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newStrike()));
217 Franz 831
        connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
832
        connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
833
        connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
834
        connect(Zup, SIGNAL(clicked()), this, SLOT(DoRaise()));
835
        connect(ZDown, SIGNAL(clicked()), this, SLOT(DoLower()));
836
        connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront()));
837
        connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack()));
838
        connect(RotationGroup, SIGNAL(clicked(int)), this, SLOT(NewRotMode(int)));
5620 jghali 839
        connect(textFlowOptions, SIGNAL(clicked(int)), this, SLOT(DoFlow(int)));
5564 mrdocs 840
 
217 Franz 841
        connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeIrre(int, int, double *)));
842
        connect(EditShape, SIGNAL(clicked()), this, SLOT(EditSh()));
1194 fschmid 843
        connect(dGap, SIGNAL(valueChanged(int)), this, SLOT(NewGap()));
217 Franz 844
        connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
845
        connect(DTop, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
846
        connect(DLeft, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
847
        connect(DRight, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
848
        connect(DBottom, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
2148 fschmid 849
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
217 Franz 850
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
2508 fschmid 851
        connect(Fonts, SIGNAL(fontSelected(QString )), this, SLOT(NewTFont(QString)));
217 Franz 852
        connect(TxFill, SIGNAL(activated(int)), this, SLOT(newTxtFill()));
853
        connect(TxStroke, SIGNAL(activated(int)), this, SLOT(newTxtStroke()));
854
        connect(PM1, SIGNAL(clicked()), this, SLOT(setActShade()));
855
        connect(PM2, SIGNAL(clicked()), this, SLOT(setActShade()));
856
        connect(ChScale, SIGNAL(valueChanged(int)), this, SLOT(NewTScale()));
2230 fschmid 857
        connect(ChScaleV, SIGNAL(valueChanged(int)), this, SLOT(NewTScaleV()));
2234 fschmid 858
        connect(ChBase, SIGNAL(valueChanged(int)), this, SLOT(NewTBase()));
217 Franz 859
        connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
860
        connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
4695 cbradney 861
        connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
332 Franz 862
        connect(showcurveCheckBox, SIGNAL(clicked()), this, SLOT(handlePathLine()));
217 Franz 863
        connect(Dist, SIGNAL(valueChanged(int)), this, SLOT(handlePathDist()));
864
        connect(LineW, SIGNAL(valueChanged(int)), this, SLOT(handlePathOffs()));
865
        connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChProf(const QString&)));
866
        connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChIntent()));
215 Franz 867
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
332 Franz 868
        connect(langCombo, SIGNAL(activated(int)), this, SLOT(NewLanguage()));
217 Franz 869
        connect( TabsButton, SIGNAL( clicked() ), this, SLOT( ManageTabs() ) );
232 Franz 870
        connect( TopLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
871
        connect( LeftLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
872
        connect( RightLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
873
        connect( BottomLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
332 Franz 874
        connect( colgapLabel, SIGNAL( clicked() ), this, SLOT( HandleGapSwitch() ) );
294 Franz 875
        connect( Cpal, SIGNAL(NewSpecial(double, double, double, double )), this, SLOT(NewSpGradient(double, double, double, double )));
735 fschmid 876
        connect( Cpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEdit()));
740 fschmid 877
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
878
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2309 fschmid 879
        connect(lineSpacingPop, SIGNAL(activated(int)), this, SLOT(setLspMode(int )));
4477 fschmid 880
        connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
881
        connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
5320 fschmid 882
        connect( KnockOut, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
883
        connect( Overprint, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
4546 subik 884
 
215 Franz 885
        HaveItem = false;
886
        Xpos->setValue(0);
887
        Ypos->setValue(0);
888
        Width->setValue(0);
889
        Height->setValue(0);
890
        Rot->setValue(0);
891
        RoundRect->setValue(0);
232 Franz 892
        TabStack3->raiseWidget(0);
215 Franz 893
        TabStack2->raiseWidget(0);
2148 fschmid 894
        for (int ws = 1; ws < 6; ++ws)
895
                TabStack->setItemEnabled(ws, false);
896
        TabStack->setCurrentIndex(0);
897
        TabStack->item(0)->setEnabled(false);
898
        TabStack->setItemEnabled(0, false);
215 Franz 899
        StrokeIcon->setEnabled(false);
900
        TxStroke->setEnabled(false);
901
        PM1->setEnabled(false);
3 paul 902
}
2156 fschmid 903
 
5257 cbradney 904
void Mpalette::setMainWindow(ScribusMainWindow* mw)
905
{
906
        m_MainWindow=mw;
5622 jghali 907
        QPoint p1 = mapToGlobal(pos());
908
        QPoint p2 = m_MainWindow->mapFromGlobal(p1);
909
        reparent(m_MainWindow, this->getWFlags(), p2);
5257 cbradney 910
 
911
        connect(this, SIGNAL(DocChanged()), m_MainWindow, SLOT(slotDocCh()));
912
        connect(this, SIGNAL(NewAbStyle(int)), m_MainWindow, SLOT(setNewAbStyle(int)));
913
        connect(this, SIGNAL(Stellung(int)), m_MainWindow, SLOT(setItemHoch(int)));
914
        connect(this, SIGNAL(EditCL()), m_MainWindow, SLOT(ToggleFrameEdit()));
915
        connect(this, SIGNAL(NewTF(const QString&)), m_MainWindow, SLOT(SetNewFont(const QString&)));
916
        connect(this, SIGNAL(UpdtGui(int)), m_MainWindow, SLOT(HaveNewSel(int)));
917
        connect(this->Cpal, SIGNAL(QueryItem()), m_MainWindow, SLOT(GetBrushPen()));
918
        connect(this->Cpal->gradEdit->Preview, SIGNAL(gradientChanged()), m_MainWindow, SLOT(updtGradFill()));
919
        connect(this->Cpal, SIGNAL(gradientChanged()), m_MainWindow, SLOT(updtGradFill()));
920
 
921
}
922
 
3 paul 923
void Mpalette::SelTab(int t)
924
{
5257 cbradney 925
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 926
                return;
296 Franz 927
        if ((HaveDoc) && (HaveItem) && (t == 5))
295 Franz 928
        {
296 Franz 929
                Cpal->setActGradient(CurItem->GrType);
3540 cbradney 930
                updateColorSpecialGradient();
686 cbradney 931
                Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
932
                Cpal->gradEdit->Preview->updateDisplay();
295 Franz 933
        }
3 paul 934
}
935
 
3691 cbradney 936
void Mpalette::setDoc(ScribusDoc *d)
3 paul 937
{
4713 cbradney 938
        disconnect(this->Cpal, SIGNAL(NewTrans(double)), 0, 0);
939
        disconnect(this->Cpal, SIGNAL(NewTransS(double)), 0, 0);
4714 cbradney 940
        disconnect(this->Cpal, SIGNAL(NewPen(QString)), 0, 0);
941
        disconnect(this->Cpal, SIGNAL(NewBrush(QString)), 0, 0);
942
        disconnect(this->Cpal, SIGNAL(NewPenShade(int)), 0, 0);
943
        disconnect(this->Cpal, SIGNAL(NewBrushShade(int)), 0, 0);
944
        disconnect(this->Cpal, SIGNAL(NewGradient(int)), 0, 0);
4729 subik 945
 
3 paul 946
        doc = d;
2965 cbradney 947
        Umrech=doc->unitRatio();
2607 fschmid 948
        double maxXYWHVal= 30000 * Umrech;
949
        double minXYVal= -30000 * Umrech;
3 paul 950
        HaveDoc = true;
186 Franz 951
        HaveItem = false;
335 Franz 952
 
953
        Xpos->setValues( minXYVal, maxXYWHVal, 100, minXYVal);
954
        Ypos->setValues( minXYVal, maxXYWHVal, 100, minXYVal);
1843 cbradney 955
        Width->setValues( Umrech, maxXYWHVal, 100, Umrech);
956
        Height->setValues( Umrech, maxXYWHVal, 100, Umrech);
4821 cbradney 957
        imageXOffsetSpinBox->setValues( -30000, maxXYWHVal, 100, 0);
958
        imageYOffsetSpinBox->setValues( -30000, maxXYWHVal, 100, 0);
335 Franz 959
 
1617 fschmid 960
        Rot->setValues( 0, 359.99, 100, 0);
335 Franz 961
        RoundRect->setValues( -300, 300, 10, 0);
962
        Extra->setValues( -300, 300, 10, 0);
2247 fschmid 963
        Size->setValues( 0.5, 2048, 10, 1);
2287 cbradney 964
        LineSp->setValues( 1, 2048, 10, 1);
4821 cbradney 965
        imageXScaleSpinBox->setValues( 1, 30000, 10, 1);
966
        imageYScaleSpinBox->setValues( 1, 30000, 10, 1);
2607 fschmid 967
        imgDpiX->setValues( 1, 30000, 10, 1);
968
        imgDpiY->setValues( 1, 30000, 10, 1);
335 Franz 969
 
1194 fschmid 970
        dGap->setDecimals(10);
215 Franz 971
        DTop->setDecimals(10);
972
        DLeft->setDecimals(10);
973
        DBottom->setDecimals(10);
974
        DRight->setDecimals(10);
4811 cbradney 975
        LSize->setMaxValue( 300 );
174 Franz 976
        LSize->setMinValue( 0 );
392 Franz 977
        Dist->setMaxValue( 30000 );
68 Franz 978
        Dist->setMinValue( 0 );
979
        Dist->setLineStep(10);
146 Franz 980
        LineW->setMaxValue( 300 );
981
        LineW->setMinValue( -300 );
68 Franz 982
        LineW->setLineStep(10);
335 Franz 983
 
68 Franz 984
        updateCList();
4546 subik 985
 
4117 cbradney 986
        updateSpinBoxConstants();
4729 subik 987
 
4713 cbradney 988
        connect(this->Cpal, SIGNAL(NewTrans(double)), doc, SLOT(itemSelection_SetItemFillTransparency(double)));
989
        connect(this->Cpal, SIGNAL(NewTransS(double)), doc, SLOT(itemSelection_SetItemLineTransparency(double)));
4714 cbradney 990
        connect(this->Cpal, SIGNAL(NewPen(QString)), doc, SLOT(ItemPen(QString)));
991
        connect(this->Cpal, SIGNAL(NewBrush(QString)), doc, SLOT(ItemBrush(QString)));
992
        connect(this->Cpal, SIGNAL(NewPenShade(int)), doc, SLOT(ItemPenShade(int)));
993
        connect(this->Cpal, SIGNAL(NewBrushShade(int)), doc, SLOT(ItemBrushShade(int)));
994
        connect(this->Cpal, SIGNAL(NewGradient(int)), doc, SLOT(ItemGradFill(int)));
3 paul 995
}
996
 
3691 cbradney 997
void Mpalette::unsetDoc()
3 paul 998
{
999
        HaveDoc = false;
4714 cbradney 1000
        HaveItem = false;
1001
        doc=NULL;
3 paul 1002
}
1003
 
4738 cbradney 1004
void Mpalette::unsetItem()
1005
{
1006
        HaveItem=false;
1007
        CurItem = NULL;
1008
        NewSel(-1);
1009
}
1010
 
3985 cbradney 1011
void Mpalette::setCurrentItem(PageItem *i)
1012
{
5257 cbradney 1013
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
3985 cbradney 1014
                return;
1015
        //CB We shouldnt really need to process this if our item is the same one
1016
        //maybe we do if the item has been changed by scripter.. but that should probably
1017
        //set some status if so.
1018
        //FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
1019
        //if (CurItem == i)
1020
        //      return;
1021
        disconnect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1022
        disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1023
        disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1024
        disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
1025
        HaveItem = false;
1026
        CurItem = i;
4546 subik 1027
 
3985 cbradney 1028
        NewSel(i->itemType());
1029
        NameEdit->setText(i->itemName());
1030
        setXY(i->xPos(), i->yPos());
1031
        setBH(i->width(), i->height());
1032
        setR(i->rotation());
4546 subik 1033
 
3988 cbradney 1034
        Revert->setOn(i->reversed());
1035
        setDvals(i->textToFrameDistLeft(), i->textToFrameDistTop(), i->textToFrameDistBottom(), i->textToFrameDistRight());
3985 cbradney 1036
        LevelTxt->setText(QString::number(i->ItemNr));
5620 jghali 1037
        setTextFlowMode(i->textFlowMode());
3989 cbradney 1038
        RoundRect->setValue(i->cornerRadius()*Umrech);
4699 cbradney 1039
        /*
1040
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1041
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
3985 cbradney 1042
        FlipH->setOn(i->imageFlippedH());
1043
        FlipV->setOn(i->imageFlippedV());
4699 cbradney 1044
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1045
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1046
        */
5559 avox 1047
        langCombo->setCurrentText(m_MainWindow->LangTransl[i->document()->Language]);
3985 cbradney 1048
        if (TabStack->currentIndex() == 5)
1049
                Cpal->setActGradient(CurItem->GrType);
1050
        updateColorSpecialGradient();
1051
        Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1052
        Cpal->gradEdit->Preview->updateDisplay();
1053
        if (i->FrameType == 0)
1054
                SCustom->setPixmap(SCustom->getIconPixmap(0));
1055
        if (i->FrameType == 1)
1056
                SCustom->setPixmap(SCustom->getIconPixmap(1));
1057
        if (i->FrameType > 3)
1058
                SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
1059
        if ((i->asLine()) || (i->asPolyLine()))
1060
        {
1061
                startArrow->setEnabled(true);
1062
                endArrow->setEnabled(true);
4061 craig 1063
                startArrow->setCurrentItem(i->startArrowIndex());
1064
                endArrow->setCurrentItem(i->endArrowIndex());
3985 cbradney 1065
        }
1066
        else
1067
        {
1068
                startArrow->setEnabled(false);
1069
                endArrow->setEnabled(false);
1070
        }
4098 cbradney 1071
        PageItem_TextFrame* i2=i->asTextFrame();
1072
        if (i2!=0)
3985 cbradney 1073
        {
4098 cbradney 1074
                DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
1075
                DCol->setMinValue(1);
1076
                DCol->setValue(i2->Cols);
1077
                dGap->setMinValue(0);
1078
                if (colgapLabel->getState())
1079
                {
1080
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
1081
                        dGap->setValue(i2->ColGap*Umrech);
1082
                }
3985 cbradney 1083
                else
4098 cbradney 1084
                {
1085
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols)*Umrech, 0));
1086
                        dGap->setValue(i2->columnWidth()*Umrech);
1087
                }
3985 cbradney 1088
        }
1089
        bool setter;
1090
        if (i->NamedLStyle.isEmpty())
1091
        {
1092
                StyledLine->setCurrentItem(0);
1093
                setter = true;
1094
        }
1095
        else
1096
        {
1097
                StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
1098
                setter = false;
1099
        }
1100
        LStyle->setEnabled(setter);
1101
        LSize->setEnabled(setter);
1102
        LJoinStyle->setEnabled(setter);
1103
        LEndStyle->setEnabled(setter);
1104
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1105
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1106
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1107
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
4698 cbradney 1108
        setPrintingEnabled(i->printEnabled());
5226 cbradney 1109
        //CB not needed, done from pageitem->emitalltogui or individual emit.
1110
        //setLocked(i->locked());
1111
        //setSizeLocked(i->sizeLocked());
3985 cbradney 1112
        if ((i->isTableItem) && (i->isSingleSel))
1113
        {
1114
                setter = true;
1115
                TabStack3->raiseWidget(1);
1116
                TopLine->setChecked(i->TopLine);
1117
                LeftLine->setChecked(i->LeftLine);
1118
                RightLine->setChecked(i->RightLine);
1119
                BottomLine->setChecked(i->BottomLine);
1120
        }
1121
        else
1122
                TabStack3->raiseWidget(0);
1123
        LayerGroup->setEnabled(!setter);
4782 cbradney 1124
        /*
3985 cbradney 1125
        Xpos->setReadOnly(setter);
1126
        Ypos->setReadOnly(setter);
1127
        Rot->setReadOnly(setter);
4782 cbradney 1128
        */
3985 cbradney 1129
        if (i->asPathText())
1130
        {
1131
                TabStack2->raiseWidget(1);
1132
                showcurveCheckBox->setChecked(i->PoShow);
1133
                LineW->setValue(i->BaseOffs * -1);
3988 cbradney 1134
                Dist->setValue(i->textToFrameDistLeft());
3985 cbradney 1135
        }
4477 fschmid 1136
        else if (i->asPolygon())
1137
        {
1138
                TabStack2->raiseWidget(2);
5320 fschmid 1139
                NonZero->setChecked(!i->fillRule);
4477 fschmid 1140
                EvenOdd->setChecked(i->fillRule);
1141
        }
3985 cbradney 1142
        else
1143
                TabStack2->raiseWidget(0);
1144
        // Frame type 3 is obsolete: CR 2005-02-06
1145
        //if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
1146
        if (((i->asTextFrame()) || (i->asImageFrame())) &&  (!i->ClipEdited))
1147
                RoundRect->setEnabled(true);
1148
        else
1149
        {
1150
                if ((i->asPolygon()) && ((i->FrameType == 0) || (i->FrameType == 2)))
1151
                        RoundRect->setEnabled(true);
1152
                else
1153
                        RoundRect->setEnabled(false);
1154
        }
5320 fschmid 1155
        KnockOut->setChecked(!i->doOverprint);
1156
        Overprint->setChecked(i->doOverprint);
3985 cbradney 1157
 
1158
        if ((i->itemType() == PageItem::Line) && LMode) {
1159
                xposLabel->setText( tr( "&X1:" ) );
1160
                widthLabel->setText( tr( "X&2:" ) );
1161
                yposLabel->setText( tr( "Y&1:" ) );
1162
                heightLabel->setText( tr( "&Y2:" ) );
1163
                Rot->setEnabled(false);
1164
        } else {
1165
                xposLabel->setText( tr( "&X-Pos:" ) );
1166
                widthLabel->setText( tr( "&Width:" ) );
1167
                yposLabel->setText( tr( "&Y-Pos:" ) );
1168
                heightLabel->setText( tr( "&Height:" ) );
1169
                Rot->setEnabled(true);
1170
        }
1171
        HaveItem = true;
1172
        if (i->asLine())
1173
        {
1174
                keepFrameWHRatioButton->setEnabled(false);
1175
                if (LMode && !i->locked())
1176
                        Height->setEnabled(true);
1177
                else
1178
                        Height->setEnabled(false);
1179
        }
1180
        else
1181
        {
1182
                Height->setEnabled(true);
1183
                keepFrameWHRatioButton->setEnabled(true);
1184
                if (i->asImageFrame())
1185
                {
1186
                        updateCmsList();
1187
                        setter = i->ScaleType;
1188
                        FreeScale->setChecked(setter);
1189
                        FrameScale->setChecked(!setter);
1190
                        if (setter == true)
1191
                        {
1192
                                keepImageWHRatioButton->setOn(setter);
1193
                                keepImageDPIRatioButton->setOn(setter);
1194
                        }
1195
                        Aspect->setEnabled(!setter);
1196
                        Aspect->setChecked(i->AspectRatio);
4821 cbradney 1197
                        imageXOffsetSpinBox->setEnabled(setter);
1198
                        imageYOffsetSpinBox->setEnabled(setter);
1199
                        imageXScaleSpinBox->setEnabled(setter);
1200
                        imageYScaleSpinBox->setEnabled(setter);
3985 cbradney 1201
                        imgDpiX->setEnabled(setter);
1202
                        imgDpiY->setEnabled(setter);
1203
                }
1204
        }
1205
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1206
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1207
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
4546 subik 1208
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
3985 cbradney 1209
}
1210
 
1211
 
5620 jghali 1212
void Mpalette::setTextFlowMode(PageItem::TextFlowMode mode)
1213
{
1214
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
1215
                return;
1216
        if (mode == PageItem::TextFlowDisabled)
5705 jghali 1217
                textFlowDisabled->setOn(true);
5620 jghali 1218
        else if (mode == PageItem::TextFlowUsesFrameShape)
5705 jghali 1219
                textFlowUsesFrameShape->setOn(true);
5620 jghali 1220
        else if (mode == PageItem::TextFlowUsesBoundingBox)
5705 jghali 1221
                textFlowUsesBoundingBox->setOn(true);
5620 jghali 1222
        else if (mode == PageItem::TextFlowUsesContourLine)
5705 jghali 1223
                textFlowUsesContourLine->setOn(true);
5620 jghali 1224
}
1225
 
3 paul 1226
void Mpalette::SetCurItem(PageItem *i)
1227
{
5257 cbradney 1228
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 1229
                return;
3894 cbradney 1230
        //CB We shouldnt really need to process this if our item is the same one
1231
        //maybe we do if the item has been changed by scripter.. but that should probably
1232
        //set some status if so.
1233
        //FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
1234
        //if (CurItem == i)
1235
        //      return;
217 Franz 1236
        disconnect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
68 Franz 1237
        disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
740 fschmid 1238
        disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1239
        disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
3985 cbradney 1240
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
4546 subik 1241
 
3 paul 1242
        HaveItem = false;
1243
        CurItem = i;
2148 fschmid 1244
        if (TabStack->currentIndex() == 5)
296 Franz 1245
                Cpal->setActGradient(CurItem->GrType);
3540 cbradney 1246
        updateColorSpecialGradient();
686 cbradney 1247
        Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1248
        Cpal->gradEdit->Preview->updateDisplay();
188 Franz 1249
        if (i->FrameType == 0)
1250
                SCustom->setPixmap(SCustom->getIconPixmap(0));
1251
        if (i->FrameType == 1)
1252
                SCustom->setPixmap(SCustom->getIconPixmap(1));
1253
        if (i->FrameType > 3)
1254
                SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
3625 avox 1255
        if ((i->asLine()) || (i->asPolyLine()))
740 fschmid 1256
        {
1257
                startArrow->setEnabled(true);
1258
                endArrow->setEnabled(true);
4061 craig 1259
                startArrow->setCurrentItem(i->startArrowIndex());
1260
                endArrow->setCurrentItem(i->endArrowIndex());
740 fschmid 1261
        }
1262
        else
1263
        {
1264
                startArrow->setEnabled(false);
1265
                endArrow->setEnabled(false);
1266
        }
1361 tsoots 1267
        NameEdit->setText(i->itemName());
3989 cbradney 1268
        RoundRect->setValue(i->cornerRadius()*Umrech);
272 Franz 1269
        QString tm;
1270
        LevelTxt->setText(tm.setNum(i->ItemNr));
4098 cbradney 1271
        PageItem_TextFrame *i2=i->asTextFrame();
1272
        if (i2!=0)
265 Franz 1273
        {
4098 cbradney 1274
                DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
1275
                DCol->setMinValue(1);
1276
                DCol->setValue(i2->Cols);
1277
                dGap->setMinValue(0);
1278
                if (colgapLabel->getState())
1279
                {
1280
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
1281
                        dGap->setValue(i2->ColGap*Umrech);
1282
                }
265 Franz 1283
                else
4098 cbradney 1284
                {
1285
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols)*Umrech, 0));
1286
                        dGap->setValue(i2->columnWidth()*Umrech);
1287
                }
1288
                DLeft->setValue(i2->textToFrameDistLeft()*Umrech);
1289
                DTop->setValue(i2->textToFrameDistTop()*Umrech);
1290
                DBottom->setValue(i2->textToFrameDistBottom()*Umrech);
1291
                DRight->setValue(i2->textToFrameDistRight()*Umrech);
265 Franz 1292
        }
3988 cbradney 1293
        Revert->setOn(i->reversed());
5620 jghali 1294
        setTextFlowMode(i->textFlowMode());
4699 cbradney 1295
        /*
1296
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1297
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1392 cbradney 1298
        FlipH->setOn(i->imageFlippedH());
1299
        FlipV->setOn(i->imageFlippedV());
4699 cbradney 1300
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1301
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1302
        */
5559 avox 1303
        langCombo->setCurrentText(m_MainWindow->LangTransl[i->document()->Language]);
80 Franz 1304
        bool setter;
2877 cbradney 1305
        if (i->NamedLStyle.isEmpty())
215 Franz 1306
        {
1307
                StyledLine->setCurrentItem(0);
1308
                setter = true;
1309
        }
27 Franz 1310
        else
215 Franz 1311
        {
1312
                StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
1313
                setter = false;
1314
        }
80 Franz 1315
        LStyle->setEnabled(setter);
1316
        LSize->setEnabled(setter);
1317
        LJoinStyle->setEnabled(setter);
1318
        LEndStyle->setEnabled(setter);
216 Franz 1319
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
68 Franz 1320
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
740 fschmid 1321
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1322
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
4729 subik 1323
        //CB not needed, done from pageitem->emitalltogui or individual emit.
4698 cbradney 1324
        //NoPrint->setOn(!i->printEnabled());
1325
        //setLocked(i->locked());
1326
        //setSizeLocked(i->sizeLocked());
232 Franz 1327
        if ((i->isTableItem) && (i->isSingleSel))
1328
        {
335 Franz 1329
                setter = true;
232 Franz 1330
                TabStack3->raiseWidget(1);
1331
                TopLine->setChecked(i->TopLine);
1332
                LeftLine->setChecked(i->LeftLine);
1333
                RightLine->setChecked(i->RightLine);
1334
                BottomLine->setChecked(i->BottomLine);
1335
        }
1336
        else
1337
                TabStack3->raiseWidget(0);
339 Franz 1338
        LayerGroup->setEnabled(!setter);
4782 cbradney 1339
        /*
335 Franz 1340
        Xpos->setReadOnly(setter);
1341
        Ypos->setReadOnly(setter);
1342
        Rot->setReadOnly(setter);
4782 cbradney 1343
        */
3625 avox 1344
        if (i->asPathText())
215 Franz 1345
        {
68 Franz 1346
                TabStack2->raiseWidget(1);
332 Franz 1347
                showcurveCheckBox->setChecked(i->PoShow);
217 Franz 1348
                LineW->setValue(i->BaseOffs * -1);
3988 cbradney 1349
                Dist->setValue(i->textToFrameDistLeft());
215 Franz 1350
        }
4477 fschmid 1351
        else if (i->asPolygon())
1352
        {
1353
                TabStack2->raiseWidget(2);
5320 fschmid 1354
                NonZero->setChecked(!i->fillRule);
4477 fschmid 1355
                EvenOdd->setChecked(i->fillRule);
1356
        }
68 Franz 1357
        else
1358
                TabStack2->raiseWidget(0);
1460 cbradney 1359
        // Frame type 3 is obsolete: CR 2005-02-06
1360
        //if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
4941 fschmid 1361
        if (((i->asTextFrame()) || (i->asImageFrame())) &&  (!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
3 paul 1362
                RoundRect->setEnabled(true);
1363
        else
217 Franz 1364
        {
4941 fschmid 1365
                if ((i->asPolygon()) &&  (!i->ClipEdited)  && ((i->FrameType == 0) || (i->FrameType == 2)))
217 Franz 1366
                        RoundRect->setEnabled(true);
1367
                else
1368
                        RoundRect->setEnabled(false);
1369
        }
5320 fschmid 1370
        KnockOut->setChecked(!i->doOverprint);
1371
        Overprint->setChecked(i->doOverprint);
1460 cbradney 1372
        if ((i->itemType() == PageItem::Line) && LMode) {
348 Franz 1373
                xposLabel->setText( tr( "&X1:" ) );
1374
                widthLabel->setText( tr( "X&2:" ) );
1375
                yposLabel->setText( tr( "Y&1:" ) );
1376
                heightLabel->setText( tr( "&Y2:" ) );
332 Franz 1377
                Rot->setEnabled(false);
1378
        } else {
348 Franz 1379
                xposLabel->setText( tr( "&X-Pos:" ) );
1380
                widthLabel->setText( tr( "&Width:" ) );
1381
                yposLabel->setText( tr( "&Y-Pos:" ) );
1382
                heightLabel->setText( tr( "&Height:" ) );
332 Franz 1383
                Rot->setEnabled(true);
1384
        }
3044 fschmid 1385
        HaveItem = true;
3625 avox 1386
        if (i->asLine())
215 Franz 1387
        {
2606 cbradney 1388
                keepFrameWHRatioButton->setEnabled(false);
2546 cbradney 1389
                if (LMode && !i->locked())
3 paul 1390
                        Height->setEnabled(true);
1391
                else
1392
                        Height->setEnabled(false);
215 Franz 1393
        }
3 paul 1394
        else
215 Franz 1395
        {
2679 cbradney 1396
                Height->setEnabled(true);
2606 cbradney 1397
                keepFrameWHRatioButton->setEnabled(true);
3625 avox 1398
                if (i->asImageFrame())
3 paul 1399
                {
68 Franz 1400
                        updateCmsList();
162 Franz 1401
                        setter = i->ScaleType;
80 Franz 1402
                        FreeScale->setChecked(setter);
1403
                        FrameScale->setChecked(!setter);
5727 cbradney 1404
//CB Why do we need this? Setting it too much here
1405
//                      if (setter == true)
1406
//                      {
1407
//                              keepImageWHRatioButton->setOn(setter);
1408
//                              keepImageDPIRatioButton->setOn(setter);
1409
//                      }
162 Franz 1410
                        Aspect->setEnabled(!setter);
1411
                        Aspect->setChecked(i->AspectRatio);
4821 cbradney 1412
                        imageXOffsetSpinBox->setEnabled(setter);
1413
                        imageYOffsetSpinBox->setEnabled(setter);
1414
                        imageXScaleSpinBox->setEnabled(setter);
1415
                        imageYScaleSpinBox->setEnabled(setter);
2389 fschmid 1416
                        imgDpiX->setEnabled(setter);
1417
                        imgDpiY->setEnabled(setter);
3 paul 1418
                }
215 Franz 1419
        }
3903 cbradney 1420
        setXY(i->xPos(), i->yPos());
4546 subik 1421
 
4110 cbradney 1422
        updateSpinBoxConstants();
3 paul 1423
}
1424
 
1425
void Mpalette::NewSel(int nr)
1426
{
5257 cbradney 1427
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 1428
                return;
86 Franz 1429
        int visID;
5226 cbradney 1430
        PageItem *i=0;
2156 fschmid 1431
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
4847 cbradney 1432
        if (doc->m_Selection->count()>1)
215 Franz 1433
        {
131 Franz 1434
                RoVal = 0;
129 Franz 1435
                double gx, gy, gh, gw;
5257 cbradney 1436
                m_MainWindow->view->getGroupRect(&gx, &gy, &gw, &gh);
217 Franz 1437
                if (TopLeft->isChecked())
5257 cbradney 1438
                        m_MainWindow->view->RCenter = FPoint(gx, gy);
217 Franz 1439
                if (TopRight->isChecked())
5257 cbradney 1440
                        m_MainWindow->view->RCenter = FPoint(gx + gw, gy);
217 Franz 1441
                if (Center->isChecked())
5257 cbradney 1442
                        m_MainWindow->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
217 Franz 1443
                if (BottomLeft->isChecked())
5257 cbradney 1444
                        m_MainWindow->view->RCenter = FPoint(gx, gy + gh);
217 Franz 1445
                if (BottomRight->isChecked())
5257 cbradney 1446
                        m_MainWindow->view->RCenter = FPoint(gx + gw, gy + gh);
348 Franz 1447
                xposLabel->setText( tr( "&X-Pos:" ) );
1448
                widthLabel->setText( tr( "&Width:" ) );
1449
                yposLabel->setText( tr( "&Y-Pos:" ) );
1450
                heightLabel->setText( tr( "&Height:" ) );
3 paul 1451
                HaveItem = false;
1452
                Xpos->setValue(0);
1453
                Ypos->setValue(0);
1454
                Width->setValue(0);
1455
                Height->setValue(0);
1456
                Rot->setValue(0);
1457
                RoundRect->setValue(0);
1458
                HaveItem = true;
1459
                Xpos->setEnabled(true);
1460
                Ypos->setEnabled(true);
1461
                Width->setEnabled(true);
1462
                Height->setEnabled(true);
1463
                Rot->setEnabled(true);
2148 fschmid 1464
                TabStack->setCurrentIndex(0);
1465
                TabStack->item(0)->setEnabled(true);
1466
                TabStack->setItemEnabled(0, true);
68 Franz 1467
                NameEdit->setEnabled(false);
2387 cbradney 1468
                TabStack->setItemEnabled(5, true);
5226 cbradney 1469
                FlipH->setToggleButton( true );
1470
                FlipV->setToggleButton( true );
1471
                FlipH->setOn(false);
1472
                FlipV->setOn(false);
215 Franz 1473
        }
3 paul 1474
        else
215 Franz 1475
        {
5226 cbradney 1476
                if (nr!=-1)
1477
                {
1478
                        i=doc->m_Selection->itemAt(0);
1479
                        HaveItem=true;
1480
                        EditShape->setEnabled(!i->locked());
1481
                        ShapeGroup->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
1482
                }
1483
                else
1484
                {
1485
                        EditShape->setEnabled(false);
1486
                        ShapeGroup->setEnabled(false);
1487
                }
68 Franz 1488
                NameEdit->setEnabled(true);
5226 cbradney 1489
//              ShapeGroup->setEnabled(false);
1490
//              RoundRect->setEnabled(false);
3 paul 1491
                Distance->setEnabled(false);
1492
                LineMode->setEnabled(false);
1493
                TopLeft->setEnabled(true);
1494
                TopRight->setEnabled(true);
1495
                BottomLeft->setEnabled(true);
1496
                BottomRight->setEnabled(true);
1497
                Center->setEnabled(true);
2148 fschmid 1498
                visID = TabStack->currentIndex ();
1499
                TabStack->item(0)->setEnabled(true);
1500
                TabStack->setItemEnabled(0, true);
1501
                TabStack->setItemEnabled(5, true);
4699 cbradney 1502
                /*
1503
                disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1504
                disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
917 fschmid 1505
                FlipH->setOn(false);
1506
                FlipV->setOn(false);
4699 cbradney 1507
                connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1508
                connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1509
                */
5226 cbradney 1510
 
1511
                //CB If Toggle is not possible, then we need to enable it so we can turn it off
1512
                //It then gets reset below for items where its valid
1513
                if ((nr>4) && (nr<9))
1514
                {
1515
                        FlipH->setToggleButton(true);
1516
                        FlipV->setToggleButton(true);
1517
                        FlipH->setOn(false);
1518
                        FlipV->setOn(false);
1519
                }
1520
                FlipH->setToggleButton((nr>=0) && (nr<5));
1521
                FlipV->setToggleButton((nr>=0) && (nr<5));
1522
                //CB Why cant we do this for lines?
5240 fschmid 1523
//              FlipH->setEnabled((nr!=-1) && (nr!=5));
1524
//              FlipV->setEnabled((nr!=-1) && (nr!=5));
1525
                FlipH->setEnabled(nr!=-1);
1526
                FlipV->setEnabled(nr!=-1);
3 paul 1527
                switch (nr)
215 Franz 1528
                {
217 Franz 1529
                case -1:
348 Franz 1530
                        xposLabel->setText( tr( "&X-Pos:" ) );
1531
                        widthLabel->setText( tr( "&Width:" ) );
1532
                        yposLabel->setText( tr( "&Y-Pos:" ) );
1533
                        heightLabel->setText( tr( "&Height:" ) );
4782 cbradney 1534
                        //Rot->setEnabled(true);
1535
                        //Height->setEnabled(true);
5226 cbradney 1536
                        RoundRect->setEnabled(false);
217 Franz 1537
                        HaveItem = false;
1538
                        Xpos->setValue(0);
1539
                        Ypos->setValue(0);
1540
                        Width->setValue(0);
1541
                        Height->setValue(0);
1542
                        Rot->setValue(0);
1543
                        RoundRect->setValue(0);
2148 fschmid 1544
                        for (int ws = 1; ws < 6; ++ws)
1545
                                TabStack->setItemEnabled(ws, false);
1546
                        TabStack->setCurrentIndex(0);
1547
                        TabStack->item(0)->setEnabled(false);
1548
                        TabStack->setItemEnabled(0, false);
294 Franz 1549
                        Cpal->ChooseGrad(0);
217 Franz 1550
                        break;
1551
                case 2:
2148 fschmid 1552
                        TabStack->setItemEnabled(1, true);
2183 fschmid 1553
                        TabStack->setItemEnabled(2, false);
2148 fschmid 1554
                        TabStack->setItemEnabled(3, true);
1555
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1556
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1557
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1558
                        else
1559
                                RoundRect->setEnabled(false);
4847 cbradney 1560
                        if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
5226 cbradney 1561
                                RoundRect->setEnabled(!i->locked());
217 Franz 1562
                        if (visID == 2)
2148 fschmid 1563
                                TabStack->setCurrentIndex(0);
217 Franz 1564
                        break;
1565
                case 4:
2148 fschmid 1566
                        TabStack->setItemEnabled(1, true);
1567
                        TabStack->setItemEnabled(2, true);
2183 fschmid 1568
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1569
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1570
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1571
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1572
                        else
1573
                                RoundRect->setEnabled(false);
217 Franz 1574
                        Distance->setEnabled(true);
1575
                        if (visID == 3)
2148 fschmid 1576
                                TabStack->setCurrentIndex(0);
217 Franz 1577
                        break;
1578
                case 5:
2183 fschmid 1579
                        TabStack->setItemEnabled(1, false);
1580
                        TabStack->setItemEnabled(2, false);
1581
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1582
                        TabStack->setItemEnabled(4, true);
5226 cbradney 1583
                        RoundRect->setEnabled(false);
217 Franz 1584
                        LineMode->setEnabled(true);
1585
                        TopLeft->setEnabled(false);
1586
                        TopRight->setEnabled(false);
1587
                        BottomLeft->setEnabled(false);
1588
                        BottomRight->setEnabled(false);
1589
                        Center->setEnabled(false);
1590
                        if ((visID == 1) || (visID == 2) || (visID == 3))
2148 fschmid 1591
                                TabStack->setCurrentIndex(0);
217 Franz 1592
                        break;
302 Franz 1593
                case 1:
1594
                case 3:
217 Franz 1595
                case 6:
2148 fschmid 1596
                        TabStack->setItemEnabled(1, true);
2183 fschmid 1597
                        TabStack->setItemEnabled(2, false);
1598
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1599
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1600
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1601
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1602
                        else
1603
                                RoundRect->setEnabled(false);
217 Franz 1604
                        if ((visID == 2) || (visID == 3))
2148 fschmid 1605
                                TabStack->setCurrentIndex(0);
217 Franz 1606
                        break;
1607
                case 7:
2148 fschmid 1608
                        TabStack->setItemEnabled(1, true);
2183 fschmid 1609
                        TabStack->setItemEnabled(2, false);
1610
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1611
                        TabStack->setItemEnabled(4, true);
5226 cbradney 1612
                        RoundRect->setEnabled(false);
217 Franz 1613
                        if ((visID == 2) || (visID == 3))
2148 fschmid 1614
                                TabStack->setCurrentIndex(0);
217 Franz 1615
                        break;
1616
                case 8:
2148 fschmid 1617
                        TabStack->setItemEnabled(1, true);
1618
                        TabStack->setItemEnabled(2, true);
2183 fschmid 1619
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1620
                        TabStack->setItemEnabled(4, true);
5226 cbradney 1621
                        RoundRect->setEnabled(false);
217 Franz 1622
                        if (visID == 3)
2148 fschmid 1623
                                TabStack->setCurrentIndex(0);
217 Franz 1624
                        break;
3 paul 1625
                }
215 Franz 1626
        }
3 paul 1627
        updateGeometry();
1628
        setFocus();
1629
        repaint();
2156 fschmid 1630
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
3 paul 1631
}
1632
 
4131 cbradney 1633
void Mpalette::setMultipleSelection(bool isMultiple)
4049 cbradney 1634
{
4729 subik 1635
        //CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
4588 cbradney 1636
        //these can be enabled all the time
1637
        //FlipH->setEnabled(!isMultiple);
1638
        //FlipV->setEnabled(!isMultiple);
4702 cbradney 1639
        NameEdit->setEnabled(!isMultiple);
4049 cbradney 1640
}
1641
 
4619 cbradney 1642
void Mpalette::unitChange()
3 paul 1643
{
1612 cbradney 1644
        double oldRatio = Umrech;
2965 cbradney 1645
        Umrech = doc->unitRatio();
3 paul 1646
        bool tmp = HaveItem;
1647
        HaveItem = false;
2607 fschmid 1648
        double maxXYWHVal=30000 * Umrech;
1649
        double minXYVal=-30000 * Umrech;
335 Franz 1650
 
1843 cbradney 1651
        double ratioDivisor = Umrech / oldRatio;
1612 cbradney 1652
        double newX = Xpos->value() * ratioDivisor;
1653
        double newY = Ypos->value() * ratioDivisor;
1654
        double newW = Width->value() * ratioDivisor;
1655
        double newH = Height->value() * ratioDivisor;
4821 cbradney 1656
        double newLX = imageXOffsetSpinBox->value() * ratioDivisor;
1657
        double newLY = imageYOffsetSpinBox->value() * ratioDivisor;
1612 cbradney 1658
        double newG = dGap->value() * ratioDivisor;
1659
        double newGM = dGap->maxValue() * ratioDivisor;
1660
        double newDT = DTop->value() * ratioDivisor;
1661
        double newDL = DLeft->value() * ratioDivisor;
1662
        double newDB = DBottom->value() * ratioDivisor;
1663
        double newDR = DRight->value() * ratioDivisor;
1664
        double newRR = RoundRect->value() * ratioDivisor;
1665
        double newRM = RoundRect->maxValue() * ratioDivisor;
5250 fschmid 1666
        double newLZ = LSize->value() * ratioDivisor;
335 Franz 1667
 
2965 cbradney 1668
        if (doc->unitIndex() > unitGetMaxIndex())
1669
                doc->setUnitIndex(0);
1670
        QString ein = unitGetSuffixFromIndex(doc->unitIndex());
335 Franz 1671
 
3 paul 1672
        Xpos->setSuffix( ein );
1673
        Ypos->setSuffix( ein );
1674
        Width->setSuffix( ein );
1675
        Height->setSuffix( ein );
4821 cbradney 1676
        imageXOffsetSpinBox->setSuffix( ein );
1677
        imageYOffsetSpinBox->setSuffix( ein );
1194 fschmid 1678
        dGap->setSuffix( ein );
139 Franz 1679
        DLeft->setSuffix( ein );
1680
        DTop->setSuffix( ein );
1681
        DBottom->setSuffix( ein );
1682
        DRight->setSuffix( ein );
1683
        RoundRect->setSuffix( ein );
5250 fschmid 1684
        LSize->setSuffix( ein );
1685
        LSize->setValue(newLZ);
335 Franz 1686
 
2965 cbradney 1687
        int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
335 Franz 1688
 
1612 cbradney 1689
        Xpos->setValues( minXYVal, maxXYWHVal, decimals, newX );
1690
        Ypos->setValues( minXYVal, maxXYWHVal, decimals, newY );
1843 cbradney 1691
        Width->setValues( Umrech, maxXYWHVal, decimals, newW );
1692
        Height->setValues( Umrech, maxXYWHVal, decimals, newH );
335 Franz 1693
 
4821 cbradney 1694
        imageXOffsetSpinBox->setDecimals(decimals);
1695
        imageXOffsetSpinBox->setMaxValue( maxXYWHVal );
1696
        imageXOffsetSpinBox->setValue(newLX);
335 Franz 1697
 
4821 cbradney 1698
        imageYOffsetSpinBox->setDecimals(decimals);
1699
        imageYOffsetSpinBox->setMaxValue( maxXYWHVal );
1700
        imageYOffsetSpinBox->setValue(newLY);
335 Franz 1701
 
1612 cbradney 1702
        dGap->setDecimals(decimals);
1194 fschmid 1703
        dGap->setMaxValue(newGM);
1704
        dGap->setValue(newG);
335 Franz 1705
 
1612 cbradney 1706
        DLeft->setDecimals(decimals);
335 Franz 1707
        DLeft->setMaxValue( 300 );
1708
        DLeft->setValue(newDL);
1709
 
1612 cbradney 1710
        DTop->setDecimals(decimals);
217 Franz 1711
        DTop->setMaxValue( 300 );
335 Franz 1712
        DTop->setValue(newDT);
1713
 
1612 cbradney 1714
        DBottom->setDecimals(decimals);
335 Franz 1715
        DBottom->setMaxValue( 300 );
1716
        DBottom->setValue(newDB);
1717
 
1612 cbradney 1718
        DRight->setDecimals(decimals);
217 Franz 1719
        DRight->setMaxValue( 300 );
335 Franz 1720
        DRight->setValue(newDR);
1721
 
3992 cbradney 1722
        RoundRect->setValues(-newRM, newRM, decimals, newRR);
4619 cbradney 1723
        Cpal->unitChange(oldRatio, Umrech, doc->unitIndex());
3 paul 1724
        HaveItem = tmp;
1725
}
1726
 
272 Franz 1727
void Mpalette::setLevel(uint l)
1728
{
1729
        QString tm;
1730
        LevelTxt->setText(tm.setNum(l));
1731
}
1732
 
80 Franz 1733
void Mpalette::setXY(double x, double y)
3 paul 1734
{
5257 cbradney 1735
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 1736
                return;
237 Franz 1737
        disconnect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
1738
        disconnect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
3 paul 1739
        bool tmp = HaveItem;
133 Franz 1740
        double inX, inY, b, h, r, dummy1, dummy2;
132 Franz 1741
        QWMatrix ma;
1742
        FPoint n;
1743
        if (HaveItem)
215 Franz 1744
        {
4847 cbradney 1745
                if (doc->m_Selection->isMultipleSelection())
132 Franz 1746
                {
5257 cbradney 1747
                        m_MainWindow->view->getGroupRect(&dummy1, &dummy2, &b, &h);
133 Franz 1748
                        r = 0.0;
215 Franz 1749
                }
133 Franz 1750
                else
215 Franz 1751
                {
3934 cbradney 1752
                        b = CurItem->width();
1753
                        h = CurItem->height();
1754
                        r = CurItem->rotation();
132 Franz 1755
                }
215 Franz 1756
        }
132 Franz 1757
        else
215 Franz 1758
        {
132 Franz 1759
                b = 0.0;
1760
                h = 0.0;
1761
                r = 0.0;
215 Franz 1762
        }
3 paul 1763
        HaveItem = false;
132 Franz 1764
        ma.translate(x, y);
1765
        ma.rotate(r);
215 Franz 1766
        if (TopLeft->isChecked())
132 Franz 1767
                n = FPoint(0.0, 0.0);
1768
        if (TopRight->isChecked())
1769
                n = FPoint(b, 0.0);
215 Franz 1770
        if (Center->isChecked())
132 Franz 1771
                n = FPoint(b / 2.0, h / 2.0);
1772
        if (BottomLeft->isChecked())
1773
                n = FPoint(0.0, h);
1774
        if (BottomRight->isChecked())
1775
                n = FPoint(b, h);
1776
        inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
1777
        inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
456 fschmid 1778
        if (tmp)
1779
        {
2867 fschmid 1780
                inX -= doc->rulerXoffset;
1781
                inY -= doc->rulerYoffset;
1782
                if (doc->guidesSettings.rulerMode)
1783
                {
5087 subik 1784
                        inX -= doc->currentPage()->xOffset();
1785
                        inY -= doc->currentPage()->yOffset();
2867 fschmid 1786
                }
456 fschmid 1787
        }
1843 cbradney 1788
        Xpos->setValue(inX*Umrech);
1789
        Ypos->setValue(inY*Umrech);
132 Franz 1790
        if ((LMode) && (tmp))
3934 cbradney 1791
                setBH(CurItem->width(), CurItem->height());
3 paul 1792
        HaveItem = tmp;
237 Franz 1793
        connect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
1794
        connect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
3 paul 1795
}
1796
 
80 Franz 1797
void Mpalette::setBH(double x, double y)
3 paul 1798
{
5257 cbradney 1799
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 1800
                return;
3 paul 1801
        bool tmp = HaveItem;
1802
        HaveItem = false;
1803
        QWMatrix ma;
1804
        QPoint dp;
3625 avox 1805
        if ((LMode) && (CurItem->asLine()))
215 Franz 1806
        {
1843 cbradney 1807
                ma.translate(static_cast<double>(Xpos->value()) / Umrech, static_cast<double>(Ypos->value()) / Umrech);
150 Franz 1808
                ma.rotate(static_cast<double>(Rot->value())*(-1));
3 paul 1809
                dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
1843 cbradney 1810
                Width->setValue(dp.x()*Umrech);
1811
                Height->setValue(dp.y()*Umrech);
215 Franz 1812
        }
3 paul 1813
        else
215 Franz 1814
        {
1843 cbradney 1815
                RoundRect->setMaxValue(QMIN(x, y)/2*Umrech);
3992 cbradney 1816
                RoundRect->setMinValue(-QMIN(x, y)/2*Umrech);
1843 cbradney 1817
                Width->setValue(x*Umrech);
1818
                Height->setValue(y*Umrech);
215 Franz 1819
        }
3 paul 1820
        HaveItem = tmp;
1821
}
1822
 
80 Franz 1823
void Mpalette::setR(double r)
3 paul 1824
{
5257 cbradney 1825
        if (!m_MainWindow || m_MainWindow->ScriptRunning)
173 Franz 1826
                return;
3 paul 1827
        bool tmp = HaveItem;
80 Franz 1828
        double rr = r;
3 paul 1829
        if (r > 0)
1830
                rr = 360 - rr;
1831
        HaveItem = false;
146 Franz 1832
        Rot->setValue(fabs(rr));
3 paul 1833
        HaveItem = tmp;
1834
}
1835
 
80 Franz 1836
void Mpalette::setRR(double r)
3 paul 1837
{
5257 cbradney 1838
        if (!m_MainWindow || m_MainWindow->ScriptRunning)