Subversion Repositories Scribus

Rev

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