Subversion Repositories Scribus

Rev

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