Subversion Repositories Scribus

Rev

Rev 5781 | Rev 5880 | 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
 
332 Franz 677
        GroupBoxCM = new QGroupBox( "", page_4, "GroupBoxcm" );
217 Franz 678
        GroupBoxCM->setColumnLayout(0, Qt::Vertical );
679
        GroupBoxCM->layout()->setSpacing( 2 );
680
        GroupBoxCM->layout()->setMargin( 5 );
681
        GroupBoxCM->setFrameShape( QFrame::NoFrame );
682
        GroupBoxCM->setFrameShadow( QFrame::Plain );
683
        GroupBoxCMLayout = new QVBoxLayout( GroupBoxCM->layout() );
684
        GroupBoxCMLayout->setAlignment( Qt::AlignTop );
2207 cbradney 685
        TextCms1 = new QLabel( GroupBoxCM, "xposLabel" );
215 Franz 686
        GroupBoxCMLayout->addWidget( TextCms1 );
3680 cbradney 687
        InputP = new ScComboBox( false, GroupBoxCM, "InputP" );
217 Franz 688
        GroupBoxCMLayout->addWidget(InputP);
2207 cbradney 689
        TextCms2 = new QLabel( GroupBoxCM, "TextCms2" );
215 Franz 690
        GroupBoxCMLayout->addWidget(TextCms2);
3680 cbradney 691
        MonitorI = new ScComboBox( false, GroupBoxCM, "MonitorI" );
217 Franz 692
        GroupBoxCMLayout->addWidget(MonitorI);
693
        pageLayout_4->addWidget(GroupBoxCM);
68 Franz 694
 
217 Franz 695
        QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
696
        pageLayout_4->addItem( spacer9 );
2207 cbradney 697
        idImageItem=TabStack->addItem( page_4, "&Image" );
3 paul 698
 
217 Franz 699
        page_5 = new QWidget( TabStack, "page_5" );
700
        pageLayout_5 = new QVBoxLayout( page_5, 0, 5, "pageLayout_5");
3 paul 701
 
217 Franz 702
        Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2");
3680 cbradney 703
        LineMode = new ScComboBox( false, page_5, "LMode" );
2208 cbradney 704
        LineModeT = new QLabel( LineMode, "&Basepoint:", page_5, "LModeText" );
348 Franz 705
        Layout13_2->addWidget( LineModeT );
217 Franz 706
        Layout13_2->addWidget( LineMode );
215 Franz 707
        LMode = false;
217 Franz 708
        QSpacerItem* spacer10 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
709
        Layout13_2->addItem( spacer10 );
710
        pageLayout_5->addLayout( Layout13_2 );
3 paul 711
 
217 Franz 712
        Layout12_2 = new QGridLayout( 0, 1, 1, 0, 3, "Layout12_2");
348 Franz 713
        LStyle = new LineCombo(page_5);
2207 cbradney 714
        linetypeLabel = new QLabel( LStyle, "T&ype of Line:", page_5, "linetypeLabel" );
2148 fschmid 715
        Layout12_2->addWidget( linetypeLabel, 0, 0 );
716
        Layout12_2->addWidget( LStyle, 0, 1 );
740 fschmid 717
        startArrow = new ArrowChooser(page_5, true);
2148 fschmid 718
        Layout12_2->addWidget( startArrow, 2, 0 );
740 fschmid 719
        endArrow = new ArrowChooser(page_5, false);
2148 fschmid 720
        Layout12_2->addWidget( endArrow, 2, 1 );
2207 cbradney 721
        startArrowText = new QLabel( startArrow, "Start Arrow:", page_5, "startArrowText" );
2148 fschmid 722
        Layout12_2->addWidget( startArrowText, 1, 0 );
2207 cbradney 723
        endArrowText = new QLabel( endArrow, "End Arrow:", page_5, "endArrowText" );
2148 fschmid 724
        Layout12_2->addWidget( endArrowText, 1, 1 );
5241 fschmid 725
        LSize = new MSpinBox( page_5, 3 );
2207 cbradney 726
        linewidthLabel = new QLabel(LSize, "Line &Width:", page_5, "linewidthLabel" );
2148 fschmid 727
        Layout12_2->addWidget( linewidthLabel, 3, 0 );
728
        Layout12_2->addWidget( LSize, 3, 1 );
3680 cbradney 729
        LJoinStyle = new ScComboBox( false, page_5, "LJoin" );
2207 cbradney 730
        edgesLabel = new QLabel( LJoinStyle, "Ed&ges:", page_5, "edgesLabel" );
2148 fschmid 731
        Layout12_2->addWidget( edgesLabel, 4, 0 );
732
        Layout12_2->addWidget( LJoinStyle, 4, 1 );
3680 cbradney 733
        LEndStyle = new ScComboBox( false, page_5, "LCap" );
2207 cbradney 734
        endingsLabel = new QLabel( LEndStyle, "&Endings:", page_5, "endingsLabel" );
2148 fschmid 735
        Layout12_2->addWidget( endingsLabel, 5, 0 );
736
        Layout12_2->addWidget( LEndStyle, 5, 1 );
217 Franz 737
        pageLayout_5->addLayout( Layout12_2 );
3 paul 738
 
232 Franz 739
        TabStack3 = new QWidgetStack( page_5, "TabStack3" );
740
        TabStack3->setFrameShape( QWidgetStack::NoFrame );
741
 
742
        page_5a = new QWidget( TabStack3, "page" );
743
        pageLayout_5a = new QVBoxLayout( page_5a, 0, 5, "pageLayout_5a");
744
        StyledLine = new QListBox(page_5a, "StyledL");
2208 cbradney 745
        StyledLine->insertItem( "No Style", 0);
232 Franz 746
        pageLayout_5a->addWidget(StyledLine);
747
        TabStack3->addWidget( page_5a, 0 );
27 Franz 748
 
232 Franz 749
        page_5b = new QWidget( TabStack3, "page" );
750
        pageLayout_5b = new QVBoxLayout( page_5b, 0, 5, "pageLayout_5a");
2208 cbradney 751
        TLines = new QGroupBox( "Cell Lines", page_5b, "Distance" );
232 Franz 752
        TLines->setColumnLayout(0, Qt::Vertical );
753
        TLines->layout()->setSpacing( 2 );
754
        TLines->layout()->setMargin( 5 );
755
        TLineLayout = new QVBoxLayout( TLines->layout() );
756
        TLineLayout->setAlignment( Qt::AlignTop );
757
        TopLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 758
        TopLine->setText( "Line at Top" );
232 Franz 759
        TLineLayout->addWidget(TopLine);
760
        LeftLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 761
        LeftLine->setText( "Line at the Left" );
232 Franz 762
        TLineLayout->addWidget(LeftLine);
763
        RightLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 764
        RightLine->setText( "Line at the Right " );
232 Franz 765
        TLineLayout->addWidget(RightLine);
766
        BottomLine = new QCheckBox( TLines, "TopLine" );
2208 cbradney 767
        BottomLine->setText( "Line at Bottom" );
232 Franz 768
        TLineLayout->addWidget(BottomLine);
769
        pageLayout_5b->addWidget(TLines);
770
        TabStack3->addWidget( page_5b, 1 );
771
        pageLayout_5->addWidget( TabStack3 );
2207 cbradney 772
        idLineItem=TabStack->addItem( page_5, "&Line" );
5320 fschmid 773
 
774
        page_6 = new QWidget( TabStack, "page_6" );
775
        pageLayout_6 = new QVBoxLayout( page_6, 0, 5, "pageLayout_6");
776
 
777
        Cpal = new Cpalette(page_6);
778
        pageLayout_6->addWidget( Cpal );
779
 
780
        OverP = new QButtonGroup( "Overprinting", page_6, "Distance" );
781
        OverP->setColumnLayout(0, Qt::Vertical );
