Subversion Repositories Scribus

Rev

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