Subversion Repositories Scribus

Rev

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