782
        OverP->layout()->setSpacing( 2 );
783
        OverP->layout()->setMargin( 5 );
784
        OverPLayout = new QVBoxLayout( OverP->layout() );
785
        OverPLayout->setAlignment( Qt::AlignTop );
786
        KnockOut = new QRadioButton( "Knockout", OverP, "KnockOut" );
787
        OverPLayout->addWidget( KnockOut );
788
        Overprint = new QRadioButton( "Overprint", OverP, "Overprint" );
789
        OverPLayout->addWidget( Overprint );
790
        KnockOut->setChecked( true );
791
        pageLayout_6->addWidget(OverP);
792
 
793
        idColorsItem=TabStack->addItem(page_6, "&Colors" );
217 Franz 794
        MpalLayout->addWidget( TabStack );
332 Franz 795
 
2199 cbradney 796
        languageChange();
216 Franz 797
 
217 Franz 798
        connect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
799
        connect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
800
        connect(Width, SIGNAL(valueChanged(int)), this, SLOT(NewW()));
801
        connect(Height, SIGNAL(valueChanged(int)), this, SLOT(NewH()));
802
        connect(Rot, SIGNAL(valueChanged(int)), this, SLOT(NewR()));
803
        connect(RoundRect, SIGNAL(valueChanged(int)), this, SLOT(NewRR()));
804
        connect(LineSp, SIGNAL(valueChanged(int)), this, SLOT(NewLsp()));
805
        connect(Size, SIGNAL(valueChanged(int)), this, SLOT(NewSize()));
806
        connect(Extra, SIGNAL(valueChanged(int)), this, SLOT(NewExtra()));
4821 cbradney 807
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(HChange()));
808
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(VChange()));
809
        connect(imageXOffsetSpinBox, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY()));
810
        connect(imageYOffsetSpinBox, SIGNAL(valueChanged(int)), this, SLOT(NewLocalXY()));
2389 fschmid 811
        connect(imgDpiX, SIGNAL(valueChanged(int)), this, SLOT(HChangeD()));
812
        connect(imgDpiY, SIGNAL(valueChanged(int)), this, SLOT(VChangeD()));
217 Franz 813
        connect(LSize, SIGNAL(valueChanged(int)), this, SLOT(NewLS()));
814
        connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLSty()));
815
        connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLJoin()));
816
        connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLEnd()));
817
        connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLMode()));
2606 cbradney 818
        connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
819
        connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
4699 cbradney 820
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
821
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
217 Franz 822
        connect(GroupAlign, SIGNAL(State(int)), this, SLOT(NewAli(int)));
823
        connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
824
        connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
2247 fschmid 825
        connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(int)), this, SLOT(newShadowOffs()));
826
        connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(int)), this, SLOT(newShadowOffs()));
2257 fschmid 827
        connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newOutlineW()));
2262 fschmid 828
        connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(newUnderline()));
829
        connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newUnderline()));
2272 fschmid 830
        connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(int)), this, SLOT(newStrike()));
831
        connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(int)), this, SLOT(newStrike()));
217 Franz 832
        connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
833
        connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
834
        connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
835
        connect(Zup, SIGNAL(clicked()), this, SLOT(DoRaise()));
836
        connect(ZDown, SIGNAL(clicked()), this, SLOT(DoLower()));
837
        connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront()));
838
        connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack()));
839
        connect(RotationGroup, SIGNAL(clicked(int)), this, SLOT(NewRotMode(int)));
5620 jghali 840
        connect(textFlowOptions, SIGNAL(clicked(int)), this, SLOT(DoFlow(int)));
5564 mrdocs 841
 
217 Franz 842
        connect(SCustom, SIGNAL(FormSel(int, int, double *)), this, SLOT(MakeIrre(int, int, double *)));
843
        connect(EditShape, SIGNAL(clicked()), this, SLOT(EditSh()));
1194 fschmid 844
        connect(dGap, SIGNAL(valueChanged(int)), this, SLOT(NewGap()));
217 Franz 845
        connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
846
        connect(DTop, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
847
        connect(DLeft, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
848
        connect(DRight, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
849
        connect(DBottom, SIGNAL(valueChanged(int)), this, SLOT(NewTDist()));
2148 fschmid 850
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
217 Franz 851
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
2508 fschmid 852
        connect(Fonts, SIGNAL(fontSelected(QString )), this, SLOT(NewTFont(QString)));
217 Franz 853
        connect(TxFill, SIGNAL(activated(int)), this, SLOT(newTxtFill()));
854
        connect(TxStroke, SIGNAL(activated(int)), this, SLOT(newTxtStroke()));
855
        connect(PM1, SIGNAL(clicked()), this, SLOT(setActShade()));
856
        connect(PM2, SIGNAL(clicked()), this, SLOT(setActShade()));
857
        connect(ChScale, SIGNAL(valueChanged(int)), this, SLOT(NewTScale()));
2230 fschmid 858
        connect(ChScaleV, SIGNAL(valueChanged(int)), this, SLOT(NewTScaleV()));
2234 fschmid 859
        connect(ChBase, SIGNAL(valueChanged(int)), this, SLOT(NewTBase()));
217 Franz 860
        connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
861
        connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
4695 cbradney 862
        connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
332 Franz 863
        connect(showcurveCheckBox, SIGNAL(clicked()), this, SLOT(handlePathLine()));
217 Franz 864
        connect(Dist, SIGNAL(valueChanged(int)), this, SLOT(handlePathDist()));
865
        connect(LineW, SIGNAL(valueChanged(int)), this, SLOT(handlePathOffs()));
866
        connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChProf(const QString&)));
867
        connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChIntent()));
215 Franz 868
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
332 Franz 869
        connect(langCombo, SIGNAL(activated(int)), this, SLOT(NewLanguage()));
217 Franz 870
        connect( TabsButton, SIGNAL( clicked() ), this, SLOT( ManageTabs() ) );
232 Franz 871
        connect( TopLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
872
        connect( LeftLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
873
        connect( RightLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
874
        connect( BottomLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
5832 fschmid 875
//      connect( colgapLabel, SIGNAL( clicked() ), this, SLOT( HandleGapSwitch() ) );
876
        connect(colgapLabel, SIGNAL(activated(int)), this, SLOT(HandleGapSwitch()));
294 Franz 877
        connect( Cpal, SIGNAL(NewSpecial(double, double, double, double )), this, SLOT(NewSpGradient(double, double, double, double )));
735 fschmid 878
        connect( Cpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEdit()));
740 fschmid 879
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
880
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2309 fschmid 881
        connect(lineSpacingPop, SIGNAL(activated(int)), this, SLOT(setLspMode(int )));
4477 fschmid 882
        connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
883
        connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
5320 fschmid 884
        connect( KnockOut, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
885
        connect( Overprint, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
4546 subik 886
 
215 Franz 887
        HaveItem = false;
888
        Xpos->setValue(0);
889
        Ypos->setValue(0);
890
        Width->setValue(0);
891
        Height->setValue(0);
892
        Rot->setValue(0);
893
        RoundRect->setValue(0);
232 Franz 894
        TabStack3->raiseWidget(0);
215 Franz 895
        TabStack2->raiseWidget(0);
2148 fschmid 896
        for (int ws = 1; ws < 6; ++ws)
897
                TabStack->setItemEnabled(ws, false);
898
        TabStack->setCurrentIndex(0);
899
        TabStack->item(0)->setEnabled(false);
900
        TabStack->setItemEnabled(0, false);
215 Franz 901
        StrokeIcon->setEnabled(false);
902
        TxStroke->setEnabled(false);
903
        PM1->setEnabled(false);
3 paul 904
}
2156 fschmid 905
 
5257 cbradney 906
void Mpalette::setMainWindow(ScribusMainWindow* mw)
907
{
5781 cbradney 908
        m_ScMW=mw;
5622 jghali 909
        QPoint p1 = mapToGlobal(pos());
5781 cbradney 910
        QPoint p2 = m_ScMW->mapFromGlobal(p1);
911
        reparent(m_ScMW, this->getWFlags(), p2);
5257 cbradney 912
 
5781 cbradney 913
        connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
914
        connect(this, SIGNAL(NewParStyle(int)), m_ScMW, SLOT(setNewParStyle(int)));
915
        connect(this, SIGNAL(NewAlignment(int)), m_ScMW, SLOT(setNewAlignment(int)));
916
        connect(this, SIGNAL(NewEffects(int)), m_ScMW, SLOT(setItemHoch(int)));
917
        connect(this, SIGNAL(ShapeEdit()), m_ScMW, SLOT(ToggleFrameEdit()));
918
        connect(this, SIGNAL(NewFont(const QString&)), m_ScMW, SLOT(SetNewFont(const QString&)));
919
        connect(this, SIGNAL(UpdtGui(int)), m_ScMW, SLOT(HaveNewSel(int)));
920
        connect(this->Cpal, SIGNAL(QueryItem()), m_ScMW, SLOT(GetBrushPen()));
921
        connect(this->Cpal->gradEdit->Preview, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
922
        connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
5257 cbradney 923
 
924
}
925
 
3 paul 926
void Mpalette::SelTab(int t)
927
{
5781 cbradney 928
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 929
                return;
296 Franz 930
        if ((HaveDoc) && (HaveItem) && (t == 5))
295 Franz 931
        {
296 Franz 932
                Cpal->setActGradient(CurItem->GrType);
3540 cbradney 933
                updateColorSpecialGradient();
686 cbradney 934
                Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
935
                Cpal->gradEdit->Preview->updateDisplay();
295 Franz 936
        }
3 paul 937
}
938
 
3691 cbradney 939
void Mpalette::setDoc(ScribusDoc *d)
3 paul 940
{
4713 cbradney 941
        disconnect(this->Cpal, SIGNAL(NewTrans(double)), 0, 0);
942
        disconnect(this->Cpal, SIGNAL(NewTransS(double)), 0, 0);
4714 cbradney 943
        disconnect(this->Cpal, SIGNAL(NewPen(QString)), 0, 0);
944
        disconnect(this->Cpal, SIGNAL(NewBrush(QString)), 0, 0);
945
        disconnect(this->Cpal, SIGNAL(NewPenShade(int)), 0, 0);
946
        disconnect(this->Cpal, SIGNAL(NewBrushShade(int)), 0, 0);
947
        disconnect(this->Cpal, SIGNAL(NewGradient(int)), 0, 0);
5746 fschmid 948
        disconnect(this->Cpal, SIGNAL(NewBlend(int)), 0, 0);
949
        disconnect(this->Cpal, SIGNAL(NewBlendS(int)), 0, 0);
4729 subik 950
 
3 paul 951
        doc = d;
2965 cbradney 952
        Umrech=doc->unitRatio();
2607 fschmid 953
        double maxXYWHVal= 30000 * Umrech;
954
        double minXYVal= -30000 * Umrech;
3 paul 955
        HaveDoc = true;
186 Franz 956
        HaveItem = false;
335 Franz 957
 
958
        Xpos->setValues( minXYVal, maxXYWHVal, 100, minXYVal);
959
        Ypos->setValues( minXYVal, maxXYWHVal, 100, minXYVal);
1843 cbradney 960
        Width->setValues( Umrech, maxXYWHVal, 100, Umrech);
961
        Height->setValues( Umrech, maxXYWHVal, 100, Umrech);
4821 cbradney 962
        imageXOffsetSpinBox->setValues( -30000, maxXYWHVal, 100, 0);
963
        imageYOffsetSpinBox->setValues( -30000, maxXYWHVal, 100, 0);
335 Franz 964
 
1617 fschmid 965
        Rot->setValues( 0, 359.99, 100, 0);
335 Franz 966
        RoundRect->setValues( -300, 300, 10, 0);
967
        Extra->setValues( -300, 300, 10, 0);
2247 fschmid 968
        Size->setValues( 0.5, 2048, 10, 1);
2287 cbradney 969
        LineSp->setValues( 1, 2048, 10, 1);
4821 cbradney 970
        imageXScaleSpinBox->setValues( 1, 30000, 10, 1);
971
        imageYScaleSpinBox->setValues( 1, 30000, 10, 1);
2607 fschmid 972
        imgDpiX->setValues( 1, 30000, 10, 1);
973
        imgDpiY->setValues( 1, 30000, 10, 1);
335 Franz 974
 
1194 fschmid 975
        dGap->setDecimals(10);
215 Franz 976
        DTop->setDecimals(10);
977
        DLeft->setDecimals(10);
978
        DBottom->setDecimals(10);
979
        DRight->setDecimals(10);
4811 cbradney 980
        LSize->setMaxValue( 300 );
174 Franz 981
        LSize->setMinValue( 0 );
392 Franz 982
        Dist->setMaxValue( 30000 );
68 Franz 983
        Dist->setMinValue( 0 );
984
        Dist->setLineStep(10);
146 Franz 985
        LineW->setMaxValue( 300 );
986
        LineW->setMinValue( -300 );
68 Franz 987
        LineW->setLineStep(10);
335 Franz 988
 
68 Franz 989
        updateCList();
4546 subik 990
 
4117 cbradney 991
        updateSpinBoxConstants();
4729 subik 992
 
4713 cbradney 993
        connect(this->Cpal, SIGNAL(NewTrans(double)), doc, SLOT(itemSelection_SetItemFillTransparency(double)));
994
        connect(this->Cpal, SIGNAL(NewTransS(double)), doc, SLOT(itemSelection_SetItemLineTransparency(double)));
5746 fschmid 995
        connect(this->Cpal, SIGNAL(NewBlend(int)), doc, SLOT(itemSelection_SetItemFillBlend(int)));
996
        connect(this->Cpal, SIGNAL(NewBlendS(int)), doc, SLOT(itemSelection_SetItemLineBlend(int)));
4714 cbradney 997
        connect(this->Cpal, SIGNAL(NewPen(QString)), doc, SLOT(ItemPen(QString)));
998
        connect(this->Cpal, SIGNAL(NewBrush(QString)), doc, SLOT(ItemBrush(QString)));
999
        connect(this->Cpal, SIGNAL(NewPenShade(int)), doc, SLOT(ItemPenShade(int)));
1000
        connect(this->Cpal, SIGNAL(NewBrushShade(int)), doc, SLOT(ItemBrushShade(int)));
1001
        connect(this->Cpal, SIGNAL(NewGradient(int)), doc, SLOT(ItemGradFill(int)));
3 paul 1002
}
1003
 
3691 cbradney 1004
void Mpalette::unsetDoc()
3 paul 1005
{
1006
        HaveDoc = false;
4714 cbradney 1007
        HaveItem = false;
1008
        doc=NULL;
3 paul 1009
}
1010
 
4738 cbradney 1011
void Mpalette::unsetItem()
1012
{
1013
        HaveItem=false;
1014
        CurItem = NULL;
1015
        NewSel(-1);
1016
}
1017
 
3985 cbradney 1018
void Mpalette::setCurrentItem(PageItem *i)
1019
{
5781 cbradney 1020
        if (!m_ScMW || m_ScMW->ScriptRunning)
3985 cbradney 1021
                return;
1022
        //CB We shouldnt really need to process this if our item is the same one
1023
        //maybe we do if the item has been changed by scripter.. but that should probably
1024
        //set some status if so.
1025
        //FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
1026
        //if (CurItem == i)
1027
        //      return;
1028
        disconnect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1029
        disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1030
        disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1031
        disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
1032
        HaveItem = false;
1033
        CurItem = i;
4546 subik 1034
 
3985 cbradney 1035
        NewSel(i->itemType());
1036
        NameEdit->setText(i->itemName());
1037
        setXY(i->xPos(), i->yPos());
1038
        setBH(i->width(), i->height());
1039
        setR(i->rotation());
4546 subik 1040
 
3988 cbradney 1041
        Revert->setOn(i->reversed());
1042
        setDvals(i->textToFrameDistLeft(), i->textToFrameDistTop(), i->textToFrameDistBottom(), i->textToFrameDistRight());
3985 cbradney 1043
        LevelTxt->setText(QString::number(i->ItemNr));
5620 jghali 1044
        setTextFlowMode(i->textFlowMode());
3989 cbradney 1045
        RoundRect->setValue(i->cornerRadius()*Umrech);
4699 cbradney 1046
        /*
1047
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1048
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
3985 cbradney 1049
        FlipH->setOn(i->imageFlippedH());
1050
        FlipV->setOn(i->imageFlippedV());
4699 cbradney 1051
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1052
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1053
        */
5781 cbradney 1054
        langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
3985 cbradney 1055
        if (TabStack->currentIndex() == 5)
1056
                Cpal->setActGradient(CurItem->GrType);
1057
        updateColorSpecialGradient();
1058
        Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1059
        Cpal->gradEdit->Preview->updateDisplay();
1060
        if (i->FrameType == 0)
1061
                SCustom->setPixmap(SCustom->getIconPixmap(0));
1062
        if (i->FrameType == 1)
1063
                SCustom->setPixmap(SCustom->getIconPixmap(1));
1064
        if (i->FrameType > 3)
1065
                SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
1066
        if ((i->asLine()) || (i->asPolyLine()))
1067
        {
1068
                startArrow->setEnabled(true);
1069
                endArrow->setEnabled(true);
4061 craig 1070
                startArrow->setCurrentItem(i->startArrowIndex());
1071
                endArrow->setCurrentItem(i->endArrowIndex());
3985 cbradney 1072
        }
1073
        else
1074
        {
1075
                startArrow->setEnabled(false);
1076
                endArrow->setEnabled(false);
1077
        }
4098 cbradney 1078
        PageItem_TextFrame* i2=i->asTextFrame();
1079
        if (i2!=0)
3985 cbradney 1080
        {
4098 cbradney 1081
                DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
1082
                DCol->setMinValue(1);
1083
                DCol->setValue(i2->Cols);
1084
                dGap->setMinValue(0);
5832 fschmid 1085
//              if (colgapLabel->getState())
1086
                if (colgapLabel->currentItem() == 0)
4098 cbradney 1087
                {
1088
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
1089
                        dGap->setValue(i2->ColGap*Umrech);
1090
                }
3985 cbradney 1091
                else
4098 cbradney 1092
                {
1093
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols)*Umrech, 0));
1094
                        dGap->setValue(i2->columnWidth()*Umrech);
1095
                }
3985 cbradney 1096
        }
1097
        bool setter;
1098
        if (i->NamedLStyle.isEmpty())
1099
        {
1100
                StyledLine->setCurrentItem(0);
1101
                setter = true;
1102
        }
1103
        else
1104
        {
1105
                StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
1106
                setter = false;
1107
        }
1108
        LStyle->setEnabled(setter);
1109
        LSize->setEnabled(setter);
1110
        LJoinStyle->setEnabled(setter);
1111
        LEndStyle->setEnabled(setter);
1112
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1113
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1114
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1115
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
4698 cbradney 1116
        setPrintingEnabled(i->printEnabled());
5226 cbradney 1117
        //CB not needed, done from pageitem->emitalltogui or individual emit.
1118
        //setLocked(i->locked());
1119
        //setSizeLocked(i->sizeLocked());
3985 cbradney 1120
        if ((i->isTableItem) && (i->isSingleSel))
1121
        {
1122
                setter = true;
1123
                TabStack3->raiseWidget(1);
1124
                TopLine->setChecked(i->TopLine);
1125
                LeftLine->setChecked(i->LeftLine);
1126
                RightLine->setChecked(i->RightLine);
1127
                BottomLine->setChecked(i->BottomLine);
1128
        }
1129
        else
1130
                TabStack3->raiseWidget(0);
1131
        LayerGroup->setEnabled(!setter);
4782 cbradney 1132
        /*
3985 cbradney 1133
        Xpos->setReadOnly(setter);
1134
        Ypos->setReadOnly(setter);
1135
        Rot->setReadOnly(setter);
4782 cbradney 1136
        */
3985 cbradney 1137
        if (i->asPathText())
1138
        {
1139
                TabStack2->raiseWidget(1);
1140
                showcurveCheckBox->setChecked(i->PoShow);
1141
                LineW->setValue(i->BaseOffs * -1);
3988 cbradney 1142
                Dist->setValue(i->textToFrameDistLeft());
3985 cbradney 1143
        }
4477 fschmid 1144
        else if (i->asPolygon())
1145
        {
1146
                TabStack2->raiseWidget(2);
5320 fschmid 1147
                NonZero->setChecked(!i->fillRule);
4477 fschmid 1148
                EvenOdd->setChecked(i->fillRule);
1149
        }
3985 cbradney 1150
        else
1151
                TabStack2->raiseWidget(0);
1152
        // Frame type 3 is obsolete: CR 2005-02-06
1153
        //if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
1154
        if (((i->asTextFrame()) || (i->asImageFrame())) &&  (!i->ClipEdited))
1155
                RoundRect->setEnabled(true);
1156
        else
1157
        {
1158
                if ((i->asPolygon()) && ((i->FrameType == 0) || (i->FrameType == 2)))
1159
                        RoundRect->setEnabled(true);
1160
                else
1161
                        RoundRect->setEnabled(false);
1162
        }
5320 fschmid 1163
        KnockOut->setChecked(!i->doOverprint);
1164
        Overprint->setChecked(i->doOverprint);
3985 cbradney 1165
 
1166
        if ((i->itemType() == PageItem::Line) && LMode) {
1167
                xposLabel->setText( tr( "&X1:" ) );
1168
                widthLabel->setText( tr( "X&2:" ) );
1169
                yposLabel->setText( tr( "Y&1:" ) );
1170
                heightLabel->setText( tr( "&Y2:" ) );
1171
                Rot->setEnabled(false);
1172
        } else {
1173
                xposLabel->setText( tr( "&X-Pos:" ) );
1174
                widthLabel->setText( tr( "&Width:" ) );
1175
                yposLabel->setText( tr( "&Y-Pos:" ) );
1176
                heightLabel->setText( tr( "&Height:" ) );
1177
                Rot->setEnabled(true);
1178
        }
1179
        HaveItem = true;
1180
        if (i->asLine())
1181
        {
1182
                keepFrameWHRatioButton->setEnabled(false);
1183
                if (LMode && !i->locked())
1184
                        Height->setEnabled(true);
1185
                else
1186
                        Height->setEnabled(false);
1187
        }
1188
        else
1189
        {
1190
                Height->setEnabled(true);
1191
                keepFrameWHRatioButton->setEnabled(true);
1192
                if (i->asImageFrame())
1193
                {
1194
                        updateCmsList();
1195
                        setter = i->ScaleType;
1196
                        FreeScale->setChecked(setter);
1197
                        FrameScale->setChecked(!setter);
1198
                        if (setter == true)
1199
                        {
1200
                                keepImageWHRatioButton->setOn(setter);
1201
                                keepImageDPIRatioButton->setOn(setter);
1202
                        }
1203
                        Aspect->setEnabled(!setter);
1204
                        Aspect->setChecked(i->AspectRatio);
4821 cbradney 1205
                        imageXOffsetSpinBox->setEnabled(setter);
1206
                        imageYOffsetSpinBox->setEnabled(setter);
1207
                        imageXScaleSpinBox->setEnabled(setter);
1208
                        imageYScaleSpinBox->setEnabled(setter);
3985 cbradney 1209
                        imgDpiX->setEnabled(setter);
1210
                        imgDpiY->setEnabled(setter);
1211
                }
1212
        }
1213
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
1214
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1215
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
4546 subik 1216
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
3985 cbradney 1217
}
1218
 
1219
 
5620 jghali 1220
void Mpalette::setTextFlowMode(PageItem::TextFlowMode mode)
1221
{
5781 cbradney 1222
        if (!m_ScMW || m_ScMW->ScriptRunning)
5620 jghali 1223
                return;
1224
        if (mode == PageItem::TextFlowDisabled)
5705 jghali 1225
                textFlowDisabled->setOn(true);
5620 jghali 1226
        else if (mode == PageItem::TextFlowUsesFrameShape)
5705 jghali 1227
                textFlowUsesFrameShape->setOn(true);
5620 jghali 1228
        else if (mode == PageItem::TextFlowUsesBoundingBox)
5705 jghali 1229
                textFlowUsesBoundingBox->setOn(true);
5620 jghali 1230
        else if (mode == PageItem::TextFlowUsesContourLine)
5705 jghali 1231
                textFlowUsesContourLine->setOn(true);
5620 jghali 1232
}
1233
 
3 paul 1234
void Mpalette::SetCurItem(PageItem *i)
1235
{
5781 cbradney 1236
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 1237
                return;
3894 cbradney 1238
        //CB We shouldnt really need to process this if our item is the same one
1239
        //maybe we do if the item has been changed by scripter.. but that should probably
1240
        //set some status if so.
1241
        //FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
1242
        //if (CurItem == i)
1243
        //      return;
217 Franz 1244
        disconnect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
68 Franz 1245
        disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
740 fschmid 1246
        disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1247
        disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
3985 cbradney 1248
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
4546 subik 1249
 
3 paul 1250
        HaveItem = false;
1251
        CurItem = i;
2148 fschmid 1252
        if (TabStack->currentIndex() == 5)
296 Franz 1253
                Cpal->setActGradient(CurItem->GrType);
3540 cbradney 1254
        updateColorSpecialGradient();
686 cbradney 1255
        Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1256
        Cpal->gradEdit->Preview->updateDisplay();
188 Franz 1257
        if (i->FrameType == 0)
1258
                SCustom->setPixmap(SCustom->getIconPixmap(0));
1259
        if (i->FrameType == 1)
1260
                SCustom->setPixmap(SCustom->getIconPixmap(1));
1261
        if (i->FrameType > 3)
1262
                SCustom->setPixmap(SCustom->getIconPixmap(i->FrameType-2));
3625 avox 1263
        if ((i->asLine()) || (i->asPolyLine()))
740 fschmid 1264
        {
1265
                startArrow->setEnabled(true);
1266
                endArrow->setEnabled(true);
4061 craig 1267
                startArrow->setCurrentItem(i->startArrowIndex());
1268
                endArrow->setCurrentItem(i->endArrowIndex());
740 fschmid 1269
        }
1270
        else
1271
        {
1272
                startArrow->setEnabled(false);
1273
                endArrow->setEnabled(false);
1274
        }
1361 tsoots 1275
        NameEdit->setText(i->itemName());
3989 cbradney 1276
        RoundRect->setValue(i->cornerRadius()*Umrech);
272 Franz 1277
        QString tm;
1278
        LevelTxt->setText(tm.setNum(i->ItemNr));
4098 cbradney 1279
        PageItem_TextFrame *i2=i->asTextFrame();
1280
        if (i2!=0)
265 Franz 1281
        {
4098 cbradney 1282
                DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
1283
                DCol->setMinValue(1);
1284
                DCol->setValue(i2->Cols);
1285
                dGap->setMinValue(0);
5832 fschmid 1286
//              if (colgapLabel->getState())
1287
                if (colgapLabel->currentItem() == 0)
4098 cbradney 1288
                {
1289
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
1290
                        dGap->setValue(i2->ColGap*Umrech);
1291
                }
265 Franz 1292
                else
4098 cbradney 1293
                {
1294
                        dGap->setMaxValue(QMAX((i2->width() / i2->Cols)*Umrech, 0));
1295
                        dGap->setValue(i2->columnWidth()*Umrech);
1296
                }
1297
                DLeft->setValue(i2->textToFrameDistLeft()*Umrech);
1298
                DTop->setValue(i2->textToFrameDistTop()*Umrech);
1299
                DBottom->setValue(i2->textToFrameDistBottom()*Umrech);
1300
                DRight->setValue(i2->textToFrameDistRight()*Umrech);
265 Franz 1301
        }
3988 cbradney 1302
        Revert->setOn(i->reversed());
5620 jghali 1303
        setTextFlowMode(i->textFlowMode());
4699 cbradney 1304
        /*
1305
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1306
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1392 cbradney 1307
        FlipH->setOn(i->imageFlippedH());
1308
        FlipV->setOn(i->imageFlippedV());
4699 cbradney 1309
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1310
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1311
        */
5781 cbradney 1312
        langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
80 Franz 1313
        bool setter;
2877 cbradney 1314
        if (i->NamedLStyle.isEmpty())
215 Franz 1315
        {
1316
                StyledLine->setCurrentItem(0);
1317
                setter = true;
1318
        }
27 Franz 1319
        else
215 Franz 1320
        {
1321
                StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
1322
                setter = false;
1323
        }
80 Franz 1324
        LStyle->setEnabled(setter);
1325
        LSize->setEnabled(setter);
1326
        LJoinStyle->setEnabled(setter);
1327
        LEndStyle->setEnabled(setter);
216 Franz 1328
        connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
68 Franz 1329
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
740 fschmid 1330
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1331
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
4729 subik 1332
        //CB not needed, done from pageitem->emitalltogui or individual emit.
4698 cbradney 1333
        //NoPrint->setOn(!i->printEnabled());
1334
        //setLocked(i->locked());
1335
        //setSizeLocked(i->sizeLocked());
232 Franz 1336
        if ((i->isTableItem) && (i->isSingleSel))
1337
        {
335 Franz 1338
                setter = true;
232 Franz 1339
                TabStack3->raiseWidget(1);
1340
                TopLine->setChecked(i->TopLine);
1341
                LeftLine->setChecked(i->LeftLine);
1342
                RightLine->setChecked(i->RightLine);
1343
                BottomLine->setChecked(i->BottomLine);
1344
        }
1345
        else
1346
                TabStack3->raiseWidget(0);
339 Franz 1347
        LayerGroup->setEnabled(!setter);
4782 cbradney 1348
        /*
335 Franz 1349
        Xpos->setReadOnly(setter);
1350
        Ypos->setReadOnly(setter);
1351
        Rot->setReadOnly(setter);
4782 cbradney 1352
        */
3625 avox 1353
        if (i->asPathText())
215 Franz 1354
        {
68 Franz 1355
                TabStack2->raiseWidget(1);
332 Franz 1356
                showcurveCheckBox->setChecked(i->PoShow);
217 Franz 1357
                LineW->setValue(i->BaseOffs * -1);
3988 cbradney 1358
                Dist->setValue(i->textToFrameDistLeft());
215 Franz 1359
        }
4477 fschmid 1360
        else if (i->asPolygon())
1361
        {
1362
                TabStack2->raiseWidget(2);
5320 fschmid 1363
                NonZero->setChecked(!i->fillRule);
4477 fschmid 1364
                EvenOdd->setChecked(i->fillRule);
1365
        }
68 Franz 1366
        else
1367
                TabStack2->raiseWidget(0);
1460 cbradney 1368
        // Frame type 3 is obsolete: CR 2005-02-06
1369
        //if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
4941 fschmid 1370
        if (((i->asTextFrame()) || (i->asImageFrame())) &&  (!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
3 paul 1371
                RoundRect->setEnabled(true);
1372
        else
217 Franz 1373
        {
4941 fschmid 1374
                if ((i->asPolygon()) &&  (!i->ClipEdited)  && ((i->FrameType == 0) || (i->FrameType == 2)))
217 Franz 1375
                        RoundRect->setEnabled(true);
1376
                else
1377
                        RoundRect->setEnabled(false);
1378
        }
5320 fschmid 1379
        KnockOut->setChecked(!i->doOverprint);
1380
        Overprint->setChecked(i->doOverprint);
1460 cbradney 1381
        if ((i->itemType() == PageItem::Line) && LMode) {
348 Franz 1382
                xposLabel->setText( tr( "&X1:" ) );
1383
                widthLabel->setText( tr( "X&2:" ) );
1384
                yposLabel->setText( tr( "Y&1:" ) );
1385
                heightLabel->setText( tr( "&Y2:" ) );
332 Franz 1386
                Rot->setEnabled(false);
1387
        } else {
348 Franz 1388
                xposLabel->setText( tr( "&X-Pos:" ) );
1389
                widthLabel->setText( tr( "&Width:" ) );
1390
                yposLabel->setText( tr( "&Y-Pos:" ) );
1391
                heightLabel->setText( tr( "&Height:" ) );
332 Franz 1392
                Rot->setEnabled(true);
1393
        }
3044 fschmid 1394
        HaveItem = true;
3625 avox 1395
        if (i->asLine())
215 Franz 1396
        {
2606 cbradney 1397
                keepFrameWHRatioButton->setEnabled(false);
2546 cbradney 1398
                if (LMode && !i->locked())
3 paul 1399
                        Height->setEnabled(true);
1400
                else
1401
                        Height->setEnabled(false);
215 Franz 1402
        }
3 paul 1403
        else
215 Franz 1404
        {
2679 cbradney 1405
                Height->setEnabled(true);
2606 cbradney 1406
                keepFrameWHRatioButton->setEnabled(true);
3625 avox 1407
                if (i->asImageFrame())
3 paul 1408
                {
68 Franz 1409
                        updateCmsList();
162 Franz 1410
                        setter = i->ScaleType;
80 Franz 1411
                        FreeScale->setChecked(setter);
1412
                        FrameScale->setChecked(!setter);
5727 cbradney 1413
//CB Why do we need this? Setting it too much here
1414
//                      if (setter == true)
1415
//                      {
1416
//                              keepImageWHRatioButton->setOn(setter);
1417
//                              keepImageDPIRatioButton->setOn(setter);
1418
//                      }
162 Franz 1419
                        Aspect->setEnabled(!setter);
1420
                        Aspect->setChecked(i->AspectRatio);
4821 cbradney 1421
                        imageXOffsetSpinBox->setEnabled(setter);
1422
                        imageYOffsetSpinBox->setEnabled(setter);
1423
                        imageXScaleSpinBox->setEnabled(setter);
1424
                        imageYScaleSpinBox->setEnabled(setter);
2389 fschmid 1425
                        imgDpiX->setEnabled(setter);
1426
                        imgDpiY->setEnabled(setter);
3 paul 1427
                }
215 Franz 1428
        }
3903 cbradney 1429
        setXY(i->xPos(), i->yPos());
4546 subik 1430
 
4110 cbradney 1431
        updateSpinBoxConstants();
3 paul 1432
}
1433
 
1434
void Mpalette::NewSel(int nr)
1435
{
5781 cbradney 1436
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 1437
                return;
86 Franz 1438
        int visID;
5226 cbradney 1439
        PageItem *i=0;
2156 fschmid 1440
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
4847 cbradney 1441
        if (doc->m_Selection->count()>1)
215 Franz 1442
        {
131 Franz 1443
                RoVal = 0;
129 Franz 1444
                double gx, gy, gh, gw;
5781 cbradney 1445
                m_ScMW->view->getGroupRect(&gx, &gy, &gw, &gh);
217 Franz 1446
                if (TopLeft->isChecked())
5781 cbradney 1447
                        m_ScMW->view->RCenter = FPoint(gx, gy);
217 Franz 1448
                if (TopRight->isChecked())
5781 cbradney 1449
                        m_ScMW->view->RCenter = FPoint(gx + gw, gy);
217 Franz 1450
                if (Center->isChecked())
5781 cbradney 1451
                        m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
217 Franz 1452
                if (BottomLeft->isChecked())
5781 cbradney 1453
                        m_ScMW->view->RCenter = FPoint(gx, gy + gh);
217 Franz 1454
                if (BottomRight->isChecked())
5781 cbradney 1455
                        m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
348 Franz 1456
                xposLabel->setText( tr( "&X-Pos:" ) );
1457
                widthLabel->setText( tr( "&Width:" ) );
1458
                yposLabel->setText( tr( "&Y-Pos:" ) );
1459
                heightLabel->setText( tr( "&Height:" ) );
3 paul 1460
                HaveItem = false;
1461
                Xpos->setValue(0);
1462
                Ypos->setValue(0);
1463
                Width->setValue(0);
1464
                Height->setValue(0);
1465
                Rot->setValue(0);
1466
                RoundRect->setValue(0);
1467
                HaveItem = true;
1468
                Xpos->setEnabled(true);
1469
                Ypos->setEnabled(true);
1470
                Width->setEnabled(true);
1471
                Height->setEnabled(true);
1472
                Rot->setEnabled(true);
2148 fschmid 1473
                TabStack->setCurrentIndex(0);
1474
                TabStack->item(0)->setEnabled(true);
1475
                TabStack->setItemEnabled(0, true);
68 Franz 1476
                NameEdit->setEnabled(false);
2387 cbradney 1477
                TabStack->setItemEnabled(5, true);
5226 cbradney 1478
                FlipH->setToggleButton( true );
1479
                FlipV->setToggleButton( true );
1480
                FlipH->setOn(false);
1481
                FlipV->setOn(false);
215 Franz 1482
        }
3 paul 1483
        else
215 Franz 1484
        {
5226 cbradney 1485
                if (nr!=-1)
1486
                {
1487
                        i=doc->m_Selection->itemAt(0);
1488
                        HaveItem=true;
1489
                        EditShape->setEnabled(!i->locked());
1490
                        ShapeGroup->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
1491
                }
1492
                else
1493
                {
1494
                        EditShape->setEnabled(false);
1495
                        ShapeGroup->setEnabled(false);
1496
                }
68 Franz 1497
                NameEdit->setEnabled(true);
5226 cbradney 1498
//              ShapeGroup->setEnabled(false);
1499
//              RoundRect->setEnabled(false);
3 paul 1500
                Distance->setEnabled(false);
1501
                LineMode->setEnabled(false);
1502
                TopLeft->setEnabled(true);
1503
                TopRight->setEnabled(true);
1504
                BottomLeft->setEnabled(true);
1505
                BottomRight->setEnabled(true);
1506
                Center->setEnabled(true);
2148 fschmid 1507
                visID = TabStack->currentIndex ();
1508
                TabStack->item(0)->setEnabled(true);
1509
                TabStack->setItemEnabled(0, true);
1510
                TabStack->setItemEnabled(5, true);
4699 cbradney 1511
                /*
1512
                disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1513
                disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
917 fschmid 1514
                FlipH->setOn(false);
1515
                FlipV->setOn(false);
4699 cbradney 1516
                connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1517
                connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1518
                */
5226 cbradney 1519
 
1520
                //CB If Toggle is not possible, then we need to enable it so we can turn it off
1521
                //It then gets reset below for items where its valid
1522
                if ((nr>4) && (nr<9))
1523
                {
1524
                        FlipH->setToggleButton(true);
1525
                        FlipV->setToggleButton(true);
1526
                        FlipH->setOn(false);
1527
                        FlipV->setOn(false);
1528
                }
1529
                FlipH->setToggleButton((nr>=0) && (nr<5));
1530
                FlipV->setToggleButton((nr>=0) && (nr<5));
1531
                //CB Why cant we do this for lines?
5240 fschmid 1532
//              FlipH->setEnabled((nr!=-1) && (nr!=5));
1533
//              FlipV->setEnabled((nr!=-1) && (nr!=5));
1534
                FlipH->setEnabled(nr!=-1);
1535
                FlipV->setEnabled(nr!=-1);
3 paul 1536
                switch (nr)
215 Franz 1537
                {
217 Franz 1538
                case -1:
348 Franz 1539
                        xposLabel->setText( tr( "&X-Pos:" ) );
1540
                        widthLabel->setText( tr( "&Width:" ) );
1541
                        yposLabel->setText( tr( "&Y-Pos:" ) );
1542
                        heightLabel->setText( tr( "&Height:" ) );
4782 cbradney 1543
                        //Rot->setEnabled(true);
1544
                        //Height->setEnabled(true);
5226 cbradney 1545
                        RoundRect->setEnabled(false);
217 Franz 1546
                        HaveItem = false;
1547
                        Xpos->setValue(0);
1548
                        Ypos->setValue(0);
1549
                        Width->setValue(0);
1550
                        Height->setValue(0);
1551
                        Rot->setValue(0);
1552
                        RoundRect->setValue(0);
2148 fschmid 1553
                        for (int ws = 1; ws < 6; ++ws)
1554
                                TabStack->setItemEnabled(ws, false);
1555
                        TabStack->setCurrentIndex(0);
1556
                        TabStack->item(0)->setEnabled(false);
1557
                        TabStack->setItemEnabled(0, false);
294 Franz 1558
                        Cpal->ChooseGrad(0);
217 Franz 1559
                        break;
1560
                case 2:
2148 fschmid 1561
                        TabStack->setItemEnabled(1, true);
2183 fschmid 1562
                        TabStack->setItemEnabled(2, false);
2148 fschmid 1563
                        TabStack->setItemEnabled(3, true);
1564
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1565
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1566
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1567
                        else
1568
                                RoundRect->setEnabled(false);
4847 cbradney 1569
                        if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
5226 cbradney 1570
                                RoundRect->setEnabled(!i->locked());
217 Franz 1571
                        if (visID == 2)
2148 fschmid 1572
                                TabStack->setCurrentIndex(0);
217 Franz 1573
                        break;
1574
                case 4:
2148 fschmid 1575
                        TabStack->setItemEnabled(1, true);
1576
                        TabStack->setItemEnabled(2, true);
2183 fschmid 1577
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1578
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1579
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1580
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1581
                        else
1582
                                RoundRect->setEnabled(false);
217 Franz 1583
                        Distance->setEnabled(true);
1584
                        if (visID == 3)
2148 fschmid 1585
                                TabStack->setCurrentIndex(0);
217 Franz 1586
                        break;
1587
                case 5:
2183 fschmid 1588
                        TabStack->setItemEnabled(1, false);
1589
                        TabStack->setItemEnabled(2, false);
1590
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1591
                        TabStack->setItemEnabled(4, true);
5226 cbradney 1592
                        RoundRect->setEnabled(false);
217 Franz 1593
                        LineMode->setEnabled(true);
1594
                        TopLeft->setEnabled(false);
1595
                        TopRight->setEnabled(false);
1596
                        BottomLeft->setEnabled(false);
1597
                        BottomRight->setEnabled(false);
1598
                        Center->setEnabled(false);
1599
                        if ((visID == 1) || (visID == 2) || (visID == 3))
2148 fschmid 1600
                                TabStack->setCurrentIndex(0);
217 Franz 1601
                        break;
302 Franz 1602
                case 1:
1603
                case 3:
217 Franz 1604
                case 6:
2148 fschmid 1605
                        TabStack->setItemEnabled(1, true);
2183 fschmid 1606
                        TabStack->setItemEnabled(2, false);
1607
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1608
                        TabStack->setItemEnabled(4, true);
4941 fschmid 1609
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
5226 cbradney 1610
                                RoundRect->setEnabled(!i->locked());
4941 fschmid 1611
                        else
1612
                                RoundRect->setEnabled(false);
217 Franz 1613
                        if ((visID == 2) || (visID == 3))
2148 fschmid 1614
                                TabStack->setCurrentIndex(0);
217 Franz 1615
                        break;
1616
                case 7:
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);
5226 cbradney 1621
                        RoundRect->setEnabled(false);
217 Franz 1622
                        if ((visID == 2) || (visID == 3))
2148 fschmid 1623
                                TabStack->setCurrentIndex(0);
217 Franz 1624
                        break;
1625
                case 8:
2148 fschmid 1626
                        TabStack->setItemEnabled(1, true);
1627
                        TabStack->setItemEnabled(2, true);
2183 fschmid 1628
                        TabStack->setItemEnabled(3, false);
2148 fschmid 1629
                        TabStack->setItemEnabled(4, true);
5226 cbradney 1630
                        RoundRect->setEnabled(false);
217 Franz 1631
                        if (visID == 3)
2148 fschmid 1632
                                TabStack->setCurrentIndex(0);
217 Franz 1633
                        break;
3 paul 1634
                }
215 Franz 1635
        }
3 paul 1636
        updateGeometry();
5774 avox 1637
//      setFocus();
3 paul 1638
        repaint();
2156 fschmid 1639
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
3 paul 1640
}
1641
 
4131 cbradney 1642
void Mpalette::setMultipleSelection(bool isMultiple)
4049 cbradney 1643
{
4729 subik 1644
        //CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
4588 cbradney 1645
        //these can be enabled all the time
1646
        //FlipH->setEnabled(!isMultiple);
1647
        //FlipV->setEnabled(!isMultiple);
4702 cbradney 1648
        NameEdit->setEnabled(!isMultiple);
4049 cbradney 1649
}
1650
 
4619 cbradney 1651
void Mpalette::unitChange()
3 paul 1652
{
1612 cbradney 1653
        double oldRatio = Umrech;
2965 cbradney 1654
        Umrech = doc->unitRatio();
3 paul 1655
        bool tmp = HaveItem;
1656
        HaveItem = false;
2607 fschmid 1657
        double maxXYWHVal=30000 * Umrech;
1658
        double minXYVal=-30000 * Umrech;
335 Franz 1659
 
1843 cbradney 1660
        double ratioDivisor = Umrech / oldRatio;
1612 cbradney 1661
        double newX = Xpos->value() * ratioDivisor;
1662
        double newY = Ypos->value() * ratioDivisor;
1663
        double newW = Width->value() * ratioDivisor;
1664
        double newH = Height->value() * ratioDivisor;
4821 cbradney 1665
        double newLX = imageXOffsetSpinBox->value() * ratioDivisor;
1666
        double newLY = imageYOffsetSpinBox->value() * ratioDivisor;
1612 cbradney 1667
        double newG = dGap->value() * ratioDivisor;
1668
        double newGM = dGap->maxValue() * ratioDivisor;
1669
        double newDT = DTop->value() * ratioDivisor;
1670
        double newDL = DLeft->value() * ratioDivisor;
1671
        double newDB = DBottom->value() * ratioDivisor;
1672
        double newDR = DRight->value() * ratioDivisor;
1673
        double newRR = RoundRect->value() * ratioDivisor;
1674
        double newRM = RoundRect->maxValue() * ratioDivisor;
5250 fschmid 1675
        double newLZ = LSize->value() * ratioDivisor;
335 Franz 1676
 
2965 cbradney 1677
        if (doc->unitIndex() > unitGetMaxIndex())
1678
                doc->setUnitIndex(0);
1679
        QString ein = unitGetSuffixFromIndex(doc->unitIndex());
335 Franz 1680
 
3 paul 1681
        Xpos->setSuffix( ein );
1682
        Ypos->setSuffix( ein );
1683
        Width->setSuffix( ein );
1684
        Height->setSuffix( ein );
4821 cbradney 1685
        imageXOffsetSpinBox->setSuffix( ein );
1686
        imageYOffsetSpinBox->setSuffix( ein );
1194 fschmid 1687
        dGap->setSuffix( ein );
139 Franz 1688
        DLeft->setSuffix( ein );
1689
        DTop->setSuffix( ein );
1690
        DBottom->setSuffix( ein );
1691
        DRight->setSuffix( ein );
1692
        RoundRect->setSuffix( ein );
5250 fschmid 1693
        LSize->setSuffix( ein );
1694
        LSize->setValue(newLZ);
335 Franz 1695
 
2965 cbradney 1696
        int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
335 Franz 1697
 
1612 cbradney 1698
        Xpos->setValues( minXYVal, maxXYWHVal, decimals, newX );
1699
        Ypos->setValues( minXYVal, maxXYWHVal, decimals, newY );
1843 cbradney 1700
        Width->setValues( Umrech, maxXYWHVal, decimals, newW );
1701
        Height->setValues( Umrech, maxXYWHVal, decimals, newH );
335 Franz 1702
 
4821 cbradney 1703
        imageXOffsetSpinBox->setDecimals(decimals);
1704
        imageXOffsetSpinBox->setMaxValue( maxXYWHVal );
1705
        imageXOffsetSpinBox->setValue(newLX);
335 Franz 1706
 
4821 cbradney 1707
        imageYOffsetSpinBox->setDecimals(decimals);
1708
        imageYOffsetSpinBox->setMaxValue( maxXYWHVal );
1709
        imageYOffsetSpinBox->setValue(newLY);
335 Franz 1710
 
1612 cbradney 1711
        dGap->setDecimals(decimals);
1194 fschmid 1712
        dGap->setMaxValue(newGM);
1713
        dGap->setValue(newG);
335 Franz 1714
 
1612 cbradney 1715
        DLeft->setDecimals(decimals);
335 Franz 1716
        DLeft->setMaxValue( 300 );
1717
        DLeft->setValue(newDL);
1718
 
1612 cbradney 1719
        DTop->setDecimals(decimals);
217 Franz 1720
        DTop->setMaxValue( 300 );
335 Franz 1721
        DTop->setValue(newDT);
1722
 
1612 cbradney 1723
        DBottom->setDecimals(decimals);
335 Franz 1724
        DBottom->setMaxValue( 300 );
1725
        DBottom->setValue(newDB);
1726
 
1612 cbradney 1727
        DRight->setDecimals(decimals);
217 Franz 1728
        DRight->setMaxValue( 300 );
335 Franz 1729
        DRight->setValue(newDR);
1730
 
3992 cbradney 1731
        RoundRect->setValues(-newRM, newRM, decimals, newRR);
4619 cbradney 1732
        Cpal->unitChange(oldRatio, Umrech, doc->unitIndex());
3 paul 1733
        HaveItem = tmp;
1734
}
1735
 
272 Franz 1736
void Mpalette::setLevel(uint l)
1737
{
1738
        QString tm;
1739
        LevelTxt->setText(tm.setNum(l));
1740
}
1741
 
80 Franz 1742
void Mpalette::setXY(double x, double y)
3 paul 1743
{
5781 cbradney 1744
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 1745
                return;
237 Franz 1746
        disconnect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
1747
        disconnect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
3 paul 1748
        bool tmp = HaveItem;
133 Franz 1749
        double inX, inY, b, h, r, dummy1, dummy2;
132 Franz 1750
        QWMatrix ma;
1751
        FPoint n;
1752
        if (HaveItem)
215 Franz 1753
        {
4847 cbradney 1754
                if (doc->m_Selection->isMultipleSelection())
132 Franz 1755
                {
5781 cbradney 1756
                        m_ScMW->view->getGroupRect(&dummy1, &dummy2, &b, &h);
133 Franz 1757
                        r = 0.0;
215 Franz 1758
                }
133 Franz 1759
                else
215 Franz 1760
                {
3934 cbradney 1761
                        b = CurItem->width();
1762
                        h = CurItem->height();
1763
                        r = CurItem->rotation();
132 Franz 1764
                }
215 Franz 1765
        }
132 Franz 1766
        else
215 Franz 1767
        {
132 Franz 1768
                b = 0.0;
1769
                h = 0.0;
1770
                r = 0.0;
215 Franz 1771
        }
3 paul 1772
        HaveItem = false;
132 Franz 1773
        ma.translate(x, y);
1774
        ma.rotate(r);
215 Franz 1775
        if (TopLeft->isChecked())
132 Franz 1776
                n = FPoint(0.0, 0.0);
1777
        if (TopRight->isChecked())
1778
                n = FPoint(b, 0.0);
215 Franz 1779
        if (Center->isChecked())
132 Franz 1780
                n = FPoint(b / 2.0, h / 2.0);
1781
        if (BottomLeft->isChecked())
1782
                n = FPoint(0.0, h);
1783
        if (BottomRight->isChecked())
1784
                n = FPoint(b, h);
1785
        inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
1786
        inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
456 fschmid 1787
        if (tmp)
1788
        {
2867 fschmid 1789
                inX -= doc->rulerXoffset;
1790
                inY -= doc->rulerYoffset;
1791
                if (doc->guidesSettings.rulerMode)
1792
                {
5087 subik 1793
                        inX -= doc->currentPage()->xOffset();
1794
                        inY -= doc->currentPage()->yOffset();
2867 fschmid 1795
                }
456 fschmid 1796
        }
1843 cbradney 1797
        Xpos->setValue(inX*Umrech);
1798
        Ypos->setValue(inY*Umrech);
132 Franz 1799
        if ((LMode) && (tmp))
3934 cbradney 1800
                setBH(CurItem->width(), CurItem->height());
3 paul 1801
        HaveItem = tmp;
237 Franz 1802
        connect(Xpos, SIGNAL(valueChanged(int)), this, SLOT(NewX()));
1803
        connect(Ypos, SIGNAL(valueChanged(int)), this, SLOT(NewY()));
3 paul 1804
}
1805
 
80 Franz 1806
void Mpalette::setBH(double x, double y)
3 paul 1807
{
5781 cbradney 1808
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 1809
                return;
3 paul 1810
        bool tmp = HaveItem;
1811
        HaveItem = false;
1812
        QWMatrix ma;
1813
        QPoint dp;
3625 avox 1814
        if ((LMode) && (CurItem->asLine()))
215 Franz 1815
        {
1843 cbradney 1816
                ma.translate(static_cast<double>(Xpos->value()) / Umrech, static_cast<double>(Ypos->value()) / Umrech);
150 Franz 1817
                ma.rotate(static_cast<double>(Rot->value())*(-1));
3 paul 1818
                dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
1843 cbradney 1819
                Width->setValue(dp.x()*Umrech);
1820
                Height->setValue(dp.y()*Umrech);
215 Franz 1821
        }
3 paul 1822
        else
215 Franz 1823
        {
1843 cbradney 1824
                RoundRect->setMaxValue(QMIN(x, y)/2*Umrech);
3992 cbradney 1825
                RoundRect->setMinValue(-QMIN(x, y)/2*Umrech);
1843 cbradney 1826
                Width->setValue(x*Umrech);
1827
                Height->setValue(y*Umrech);
215 Franz 1828
        }
3 paul 1829
        HaveItem = tmp;
1830
}
1831
 
80 Franz 1832
void Mpalette::setR(double r)
3 paul 1833
{
5781 cbradney 1834
        if (!m_ScMW || m_ScMW->ScriptRunning)
173 Franz 1835
                return;
3 paul 1836
        bool tmp = HaveItem;
80 Franz 1837
        double rr = r;
3