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.
9
#include "propertiespalette.h"
11
#include <QButtonGroup>
13
#include <QCloseEvent>
16
#include <QFocusEvent>
18
#include <QGridLayout>
20
#include <QHBoxLayout>
27
#include <QMessageBox>
31
#include <QPushButton>
32
#include <QRadioButton>
34
#include <QSpacerItem>
36
#include <QStackedWidget>
40
#include <QVBoxLayout>
45
#define _USE_MATH_DEFINES
48
#include "arrowchooser.h"
50
#include "basepointwidget.h"
51
#include "commonstrings.h"
52
#include "colorlistbox.h"
53
#include "sccolorengine.h"
56
#include "pageitem_textframe.h"
57
#include "styles/paragraphstyle.h"
58
#include "sccombobox.h"
61
#include "scribuscore.h"
62
#include "scraction.h"
63
#include "scribusview.h"
64
#include "selection.h"
66
#include "styleselect.h"
67
#include "tabmanager.h"
69
#include "undomanager.h"
71
#include "util_icon.h"
72
#include "text/nlsconfig.h"
73
#include "dasheditor.h"
78
LineFormatValue::LineFormatValue() : m_Line(), m_doc(NULL), m_name() {};
80
LineFormatValue::LineFormatValue( const multiLine& line, ScribusDoc* doc, const QString name ) : m_Line(line), m_doc(doc), m_name(name) {};
82
LineFormatValue::LineFormatValue(const LineFormatValue& other)
84
m_name = other.m_name;
85
m_Line = other.m_Line;
89
LineFormatValue& LineFormatValue::operator= (const LineFormatValue& other)
91
m_name = other.m_name;
92
m_Line = other.m_Line;
98
void LineFormatItemDelegate::redraw(const QVariant& data) const
100
const LineFormatValue& item(data.value<LineFormatValue>());
102
pmap->fill(Qt::white);
105
for (int its = item.m_Line.size()-1; its > -1; its--)
107
const ScColor& col = item.m_doc->PageColors[item.m_Line[its].Color];
108
tmpf = ScColorEngine::getDisplayColor(col, item.m_doc, item.m_Line[its].Shade);
110
QVector<double> m_array;
111
if (item.m_Line[its].Dash == 1)
112
pen.setStyle(Qt::SolidLine);
115
getDashArray(item.m_Line[its].Dash, 1, m_array);
116
pen.setDashPattern(m_array);
119
pen.setWidth(qMax(static_cast<int>(item.m_Line[its].Width), 1));
120
pen.setCapStyle(static_cast<Qt::PenCapStyle>(item.m_Line[its].LineEnd));
121
pen.setJoinStyle(static_cast<Qt::PenJoinStyle>(item.m_Line[its].LineJoin));
123
p.drawLine(0, 18, 37, 18);
128
QString LineFormatItemDelegate::text(const QVariant& data) const
130
return data.toString();
133
NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
135
setObjectName("namewidget");
136
QRegExp rx( "\\w+" );
137
QValidator* validator = new QRegExpValidator( rx, this );
138
setValidator( validator );
141
void NameWidget::focusOutEvent(QFocusEvent *e)
144
QLineEdit::focusOutEvent(e);
147
PropertiesPalette::PropertiesPalette( QWidget* parent) : ScrPaletteBase( parent, "PropertiesPalette", false, 0)
155
tmpSelection = new Selection(this, false);
156
tmpSelection->clear();
157
setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
159
_userActionOn = false;
160
userActionSniffer = new UserActionSniffer(this);
161
connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(spinboxStartUserAction()));
162
connect(userActionSniffer, SIGNAL(actionEnd()), this, SLOT(spinboxFinishUserAction()));
164
MpalLayout = new QVBoxLayout( this );
165
MpalLayout->setMargin(5);
166
MpalLayout->setSpacing(1);
167
setOrientation(Qt::Vertical);
169
f.setPointSize(f.pointSize()-1);
172
TabStack = new QToolBox( this );
174
page = new QWidget( TabStack );
175
pageLayout = new QVBoxLayout( page );
176
pageLayout->setMargin(0);
177
pageLayout->setSpacing(5);
179
NameGroup = new QGroupBox( page );
180
NameGroupLayout = new QHBoxLayout( NameGroup );
181
NameGroupLayout->setMargin(5);
182
NameGroupLayout->setSpacing(4);
183
NameGroupLayout->setAlignment( Qt::AlignTop );
184
NameEdit = new NameWidget(NameGroup);
185
NameEdit->setFocusPolicy(Qt::ClickFocus);
186
NameGroupLayout->addWidget( NameEdit );
187
pageLayout->addWidget( NameGroup );
189
GeoGroup = new QGroupBox(page);
190
GeoGroupLayout = new QGridLayout( GeoGroup );
191
GeoGroupLayout->setMargin(5);
192
GeoGroupLayout->setSpacing(4);
193
GeoGroupLayout->setAlignment( Qt::AlignTop );
195
Xpos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
196
installSniffer(Xpos);
197
GeoGroupLayout->addWidget( Xpos, 0, 1 );
198
Ypos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
199
installSniffer(Ypos);
200
GeoGroupLayout->addWidget( Ypos, 1, 1 );
201
Width = new ScrSpinBox( GeoGroup, 0 );
202
installSniffer(Width);
203
GeoGroupLayout->addWidget( Width, 2, 1 );
204
Height = new ScrSpinBox( GeoGroup, 0 );
205
installSniffer(Height);
206
GeoGroupLayout->addWidget( Height, 3, 1 );
208
xposLabel = new QLabel( "&X-Pos:", GeoGroup );
209
xposLabel->setBuddy(Xpos);
210
GeoGroupLayout->addWidget( xposLabel, 0, 0 );
211
yposLabel = new QLabel( "&Y-Pos:", GeoGroup );
212
yposLabel->setBuddy(Ypos);
213
GeoGroupLayout->addWidget( yposLabel, 1, 0 );
214
widthLabel = new QLabel( "&Width:", GeoGroup );
215
widthLabel->setBuddy(Width);
216
GeoGroupLayout->addWidget( widthLabel, 2, 0 );
217
heightLabel = new QLabel( "&Height:", GeoGroup );
218
heightLabel->setBuddy(Height);
219
GeoGroupLayout->addWidget( heightLabel, 3, 0 );
221
keepFrameWHRatioButton = new LinkButton( GeoGroup );
222
keepFrameWHRatioButton->setCheckable( true );
223
keepFrameWHRatioButton->setAutoRaise( true );
224
keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
225
keepFrameWHRatioButton->setChecked(false);
226
GeoGroupLayout->addWidget( keepFrameWHRatioButton, 2, 2, 2, 1 );
227
Rotation = new ScrSpinBox( GeoGroup, 6);
228
Rotation->setWrapping( true );
229
installSniffer(Rotation);
230
rotationLabel = new QLabel( "&Rotation:", GeoGroup );
231
rotationLabel->setBuddy(Rotation);
232
GeoGroupLayout->addWidget( rotationLabel, 4, 0 );
233
GeoGroupLayout->addWidget( Rotation, 4, 1 );
234
basepointLabel = new QLabel( "Basepoint:", GeoGroup );
235
GeoGroupLayout->addWidget( basepointLabel, 5, 0 );
236
RotationGroup = new BasePointWidget(GeoGroup, 0);
237
/* RotationGroup = new QButtonGroup( GeoGroup );
238
Layout12 = new QGridLayout;
239
Layout12->setMargin(0);
240
Layout12->setSpacing(0);
241
TopLeft = new QRadioButton( GeoGroup );
242
RotationGroup->addButton(TopLeft, 0);
243
TopLeft->setText( "" );
244
TopLeft->setChecked( true );
245
TopLeft->setLayoutDirection(Qt::RightToLeft);
246
TopLeft->setMaximumSize( TopLeft->iconSize() );
247
Layout12->addWidget( TopLeft, 0, 0, Qt::AlignCenter );
248
Line1 = new QFrame( GeoGroup);
249
Line1->setMinimumSize( QSize( 20, 4 ) );
250
Line1->setMaximumSize( QSize( 20, 4 ) );
251
Line1->setFrameShape( QFrame::HLine );
252
Line1->setFrameShadow( QFrame::Plain );
253
Line1->setLineWidth( 3 );
254
Line1->setFrameShape( QFrame::HLine );
255
Layout12->addWidget( Line1, 0, 1, Qt::AlignCenter );
256
TopRight = new QRadioButton( GeoGroup );
257
RotationGroup->addButton(TopRight, 1);
258
TopRight->setText( "" );
259
TopRight->setMaximumSize( TopRight->iconSize() );
260
Layout12->addWidget( TopRight, 0, 2, Qt::AlignCenter );
261
Line2 = new QFrame( GeoGroup );
262
Line2->setMinimumSize( QSize( 4, 20 ) );
263
Line2->setMaximumSize( QSize( 4, 20 ) );
264
Line2->setFrameShape( QFrame::VLine );
265
Line2->setFrameShadow( QFrame::Plain );
266
Line2->setLineWidth( 3 );
267
Line2->setFrameShape( QFrame::VLine );
268
Layout12->addWidget( Line2, 1, 0, Qt::AlignCenter );
269
Center = new QRadioButton( GeoGroup );
270
RotationGroup->addButton(Center, 2);
271
Center->setText( "" );
272
Center->setMaximumSize( Center->iconSize() );
273
Layout12->addWidget( Center, 1, 1, Qt::AlignCenter );
274
Line4 = new QFrame( GeoGroup );
275
Line4->setMinimumSize( QSize( 4, 20 ) );
276
Line4->setMaximumSize( QSize( 4, 20 ) );
277
Line4->setFrameShadow( QFrame::Plain );
278
Line4->setLineWidth( 3 );
279
Line4->setFrameShape( QFrame::VLine );
280
Layout12->addWidget( Line4, 1, 2, Qt::AlignCenter );
281
BottomLeft = new QRadioButton( GeoGroup );
282
RotationGroup->addButton(BottomLeft, 3);
283
BottomLeft->setText( "" );
284
BottomLeft->setLayoutDirection(Qt::RightToLeft);
285
BottomLeft->setMaximumSize( BottomLeft->iconSize() );
286
Layout12->addWidget( BottomLeft, 2, 0, Qt::AlignCenter );
287
Line5 = new QFrame( GeoGroup );
288
Line5->setMinimumSize( QSize( 20, 4 ) );
289
Line5->setMaximumSize( QSize( 20, 4 ) );
290
Line5->setFrameShape( QFrame::HLine );
291
Line5->setFrameShadow( QFrame::Plain );
292
Line5->setLineWidth( 3 );
293
Line5->setFrameShape( QFrame::HLine );
294
Layout12->addWidget( Line5, 2, 1, Qt::AlignCenter );
295
BottomRight = new QRadioButton( GeoGroup );
296
RotationGroup->addButton(BottomRight, 4);
297
BottomRight->setText( "" );
298
BottomRight->setMaximumSize( BottomRight->iconSize() );
299
Layout12->addWidget( BottomRight, 2, 2, Qt::AlignCenter );
300
GeoGroupLayout->addLayout( Layout12, 5, 1, 1, 1, Qt::AlignLeft); */
301
GeoGroupLayout->addWidget( RotationGroup, 5, 1, 1, 1, Qt::AlignLeft);
302
pageLayout->addWidget( GeoGroup );
304
layout60 = new QHBoxLayout;
305
layout60->setMargin(0);
306
layout60->setSpacing(5);
308
LayerGroup = new QGroupBox( "Level", page );
309
LayerGroupLayout = new QGridLayout( LayerGroup );
310
LayerGroupLayout->setSpacing( 4 );
311
LayerGroupLayout->setMargin( 5 );
312
LayerGroupLayout->setAlignment( Qt::AlignTop );
313
Zup = new QToolButton( LayerGroup );
314
Zup->setMaximumSize( QSize( 22, 22 ) );
315
Zup->setIcon(QIcon(loadIcon("16/go-up.png")));
316
LayerGroupLayout->addWidget( Zup, 0, 0 );
317
ZDown = new QToolButton( LayerGroup );
318
ZDown->setMaximumSize( QSize( 22, 22 ) );
319
ZDown->setIcon(QIcon(loadIcon("16/go-down.png")));
320
LayerGroupLayout->addWidget( ZDown, 1, 0 );
321
ZTop = new QToolButton( LayerGroup );
322
ZTop->setMaximumSize( QSize( 22, 22 ) );
323
ZTop->setIcon(QIcon(loadIcon("16/go-top.png")));
324
LayerGroupLayout->addWidget( ZTop, 0, 1 );
325
ZBottom = new QToolButton( LayerGroup );
326
ZBottom->setMaximumSize( QSize( 22, 22 ) );
327
ZBottom->setIcon(QIcon(loadIcon("16/go-bottom.png")));
328
LayerGroupLayout->addWidget( ZBottom, 1, 1 );
329
LevelTxt = new QLabel( " ", LayerGroup );
330
LevelTxt->setAlignment( Qt::AlignCenter );
331
LayerGroupLayout->addWidget( LevelTxt, 0, 2, 2, 1 );
333
layout60->addWidget( LayerGroup );
334
QSpacerItem* spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
335
layout60->addItem( spacer2 );
337
Layout44 = new QGridLayout;
338
Layout44->setSpacing( 4 );
339
Layout44->setMargin( 5 );
341
DoGroup = new QToolButton( page );
342
DoGroup->setIcon(QIcon(loadIcon("group.png")));
343
Layout44->addWidget( DoGroup, 0, 0 );
344
DoUnGroup = new QToolButton( page );
345
DoUnGroup->setIcon(QIcon(loadIcon("ungroup.png")));
346
Layout44->addWidget( DoUnGroup, 1, 0 );
348
FlipH = new QToolButton( page );
349
FlipH->setIcon(QIcon(loadIcon("16/flip-object-horizontal.png")));
350
FlipH->setCheckable( true );
351
Layout44->addWidget( FlipH, 0, 1 );
352
FlipV = new QToolButton( page );
353
FlipV->setIcon(QIcon(loadIcon("16/flip-object-vertical.png")));
354
FlipV->setCheckable( true );
355
Layout44->addWidget( FlipV, 1, 1 );
356
Locked = new QToolButton( page );
357
Locked->setCheckable( true );
359
a.addPixmap(loadIcon("16/lock.png"), QIcon::Normal, QIcon::On);
360
a.addPixmap(loadIcon("16/lock-unlocked.png"), QIcon::Normal, QIcon::Off);
362
Layout44->addWidget( Locked, 0, 2 );
363
NoPrint = new QToolButton( page );
364
NoPrint->setCheckable( true );
366
a2.addPixmap(loadIcon("NoPrint.png"), QIcon::Normal, QIcon::On);
367
a2.addPixmap(loadIcon("16/document-print.png"), QIcon::Normal, QIcon::Off);
368
NoPrint->setIcon(a2);
369
Layout44->addWidget( NoPrint, 1, 2 );
370
NoResize = new QToolButton( page );
371
NoResize->setCheckable( true );
373
a3.addPixmap(loadIcon("framenoresize.png"), QIcon::Normal, QIcon::On);
374
a3.addPixmap(loadIcon("frameresize.png"), QIcon::Normal, QIcon::Off);
375
NoResize->setIcon(a3);
376
Layout44->addWidget( NoResize, 0, 3 );
377
layout60->addLayout( Layout44 );
379
pageLayout->addLayout( layout60 );
381
QSpacerItem* spacer13 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
382
pageLayout->addItem( spacer13 );
383
idXYZItem = TabStack->addItem( page, "X, Y, &Z" );
385
page_2 = new QWidget( TabStack );
386
pageLayout_2 = new QVBoxLayout( page_2 );
387
pageLayout_2->setSpacing( 5 );
388
pageLayout_2->setMargin( 0 );
390
ShapeGroup = new QGroupBox( page_2 );
391
ShapeGroupLayout = new QHBoxLayout( ShapeGroup );
392
ShapeGroupLayout->setSpacing( 2 );
393
ShapeGroupLayout->setMargin( 0 );
394
ShapeGroupLayout->setAlignment( Qt::AlignTop );
395
SRect = new QLabel( "Shape:", ShapeGroup );
396
ShapeGroupLayout->addWidget( SRect );
397
SCustom = new Autoforms( ShapeGroup );
398
ShapeGroupLayout->addWidget( SCustom );
400
EditShape = new QToolButton( ShapeGroup );
401
// EditShape->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5)));
402
ShapeGroupLayout->addWidget( EditShape );
403
pageLayout_2->addWidget( ShapeGroup );
405
Layout13 = new QHBoxLayout;
406
Layout13->setSpacing( 2 );
407
Layout13->setMargin( 0 );
409
RoundRect = new ScrSpinBox( page_2, 0 );
410
rndcornersLabel = new QLabel( "R&ound\nCorners:", page_2 );
411
rndcornersLabel->setBuddy(RoundRect);
412
Layout13->addWidget( rndcornersLabel );
413
Layout13->addWidget( RoundRect );
414
pageLayout_2->addLayout( Layout13 );
416
textFlowOptions = new QGroupBox( page_2 );
417
textFlowOptionsLayout = new QVBoxLayout( textFlowOptions );
418
textFlowOptionsLayout->setSpacing( 5 );
419
textFlowOptionsLayout->setMargin( 5 );
420
textFlowOptionsLayout->setAlignment( Qt::AlignTop );
421
textFlowDisabled = new QToolButton( textFlowOptions );
422
textFlowDisabled->setCheckable( true );
423
textFlowDisabled->setAutoExclusive(true);
424
textFlowDisabled->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
425
textFlowDisabled->setText( "Disabled" );
426
textFlowDisabled->setIcon(QIcon(loadIcon("flow-none.png")));
427
textFlowOptionsLayout->addWidget( textFlowDisabled );
428
textFlowUsesFrameShape = new QToolButton( textFlowOptions );
429
textFlowUsesFrameShape->setCheckable( true );
430
textFlowUsesFrameShape->setAutoExclusive(true);
431
textFlowUsesFrameShape->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
432
textFlowUsesFrameShape->setText( "Use &Frame Shape" );
433
textFlowUsesFrameShape->setIcon(QIcon(loadIcon("flow-frame.png")));
434
textFlowOptionsLayout->addWidget( textFlowUsesFrameShape );
435
textFlowUsesBoundingBox = new QToolButton( textFlowOptions );
436
textFlowUsesBoundingBox->setCheckable( true );
437
textFlowUsesBoundingBox->setAutoExclusive(true);
438
textFlowUsesBoundingBox->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
439
textFlowUsesBoundingBox->setText( "Use &Bounding Box" );
440
textFlowUsesBoundingBox->setIcon(QIcon(loadIcon("flow-bounding.png")));
441
textFlowOptionsLayout->addWidget( textFlowUsesBoundingBox );
442
textFlowUsesContourLine = new QToolButton( textFlowOptions );
443
textFlowUsesContourLine->setCheckable( true );
444
textFlowUsesContourLine->setAutoExclusive(true);
445
textFlowUsesContourLine->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
446
textFlowUsesContourLine->setText( "&Use Contour Line" );
447
textFlowUsesContourLine->setIcon(QIcon(loadIcon("flow-contour.png")));
448
textFlowOptionsLayout->addWidget( textFlowUsesContourLine );
449
textFlowUsesImageClipping = new QToolButton( textFlowOptions );
450
textFlowUsesImageClipping->setCheckable( true );
451
textFlowUsesImageClipping->setAutoExclusive(true);
452
textFlowUsesImageClipping->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
453
textFlowUsesImageClipping->setText( "Use Image Clip Path" );
454
textFlowUsesImageClipping->setIcon(QIcon(loadIcon("flow-contour.png")));
455
textFlowOptionsLayout->addWidget( textFlowUsesImageClipping );
456
pageLayout_2->addWidget( textFlowOptions );
457
textFlowDisabled->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
458
textFlowUsesFrameShape->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
459
textFlowUsesBoundingBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
460
textFlowUsesContourLine->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
461
textFlowUsesImageClipping->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
462
textFlowOptionsB = new QButtonGroup( page_2 );
463
textFlowOptionsB->addButton(textFlowDisabled, 0);
464
textFlowOptionsB->addButton(textFlowUsesFrameShape, 1);
465
textFlowOptionsB->addButton(textFlowUsesBoundingBox, 2);
466
textFlowOptionsB->addButton(textFlowUsesContourLine, 3);
467
textFlowOptionsB->addButton(textFlowUsesImageClipping, 4);
469
TabStack2 = new QStackedWidget( page_2 );
471
page_2a = new QWidget( TabStack2 );
472
/* pageLayout_2a = new QVBoxLayout( page_2a );
473
pageLayout_2a->setSpacing( 5 );
474
pageLayout_2a->setMargin( 0 );
475
Distance = new QGroupBox( page_2a );
476
DistanceLayout = new QGridLayout( Distance );
477
DistanceLayout->setSpacing( 2 );
478
DistanceLayout->setMargin( 5 );
479
DistanceLayout->setAlignment( Qt::AlignTop );
481
DCol = new QSpinBox(Distance );
482
DCol->setMaximum( 3000 );
483
DCol->setMinimum( 1 );
484
columnsLabel = new QLabel( "Colu&mns:", Distance );
485
columnsLabel->setBuddy(DCol);
486
DistanceLayout->addWidget( columnsLabel, 0, 0 );
487
DistanceLayout->addWidget( DCol, 0, 1 );
489
dGap = new ScrSpinBox( 0, 300, Distance, 0 );
490
colgapLabel = new ScComboBox( Distance );
491
DistanceLayout->addWidget( colgapLabel, 1, 0); //, Qt::AlignLeft );
492
DistanceLayout->addWidget( dGap, 1, 1 );
494
DTop = new ScrSpinBox( 0, 300, Distance, 0 );
495
topLabel = new QLabel( "To&p:", Distance );
496
topLabel->setBuddy(DTop);
497
DistanceLayout->addWidget( topLabel, 2, 0 );
498
DistanceLayout->addWidget( DTop, 2, 1 );
500
DBottom = new ScrSpinBox( 0, 300, Distance, 0 );
501
bottomLabel = new QLabel( "&Bottom:", Distance );
502
bottomLabel->setBuddy(DBottom);
503
DistanceLayout->addWidget( bottomLabel, 3, 0 );
504
DistanceLayout->addWidget( DBottom, 3, 1 );
506
DLeft = new ScrSpinBox( 0, 300, Distance, 0 );
507
leftLabel = new QLabel( "&Left:", Distance );
508
leftLabel->setBuddy(DLeft);
509
DistanceLayout->addWidget( leftLabel, 4, 0 );
510
DistanceLayout->addWidget( DLeft, 4, 1 );
512
DRight = new ScrSpinBox( 0, 300, Distance, 0 );
513
rightLabel = new QLabel( "&Right:", Distance );
514
rightLabel->setBuddy(DRight);
515
DistanceLayout->addWidget( rightLabel, 5, 0 );
516
DistanceLayout->addWidget( DRight, 5, 1 );
518
TabsButton = new QToolButton( Distance );
519
TabsButton->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
520
DistanceLayout->addWidget( TabsButton, 6, 0, 1, 2 );
521
pageLayout_2a->addWidget(Distance);
523
flopBox = new QGroupBox(tr("First Line Offset"), page_2a);
524
flopLayout = new QGridLayout(flopBox);
525
flopGroup = new QButtonGroup(flopBox);
526
flopRealHeight = new QRadioButton(tr("Maximum Ascent"), flopBox);
527
flopFontAscent = new QRadioButton(tr("Font Ascent"), flopBox);
528
flopLineSpacing = new QRadioButton(tr("Line Spacing"),flopBox);
529
flopGroup->addButton(flopRealHeight, 0);
530
flopGroup->addButton(flopFontAscent, 1);
531
flopGroup->addButton(flopLineSpacing, 2);
532
flopLayout->addWidget(flopRealHeight);
533
flopLayout->addWidget(flopFontAscent);
534
flopLayout->addWidget(flopLineSpacing);
535
flopRealHeight->setChecked(true);
536
pageLayout_2a->addWidget(flopBox); */
537
TabStack2->addWidget( page_2a );
539
/* page_2b = new QWidget( TabStack2 );
540
pageLayout_2b = new QVBoxLayout( page_2b );
541
pageLayout_2b->setSpacing( 5 );
542
pageLayout_2b->setMargin( 0 );
543
Distance2 = new QGroupBox( "Path Text Properties", page_2b );
544
DistanceLayout2 = new QGridLayout( Distance2 );
545
DistanceLayout2->setSpacing( 2 );
546
DistanceLayout2->setMargin( 5 );
547
DistanceLayout2->setAlignment( Qt::AlignTop );
549
pathTextType = new ScComboBox( Distance2 );
550
DistanceLayout2->addWidget( pathTextType, 0, 1);
551
pathTextTypeLabel = new QLabel( "Type:", Distance2 );
552
DistanceLayout2->addWidget( pathTextTypeLabel, 0, 0);
554
startoffsetLabel = new QLabel( "Start Offset:", Distance2 );
555
DistanceLayout2->addWidget( startoffsetLabel, 1, 0);
556
Dist = new ScrSpinBox( 0, 30000, Distance2, 0 );
557
Dist->setSingleStep(10);
558
DistanceLayout2->addWidget( Dist, 1, 1);
560
distfromcurveLabel = new QLabel( "Distance from Curve:", Distance2 );
561
DistanceLayout2->addWidget( distfromcurveLabel, 2, 0);
562
LineW = new ScrSpinBox( -300, 300, Distance2, 0 );
563
LineW->setSingleStep(10);
564
DistanceLayout2->addWidget( LineW, 2, 1);
566
flippedPathText = new QCheckBox( Distance2 );
567
flippedPathText->setText( "Flip Text" );
568
DistanceLayout2->addWidget( flippedPathText, 3, 0, 1, 2 );
570
showcurveCheckBox = new QCheckBox( Distance2 );
571
showcurveCheckBox->setText( "Show Curve" );
572
DistanceLayout2->addWidget( showcurveCheckBox, 4, 0, 1, 2 );
574
pageLayout_2b->addWidget(Distance2);
575
TabStack2->addWidget( page_2b );
577
page_2c = new QWidget( TabStack2 );
578
pageLayout_2c = new QVBoxLayout( page_2c );
579
pageLayout_2c->setSpacing( 5 );
580
pageLayout_2c->setMargin( 0 );
581
Distance3 = new QGroupBox( page_2c );
582
DistanceLayout3 = new QVBoxLayout( Distance3 );
583
DistanceLayout3->setSpacing( 2 );
584
DistanceLayout3->setMargin( 5 );
585
DistanceLayout3->setAlignment( Qt::AlignTop );
586
EvenOdd = new QRadioButton( "Even-Odd", Distance3 );
587
DistanceLayout3->addWidget( EvenOdd );
588
NonZero = new QRadioButton( "Non Zero", Distance3 );
589
DistanceLayout3->addWidget( NonZero );
590
EvenOdd->setChecked( true );
591
Distance3->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
592
pageLayout_2c->addWidget(Distance3);
593
TabStack2->addWidget( page_2c );
595
pageLayout_2->addWidget( TabStack2 );
597
QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
598
pageLayout_2->addItem( spacer6 );
599
idShapeItem = TabStack->addItem( page_2, "&Shape" );
601
page_group = new QWidget(TabStack);
602
page_group_layout = new QVBoxLayout( page_group );
603
page_group_layout->setSpacing( 5 );
604
page_group_layout->setMargin( 0 );
606
ShapeGroup2 = new QGroupBox( page_group );
607
ShapeGroupLayout2 = new QHBoxLayout( ShapeGroup2 );
608
ShapeGroupLayout2->setSpacing( 2 );
609
ShapeGroupLayout2->setMargin( 0 );
610
ShapeGroupLayout2->setAlignment( Qt::AlignTop );
611
SRect2 = new QLabel( "Shape:", ShapeGroup2 );
612
ShapeGroupLayout2->addWidget( SRect2 );
613
SCustom2 = new Autoforms( ShapeGroup2 );
614
ShapeGroupLayout2->addWidget( SCustom2 );
615
EditShape2 = new QToolButton( ShapeGroup2 );
616
// EditShape2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
617
ShapeGroupLayout2->addWidget( EditShape2 );
618
page_group_layout->addWidget( ShapeGroup2 );
620
textFlowOptions2 = new QGroupBox( page_group );
621
textFlowOptionsLayout2 = new QVBoxLayout( textFlowOptions2 );
622
textFlowOptionsLayout2->setSpacing( 5 );
623
textFlowOptionsLayout2->setMargin( 5 );
624
textFlowOptionsLayout2->setAlignment( Qt::AlignTop );
625
textFlowDisabled2 = new QToolButton( textFlowOptions2 );
626
textFlowDisabled2->setCheckable( true );
627
textFlowDisabled2->setAutoExclusive(true);
628
textFlowDisabled2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
629
textFlowDisabled2->setText( "Disabled" );
630
textFlowDisabled2->setIcon(QIcon(loadIcon("flow-none.png")));
631
textFlowOptionsLayout2->addWidget( textFlowDisabled2 );
632
textFlowUsesFrameShape2 = new QToolButton( textFlowOptions2 );
633
textFlowUsesFrameShape2->setCheckable( true );
634
textFlowUsesFrameShape2->setAutoExclusive(true);
635
textFlowUsesFrameShape2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
636
textFlowUsesFrameShape2->setText( "Use &Frame Shape" );
637
textFlowUsesFrameShape2->setIcon(QIcon(loadIcon("flow-frame.png")));
638
textFlowOptionsLayout2->addWidget( textFlowUsesFrameShape2 );
639
textFlowUsesBoundingBox2 = new QToolButton( textFlowOptions2 );
640
textFlowUsesBoundingBox2->setCheckable( true );
641
textFlowUsesBoundingBox2->setAutoExclusive(true);
642
textFlowUsesBoundingBox2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
643
textFlowUsesBoundingBox2->setText( "Use &Bounding Box" );
644
textFlowUsesBoundingBox2->setIcon(QIcon(loadIcon("flow-bounding.png")));
645
textFlowOptionsLayout2->addWidget( textFlowUsesBoundingBox2 );
646
textFlowUsesContourLine2 = new QToolButton( textFlowOptions2 );
647
textFlowUsesContourLine2->setCheckable( true );
648
textFlowUsesContourLine2->setAutoExclusive(true);
649
textFlowUsesContourLine2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
650
textFlowUsesContourLine2->setText( "&Use Contour Line" );
651
textFlowUsesContourLine2->setIcon(QIcon(loadIcon("flow-contour.png")));
652
textFlowOptionsLayout2->addWidget( textFlowUsesContourLine2 );
653
textFlowUsesImageClipping2 = new QToolButton( textFlowOptions2 );
654
textFlowUsesImageClipping2->setCheckable( true );
655
textFlowUsesImageClipping2->setAutoExclusive(true);
656
textFlowUsesImageClipping2->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
657
textFlowUsesImageClipping2->setText( "Use Image Clip Path" );
658
textFlowUsesImageClipping2->setIcon(QIcon(loadIcon("flow-contour.png")));
659
textFlowOptionsLayout2->addWidget( textFlowUsesImageClipping2 );
660
page_group_layout->addWidget( textFlowOptions2 );
661
textFlowDisabled2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
662
textFlowUsesFrameShape2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
663
textFlowUsesBoundingBox2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
664
textFlowUsesContourLine2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
665
textFlowUsesImageClipping2->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
666
textFlowOptionsB2 = new QButtonGroup( page_group );
667
textFlowOptionsB2->addButton(textFlowDisabled2, 0);
668
textFlowOptionsB2->addButton(textFlowUsesFrameShape2, 1);
669
textFlowOptionsB2->addButton(textFlowUsesBoundingBox2, 2);
670
textFlowOptionsB2->addButton(textFlowUsesContourLine2, 3);
671
textFlowOptionsB2->addButton(textFlowUsesImageClipping2, 4);
673
TransGroup = new QGroupBox( tr( "Transparency Settings" ), page_group );
674
Layout1t = new QGridLayout( TransGroup );
675
Layout1t->setAlignment( Qt::AlignTop );
676
Layout1t->setSpacing( 5 );
677
Layout1t->setMargin( 5 );
678
TransTxt = new QLabel( TransGroup );
679
Layout1t->addWidget( TransTxt, 0, 0 );
680
TransSpin = new QSpinBox( TransGroup );
681
TransSpin->setMinimum(0);
682
TransSpin->setMaximum(100);
683
TransSpin->setSingleStep(10);
684
TransSpin->setValue(100);
685
Layout1t->addWidget(TransSpin, 0, 1);
686
TransTxt2 = new QLabel( TransGroup );
687
Layout1t->addWidget( TransTxt2, 1, 0 );
688
blendMode = new ScComboBox( TransGroup );
689
Layout1t->addWidget( blendMode, 1, 1 );
690
page_group_layout->addWidget(TransGroup);
691
QSpacerItem* spacerTr2 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
692
page_group_layout->addItem( spacerTr2 );
693
idGroupItem = TabStack->addItem(page_group, "Groups");
695
page_3 = new QWidget( TabStack );
696
pageLayout_3 = new QVBoxLayout( page_3 );
697
pageLayout_3->setSpacing( 5 );
698
pageLayout_3->setMargin( 0 );
699
pageLayout_3->setAlignment( Qt::AlignLeft );
701
TextTree = new ScTreeWidget(page_3);
703
layout41 = new QGridLayout();
704
layout41->setSpacing( 3 );
705
layout41->setMargin( 3 );
706
layout41->setAlignment( Qt::AlignLeft );
707
Fonts = new FontComboH(page_3);
708
layout41->addWidget( Fonts, 0, 0, 1, 4 );
709
Size = new ScrSpinBox( 0.5, 2048, page_3, 0 );
710
Size->setPrefix( "" );
711
fontsizeLabel = new QLabel( "", page_3 );
712
fontsizeLabel->setPixmap(loadIcon("Zeichen.xpm"));
713
layout41->addWidget( fontsizeLabel, 1, 0 );
714
layout41->addWidget( Size, 1, 1 );
715
// lineSpacingPop = new QMenu();
716
// lineSpacingPop->addAction( tr("Fixed Linespacing"))->setCheckable(true);
717
// lineSpacingPop->addAction( tr("Automatic Linespacing"))->setCheckable(true);
718
// lineSpacingPop->addAction( tr("Align to Baseline Grid"))->setCheckable(true);
719
lineSpacingLabel = new QLabel( "", page_3 );
720
// lineSpacingLabel->setText("");
721
lineSpacingLabel->setPixmap(loadIcon("linespacing2.png"));
722
lineSpacingModeCombo = new QComboBox( page_3 );
723
// linespacingButton->setMenu(lineSpacingPop);
724
// linespacingButton->setPopupMode(QToolButton::DelayedPopup);
725
// linespacingButton->setAutoRaise(true);
726
LineSp = new ScrSpinBox( page_3, 0 );
727
layout41->addWidget( LineSp, 2, 2 );
728
layout41->addWidget( lineSpacingLabel, 2, 0 );
729
layout41->addWidget( lineSpacingModeCombo, 2, 1 );
730
Layout1AL = new QHBoxLayout;
731
Layout1AL->setSpacing( 0 );
732
Layout1AL->setMargin( 0 );
733
Layout1AL->setAlignment( Qt::AlignLeft );
734
GroupAlign = new AlignSelect(page_3);
735
Layout1AL->addWidget(GroupAlign);
736
QSpacerItem* spacer7AL = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
737
Layout1AL->addItem( spacer7AL );
738
layout41->addLayout( Layout1AL, 3, 0, 1, 4 );
739
pageLayout_3->addLayout( layout41 );
741
colorWidgets = new QFrame();
742
colorWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
743
colorWidgets->setLineWidth(1);
744
layout41c = new QGridLayout(colorWidgets);
745
layout41c->setSpacing( 3 );
746
layout41c->setMargin( 3 );
747
layout41c->setAlignment( Qt::AlignLeft );
748
layout23 = new QHBoxLayout;
749
layout23->setSpacing( 3 );
750
layout23->setMargin( 0 );
751
layout23->setAlignment( Qt::AlignLeft );
752
StrokeIcon = new QLabel( "", colorWidgets );
753
StrokeIcon->setPixmap(loadIcon("16/color-stroke.png"));
754
StrokeIcon->setScaledContents( false );
755
layout23->addWidget( StrokeIcon );
756
TxStroke = new ColorCombo( false, colorWidgets);
757
layout23->addWidget( TxStroke );
758
ShadeTxt1 = new QLabel( "", colorWidgets );
759
ShadeTxt1->setPixmap(loadIcon("shade.png"));
760
layout23->addWidget( ShadeTxt1 );
761
PM1 = new ShadeButton(colorWidgets);
762
layout23->addWidget( PM1 );
763
QSpacerItem* spacer7s = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
764
layout23->addItem( spacer7s );
765
layout41c->addLayout( layout23, 1, 0, 1, 4 );
766
layout24 = new QHBoxLayout;
767
layout24->setSpacing( 3 );
768
layout24->setMargin( 0 );
769
layout24->setAlignment( Qt::AlignLeft );
770
FillIcon = new QLabel( "", colorWidgets );
771
FillIcon->setPixmap(loadIcon("16/color-fill.png"));
772
layout24->addWidget( FillIcon );
773
TxFill = new ColorCombo( false, colorWidgets);
774
layout24->addWidget( TxFill );
775
ShadeTxt2 = new QLabel("", colorWidgets );
776
ShadeTxt2->setPixmap(loadIcon("shade.png"));
777
layout24->addWidget( ShadeTxt2 );
778
PM2 = new ShadeButton(colorWidgets);
779
layout24->addWidget( PM2 );
780
QSpacerItem* spacer7f = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
781
layout24->addItem( spacer7f );
782
layout41c->addLayout( layout24, 0, 0, 1, 4 );
783
Layout1 = new QHBoxLayout;
784
Layout1->setSpacing( 0 );
785
Layout1->setMargin( 0 );
786
Layout1->setAlignment( Qt::AlignLeft );
787
SeStyle = new StyleSelect(colorWidgets);
788
Layout1->addWidget(SeStyle);
789
Revert = new QToolButton( colorWidgets );
790
Revert->setMaximumSize( QSize( 22, 22 ) );
792
Revert->setIcon(loadIcon("Revers.png"));
793
Revert->setCheckable( true );
794
Layout1->addWidget( Revert );
795
QSpacerItem* spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
796
Layout1->addItem( spacer7 );
797
layout41c->addLayout( Layout1, 2, 0, 1, 4 );
798
colorWidgetsItem = TextTree->addWidget( tr("Color & Effects"), colorWidgets);
801
styleWidgets = new QFrame();
802
styleWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
803
styleWidgets->setLineWidth(1);
804
GroupBox3aLayout = new QGridLayout(styleWidgets);
805
GroupBox3aLayout->setSpacing( 3 );
806
GroupBox3aLayout->setMargin( 3 );
807
// GroupBox3aLayout->setAlignment( Qt::AlignLeft );
808
paraStyleCombo = new ParaStyleComboBox(styleWidgets);
809
paraStyleLabel = new QLabel( "Paragraph St&yle:", styleWidgets );
810
paraStyleLabel->setBuddy(paraStyleCombo);
811
paraStyleClear = new QToolButton( styleWidgets );
812
paraStyleClear->setMaximumSize( QSize( 22, 22 ) );
813
paraStyleClear->setText("");
814
paraStyleClear->setIcon(loadIcon("16/edit-clear.png"));
815
GroupBox3aLayout->addWidget( paraStyleLabel, 0, 0, 1, 2 );
816
GroupBox3aLayout->addWidget( paraStyleCombo, 1, 0 );
817
GroupBox3aLayout->addWidget( paraStyleClear, 1, 1 );
818
charStyleCombo = new CharStyleComboBox(styleWidgets);
819
charStyleLabel = new QLabel( "Character St&yle:", styleWidgets );
820
charStyleLabel->setBuddy(charStyleCombo);
821
charStyleClear = new QToolButton( styleWidgets );
822
charStyleClear->setMaximumSize( QSize( 22, 22 ) );
823
charStyleClear->setText("");
824
charStyleClear->setIcon(loadIcon("16/edit-clear.png"));
825
GroupBox3aLayout->addWidget( charStyleLabel, 2, 0, 1, 2 );
826
GroupBox3aLayout->addWidget( charStyleCombo, 3, 0 );
827
GroupBox3aLayout->addWidget( charStyleClear, 3, 1 );
829
styleWidgetsItem = TextTree->addWidget( tr("Style Settings"), styleWidgets);
831
flopBox = new QFrame();
832
flopBox->setFrameStyle(QFrame::Box | QFrame::Plain);
833
flopBox->setLineWidth(1);
834
flopLayout = new QGridLayout(flopBox);
835
flopGroup = new QButtonGroup(flopBox);
836
flopRealHeight = new QRadioButton(tr("Maximum Ascent"), flopBox);
837
flopFontAscent = new QRadioButton(tr("Font Ascent"), flopBox);
838
flopLineSpacing = new QRadioButton(tr("Line Spacing"),flopBox);
839
flopGroup->addButton(flopRealHeight, 0);
840
flopGroup->addButton(flopFontAscent, 1);
841
flopGroup->addButton(flopLineSpacing, 2);
842
flopLayout->addWidget(flopRealHeight);
843
flopLayout->addWidget(flopFontAscent);
844
flopLayout->addWidget(flopLineSpacing);
845
flopRealHeight->setChecked(true);
846
flopItem = TextTree->addWidget( tr("First Line Offset"), flopBox);
848
Distance = new QFrame();
849
Distance->setFrameStyle(QFrame::Box | QFrame::Plain);
850
Distance->setLineWidth(1);
851
DistanceLayout = new QGridLayout( Distance );
852
DistanceLayout->setSpacing( 2 );
853
DistanceLayout->setMargin( 5 );
854
DistanceLayout->setAlignment( Qt::AlignTop );
856
DCol = new QSpinBox(Distance );
857
DCol->setMaximum( 3000 );
858
DCol->setMinimum( 1 );
859
columnsLabel = new QLabel( "Colu&mns:", Distance );
860
columnsLabel->setBuddy(DCol);
861
DistanceLayout->addWidget( columnsLabel, 0, 0 );
862
DistanceLayout->addWidget( DCol, 0, 1 );
864
dGap = new ScrSpinBox( 0, 300, Distance, 0 );
865
colgapLabel = new ScComboBox( Distance );
866
DistanceLayout->addWidget( colgapLabel, 1, 0); //, Qt::AlignLeft );
867
DistanceLayout->addWidget( dGap, 1, 1 );
869
DTop = new ScrSpinBox( 0, 300, Distance, 0 );
870
topLabel = new QLabel( "To&p:", Distance );
871
topLabel->setBuddy(DTop);
872
DistanceLayout->addWidget( topLabel, 2, 0 );
873
DistanceLayout->addWidget( DTop, 2, 1 );
875
DBottom = new ScrSpinBox( 0, 300, Distance, 0 );
876
bottomLabel = new QLabel( "&Bottom:", Distance );
877
bottomLabel->setBuddy(DBottom);
878
DistanceLayout->addWidget( bottomLabel, 3, 0 );
879
DistanceLayout->addWidget( DBottom, 3, 1 );
881
DLeft = new ScrSpinBox( 0, 300, Distance, 0 );
882
leftLabel = new QLabel( "&Left:", Distance );
883
leftLabel->setBuddy(DLeft);
884
DistanceLayout->addWidget( leftLabel, 4, 0 );
885
DistanceLayout->addWidget( DLeft, 4, 1 );
887
DRight = new ScrSpinBox( 0, 300, Distance, 0 );
888
rightLabel = new QLabel( "&Right:", Distance );
889
rightLabel->setBuddy(DRight);
890
DistanceLayout->addWidget( rightLabel, 5, 0 );
891
DistanceLayout->addWidget( DRight, 5, 1 );
893
// optMarginCombo = new QComboBox(Distance);
894
// optMarginLabel = new QLabel( "Optical Margins:", Distance );
895
// optMarginLabel->setBuddy(optMarginCombo);
896
// DistanceLayout->addWidget( optMarginLabel, 6, 0 );
897
// DistanceLayout->addWidget( optMarginCombo, 6, 1 );
899
TabsButton = new QToolButton( Distance );
900
TabsButton->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
901
DistanceLayout->addWidget( TabsButton, 7, 0, 1, 2 );
902
DistanceItem = TextTree->addWidget( tr("Columns & Text Distances"), Distance);
907
OptMargins = new QFrame();
908
OptMargins->setFrameStyle(QFrame::Box | QFrame::Plain);
909
OptMargins->setLineWidth(1);
910
OptMarginsLayout = new QVBoxLayout( OptMargins );
911
OptMarginsLayout->setSpacing( 2 );
912
OptMarginsLayout->setMargin( 5 );
913
OptMarginsLayout->setAlignment( Qt::AlignTop );
915
// optMarginCombo = new QComboBox(OptMargins);
916
// OptMarginsLayout->addWidget( optMarginCombo);
918
// optMarginCheckLeftProtruding = new QCheckBox(OptMargins);
919
// optMarginCheckLeftProtruding->setObjectName(QString::fromUtf8("optMarginCheckLeftProtruding"));
920
optMarginRadioNone = new QRadioButton(OptMargins);
921
optMarginRadioNone->setObjectName(QString::fromUtf8("optMarginRadioNone"));
923
optMarginRadioBoth = new QRadioButton(OptMargins);
924
optMarginRadioBoth->setObjectName(QString::fromUtf8("optMarginRadioBoth"));
926
optMarginRadioLeft = new QRadioButton(OptMargins);
927
optMarginRadioLeft->setObjectName(QString::fromUtf8("optMarginRadioLeft"));
929
optMarginRadioRight = new QRadioButton(OptMargins);
930
optMarginRadioRight->setObjectName(QString::fromUtf8("optMarginRadioRight"));
932
optMarginResetButton = new QPushButton(OptMargins);
933
optMarginResetButton->setObjectName(QString::fromUtf8("optMarginResetButton"));
935
// optMarginCheckLeftProtruding->setText( tr("Left Protruding") );
936
optMarginRadioNone->setText( tr("None","optical margins") );
937
optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
938
optMarginRadioLeft->setText( tr("Left Only","optical margins") );
939
optMarginRadioRight->setText( tr("Right Only","optical margins") );
940
optMarginResetButton->setText( tr("Reset") );
942
// OptMarginsLayout->addWidget(optMarginCheckLeftProtruding);
943
OptMarginsLayout->addWidget(optMarginRadioNone);
944
OptMarginsLayout->addWidget(optMarginRadioBoth);
945
OptMarginsLayout->addWidget(optMarginRadioLeft);
946
OptMarginsLayout->addWidget(optMarginRadioRight);
947
OptMarginsLayout->addWidget(optMarginResetButton);
949
OptMarginsItem = TextTree->addWidget( tr("Optical Margins"), OptMargins);
953
//<<Advanced Settings
954
advancedWidgets = new QFrame();
955
advancedWidgets->setFrameStyle(QFrame::Box | QFrame::Plain);
956
advancedWidgets->setLineWidth(1);
957
layout41a = new QGridLayout(advancedWidgets);
958
layout41a->setSpacing( 3 );
959
layout41a->setMargin( 3 );
960
layout41a->setAlignment( Qt::AlignLeft );
961
ChBase = new ScrSpinBox( -100, 100, advancedWidgets, 0 );
962
ChBase->setValue( 0 );
963
ChBaseTxt = new QLabel("", advancedWidgets );
964
ChBaseTxt->setPixmap(loadIcon("textbase.png"));
965
layout41a->addWidget( ChBaseTxt, 0, 0 );
966
layout41a->addWidget( ChBase, 0, 1 );
967
Extra = new ScrSpinBox( advancedWidgets, 0 );
968
layout41a->addWidget( Extra, 0, 3 );
969
trackingLabel = new QLabel( "", advancedWidgets );
970
trackingLabel->setText("");
971
trackingLabel->setPixmap(loadIcon("textkern.png"));
972
layout41a->addWidget( trackingLabel, 0, 2 );
973
ChScale = new ScrSpinBox( 10, 400, advancedWidgets, 0 );
974
ChScale->setValue( 100 );
975
ScaleTxt = new QLabel("", advancedWidgets );
976
ScaleTxt->setPixmap(loadIcon("textscaleh.png"));
977
layout41a->addWidget( ScaleTxt, 1, 0 );
978
layout41a->addWidget( ChScale, 1 , 1 );
979
ChScaleV = new ScrSpinBox( 10, 400, advancedWidgets, 0 );
980
ChScaleV->setValue( 100 );
981
ScaleTxtV = new QLabel("", advancedWidgets );
982
ScaleTxtV->setPixmap(loadIcon("textscalev.png"));
983
layout41a->addWidget( ScaleTxtV, 1, 2 );
984
layout41a->addWidget( ChScaleV, 1, 3 );
986
wordTrackingLabel = new QLabel( "Word Spacing", advancedWidgets );
987
layout41a->addWidget( wordTrackingLabel, 2, 0, 1, 4 );
988
wordTrackingHLayout = new QHBoxLayout;
989
wordTrackingHLayout->setSpacing( 3 );
990
wordTrackingHLayout->setMargin( 0 );
991
wordTrackingHLayout->setAlignment(Qt::AlignLeft);
992
minWordTrackingSpinBox = new ScrSpinBox( 1, 200, advancedWidgets, 0 );
993
minWordTrackingLabel = new QLabel( "Min:", advancedWidgets );
994
minWordTrackingLabel->setBuddy(minWordTrackingSpinBox);
995
wordTrackingHLayout->addWidget(minWordTrackingLabel);
996
wordTrackingHLayout->addWidget(minWordTrackingSpinBox);
997
normWordTrackingSpinBox = new ScrSpinBox( 1, 200, advancedWidgets, 0 );
998
normWordTrackingLabel = new QLabel( "Norm:", advancedWidgets );
999
normWordTrackingLabel->setBuddy(normWordTrackingSpinBox);
1000
wordTrackingHLayout->addWidget(normWordTrackingLabel);
1001
wordTrackingHLayout->addWidget(normWordTrackingSpinBox);
1002
layout41a->addLayout(wordTrackingHLayout, 3, 0, 1, 4);
1004
glyphExtensionLabel = new QLabel( "Glyph Extension", advancedWidgets );
1005
layout41a->addWidget( glyphExtensionLabel, 4, 0, 1, 4 );
1006
glyphExtensionHLayout = new QHBoxLayout;
1007
glyphExtensionHLayout->setSpacing( 3 );
1008
glyphExtensionHLayout->setMargin( 0 );
1009
glyphExtensionHLayout->setAlignment(Qt::AlignLeft);
1010
minGlyphExtSpinBox = new ScrSpinBox( 90, 110, advancedWidgets, 0 );
1011
minGlyphExtensionLabel = new QLabel( "Min:", advancedWidgets );
1012
minGlyphExtensionLabel->setBuddy(minGlyphExtSpinBox);
1013
glyphExtensionHLayout->addWidget(minGlyphExtensionLabel);
1014
glyphExtensionHLayout->addWidget(minGlyphExtSpinBox);
1015
maxGlyphExtSpinBox = new ScrSpinBox( 90, 110, advancedWidgets, 0 );
1016
maxGlyphExtensionLabel = new QLabel( "Max:", advancedWidgets );
1017
maxGlyphExtensionLabel->setBuddy(maxGlyphExtSpinBox);
1018
glyphExtensionHLayout->addWidget(maxGlyphExtensionLabel);
1019
glyphExtensionHLayout->addWidget(maxGlyphExtSpinBox);
1020
layout41a->addLayout(glyphExtensionHLayout, 5, 0, 1, 4);
1022
advancedWidgetsItem = TextTree->addWidget( tr("Advanced Settings"), advancedWidgets);
1024
//>>Advanced Settings
1026
Distance2 = new QFrame();
1027
Distance2->setFrameStyle(QFrame::Box | QFrame::Plain);
1028
Distance2->setLineWidth(1);
1029
DistanceLayout2 = new QGridLayout( Distance2 );
1030
DistanceLayout2->setSpacing( 2 );
1031
DistanceLayout2->setMargin( 5 );
1032
DistanceLayout2->setAlignment( Qt::AlignTop );
1034
pathTextType = new ScComboBox( Distance2 );
1035
DistanceLayout2->addWidget( pathTextType, 0, 1);
1036
pathTextTypeLabel = new QLabel( "Type:", Distance2 );
1037
DistanceLayout2->addWidget( pathTextTypeLabel, 0, 0);
1039
startoffsetLabel = new QLabel( "Start Offset:", Distance2 );
1040
DistanceLayout2->addWidget( startoffsetLabel, 1, 0);
1041
Dist = new ScrSpinBox( 0, 30000, Distance2, 0 );
1042
Dist->setSingleStep(10);
1043
DistanceLayout2->addWidget( Dist, 1, 1);
1045
distfromcurveLabel = new QLabel( "Distance from Curve:", Distance2 );
1046
DistanceLayout2->addWidget( distfromcurveLabel, 2, 0);
1047
LineW = new ScrSpinBox( -300, 300, Distance2, 0 );
1048
LineW->setSingleStep(10);
1049
DistanceLayout2->addWidget( LineW, 2, 1);
1051
flippedPathText = new QCheckBox( Distance2 );
1052
flippedPathText->setText( "Flip Text" );
1053
DistanceLayout2->addWidget( flippedPathText, 3, 0, 1, 2 );
1055
showcurveCheckBox = new QCheckBox( Distance2 );
1056
showcurveCheckBox->setText( "Show Curve" );
1057
DistanceLayout2->addWidget( showcurveCheckBox, 4, 0, 1, 2 );
1058
Distance2Item = TextTree->addWidget( tr("Path Text Properties"), Distance2);
1060
pageLayout_3->addWidget(TextTree);
1062
layout47 = new QHBoxLayout;
1063
layout47->setSpacing( 5 );
1064
layout47->setMargin( 0 );
1066
layout46 = new QVBoxLayout;
1067
layout46->setSpacing( 5 );
1068
layout46->setMargin( 0 );
1070
layout41 = new QGridLayout;
1071
layout41->setSpacing( 5 );
1072
layout41->setMargin( 0 );
1073
layout41->setAlignment( Qt::AlignLeft );
1075
Fonts = new FontComboH(page_3);
1076
layout41->addWidget( Fonts, 0, 0, 1, 4 );
1078
Size = new ScrSpinBox( 0.5, 2048, page_3, 0 );
1079
Size->setPrefix( "" );
1080
fontsizeLabel = new QLabel( "", page_3 );
1081
fontsizeLabel->setPixmap(loadIcon("Zeichen.xpm"));
1082
layout41->addWidget( fontsizeLabel, 1, 0 );
1083
layout41->addWidget( Size, 1, 1 );
1084
ChBase = new ScrSpinBox( -100, 100, page_3, 0 );
1085
ChBase->setValue( 0 );
1086
ChBaseTxt = new QLabel("", page_3 );
1087
ChBaseTxt->setPixmap(loadIcon("textbase.png"));
1088
layout41->addWidget( ChBaseTxt, 1, 2 );
1089
layout41->addWidget( ChBase, 1, 3 );
1090
LineSp = new ScrSpinBox( page_3, 0 );
1091
layout41->addWidget( LineSp, 2, 1 );
1092
lineSpacingPop = new QMenu();
1093
lineSpacingPop->addAction( tr("Fixed Linespacing"))->setCheckable(true);
1094
lineSpacingPop->addAction( tr("Automatic Linespacing"))->setCheckable(true);
1095
lineSpacingPop->addAction( tr("Align to Baseline Grid"))->setCheckable(true);
1096
linespacingButton = new QToolButton(page_3 );
1097
linespacingButton->setText("");
1098
linespacingButton->setIcon(loadIcon("linespacing.png"));
1099
linespacingButton->setMenu(lineSpacingPop);
1100
linespacingButton->setPopupMode(QToolButton::DelayedPopup);
1101
linespacingButton->setAutoRaise(true);
1102
layout41->addWidget( linespacingButton, 2, 0 );
1103
Extra = new ScrSpinBox( page_3, 0 );
1104
layout41->addWidget( Extra, 2, 3 );
1105
trackingLabel = new QLabel( "", page_3 );
1106
trackingLabel->setText("");
1107
trackingLabel->setPixmap(loadIcon("textkern.png"));
1108
layout41->addWidget( trackingLabel, 2, 2 );
1109
ChScale = new ScrSpinBox( 10, 400, page_3, 0 );
1110
ChScale->setValue( 100 );
1111
ScaleTxt = new QLabel("", page_3 );
1112
ScaleTxt->setPixmap(loadIcon("textscaleh.png"));
1113
layout41->addWidget( ScaleTxt, 3, 0 );
1114
layout41->addWidget( ChScale, 3 , 1 );
1115
ChScaleV = new ScrSpinBox( 10, 400, page_3, 0 );
1116
ChScaleV->setValue( 100 );
1117
ScaleTxtV = new QLabel("", page_3 );
1118
ScaleTxtV->setPixmap(loadIcon("textscalev.png"));
1119
layout41->addWidget( ScaleTxtV, 3, 2 );
1120
layout41->addWidget( ChScaleV, 3, 3 );
1122
layout46->addLayout( layout41 );
1124
layout23 = new QHBoxLayout;
1125
layout23->setSpacing( 5 );
1126
layout23->setMargin( 0 );
1127
layout23->setAlignment( Qt::AlignLeft );
1128
StrokeIcon = new QLabel( "", page_3 );
1129
StrokeIcon->setPixmap(loadIcon("16/color-stroke.png"));
1130
StrokeIcon->setScaledContents( false );
1131
layout23->addWidget( StrokeIcon );
1132
TxStroke = new ColorCombo( false, page_3);
1133
layout23->addWidget( TxStroke );
1134
ShadeTxt1 = new QLabel( "", page_3 );
1135
ShadeTxt1->setPixmap(loadIcon("shade.png"));
1136
layout23->addWidget( ShadeTxt1 );
1137
PM1 = new ShadeButton(page_3);
1138
layout23->addWidget( PM1 );
1139
layout46->addLayout( layout23 );
1140
layout24 = new QHBoxLayout;
1141
layout24->setSpacing( 5 );
1142
layout24->setMargin( 0 );
1143
layout24->setAlignment( Qt::AlignLeft );
1144
FillIcon = new QLabel( "", page_3 );
1145
FillIcon->setPixmap(loadIcon("16/color-fill.png"));
1146
layout24->addWidget( FillIcon );
1147
TxFill = new ColorCombo( false, page_3);
1148
layout24->addWidget( TxFill );
1149
ShadeTxt2 = new QLabel("", page_3 );
1150
ShadeTxt2->setPixmap(loadIcon("shade.png"));
1151
layout24->addWidget( ShadeTxt2 );
1152
PM2 = new ShadeButton(page_3);
1153
layout24->addWidget( PM2 );
1154
layout46->addLayout( layout24 );
1156
Layout1 = new QHBoxLayout;
1157
Layout1->setSpacing( 0 );
1158
Layout1->setMargin( 0 );
1159
Layout1->setAlignment( Qt::AlignLeft );
1160
SeStyle = new StyleSelect(page_3);
1161
Layout1->addWidget(SeStyle);
1162
Revert = new QToolButton( page_3 );
1163
Revert->setMaximumSize( QSize( 22, 22 ) );
1164
Revert->setText("");
1165
Revert->setIcon(loadIcon("Revers.png"));
1166
Revert->setCheckable( true );
1167
Layout1->addWidget( Revert );
1168
QSpacerItem* spacer7 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
1169
Layout1->addItem( spacer7 );
1170
layout46->addLayout( Layout1 );
1171
layout47->addLayout( layout46 );
1172
pageLayout_3->addLayout( layout47 );
1174
Layout1AL = new QHBoxLayout;
1175
Layout1AL->setSpacing( 0 );
1176
Layout1AL->setMargin( 0 );
1177
Layout1AL->setAlignment( Qt::AlignLeft );
1178
GroupAlign = new AlignSelect(page_3);
1179
Layout1AL->addWidget(GroupAlign);
1180
QSpacerItem* spacer7AL = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
1181
Layout1AL->addItem( spacer7AL );
1182
pageLayout_3->addLayout( Layout1AL );
1184
GroupBox3aLayout->setSpacing( 5 );
1185
GroupBox3aLayout->setMargin( 0 );
1186
GroupBox3aLayout->setAlignment( Qt::AlignLeft );
1187
paraStyleCombo = new ParaStyleComboBox(page_3);
1188
paraStyleLabel = new QLabel( "Paragraph St&yle:", page_3 );
1189
paraStyleLabel->setBuddy(paraStyleCombo);
1190
paraStyleClear = new QToolButton( page_3 );
1191
paraStyleClear->setMaximumSize( QSize( 22, 22 ) );
1192
paraStyleClear->setText("");
1193
paraStyleClear->setIcon(loadIcon("16/edit-clear.png"));
1194
GroupBox3aLayout->addWidget( paraStyleLabel, 0, 0 );
1195
GroupBox3aLayout->addWidget( paraStyleCombo, 0, 1 );
1196
GroupBox3aLayout->addWidget( paraStyleClear, 0, 2 );
1197
charStyleCombo = new CharStyleComboBox(page_3);
1198
charStyleLabel = new QLabel( "Character St&yle:", page_3 );
1199
charStyleLabel->setBuddy(charStyleCombo);
1200
charStyleClear = new QToolButton( page_3 );
1201
charStyleClear->setMaximumSize( QSize( 22, 22 ) );
1202
charStyleClear->setText("");
1203
charStyleClear->setIcon(loadIcon("16/edit-clear.png"));
1204
GroupBox3aLayout->addWidget( charStyleLabel, 1, 0 );
1205
GroupBox3aLayout->addWidget( charStyleCombo, 1, 1 );
1206
GroupBox3aLayout->addWidget( charStyleClear, 1, 2 );
1207
optMarginCombo = new QComboBox(page_3);
1208
optMarginLabel = new QLabel( "Optical Margins:", page_3 );
1209
optMarginLabel->setBuddy(optMarginCombo);
1210
GroupBox3aLayout->addWidget( optMarginLabel, 2, 0 );
1211
GroupBox3aLayout->addWidget( optMarginCombo, 2, 1 );
1213
wordTrackingLabel = new QLabel( "Word Spacing", page_3 );
1214
GroupBox3aLayout->addWidget( wordTrackingLabel, 3, 0 );
1215
wordTrackingHLayout = new QHBoxLayout;
1216
wordTrackingHLayout->setSpacing( 5 );
1217
wordTrackingHLayout->setMargin( 0 );
1218
wordTrackingHLayout->setAlignment(Qt::AlignLeft);
1219
minWordTrackingSpinBox = new ScrSpinBox( 1, 200, page_3, 0 );
1220
minWordTrackingLabel = new QLabel( "Min:", page_3 );
1221
minWordTrackingLabel->setBuddy(minWordTrackingSpinBox);
1222
wordTrackingHLayout->addWidget(minWordTrackingLabel);
1223
wordTrackingHLayout->addWidget(minWordTrackingSpinBox);
1224
normWordTrackingSpinBox = new ScrSpinBox( 1, 200, page_3, 0 );
1225
normWordTrackingLabel = new QLabel( "Norm:", page_3 );
1226
normWordTrackingLabel->setBuddy(normWordTrackingSpinBox);
1227
wordTrackingHLayout->addWidget(normWordTrackingLabel);
1228
wordTrackingHLayout->addWidget(normWordTrackingSpinBox);
1229
GroupBox3aLayout->addLayout(wordTrackingHLayout, 4, 0, 1, 2);
1231
glyphExtensionLabel = new QLabel( "Glyph Extension", page_3 );
1232
GroupBox3aLayout->addWidget( glyphExtensionLabel, 5, 0 );
1233
glyphExtensionHLayout = new QHBoxLayout;
1234
glyphExtensionHLayout->setSpacing( 5 );
1235
glyphExtensionHLayout->setMargin( 0 );
1236
glyphExtensionHLayout->setAlignment(Qt::AlignLeft);
1237
minGlyphExtSpinBox = new ScrSpinBox( 90, 110, page_3, 0 );
1238
minGlyphExtensionLabel = new QLabel( "Min:", page_3 );
1239
minGlyphExtensionLabel->setBuddy(minGlyphExtSpinBox);
1240
glyphExtensionHLayout->addWidget(minGlyphExtensionLabel);
1241
glyphExtensionHLayout->addWidget(minGlyphExtSpinBox);
1242
maxGlyphExtSpinBox = new ScrSpinBox( 90, 110, page_3, 0 );
1243
maxGlyphExtensionLabel = new QLabel( "Max:", page_3 );
1244
maxGlyphExtensionLabel->setBuddy(maxGlyphExtSpinBox);
1245
glyphExtensionHLayout->addWidget(maxGlyphExtensionLabel);
1246
glyphExtensionHLayout->addWidget(maxGlyphExtSpinBox);
1247
GroupBox3aLayout->addLayout(glyphExtensionHLayout, 6, 0, 1, 2);
1249
/* langCombo = new ScComboBox( page_3 );
1250
langLabel = new QLabel( langCombo, "Lan&guage:", page_3, "langLabel" );
1251
GroupBox3aLayout->addWidget( langLabel, 1, 0 );
1252
GroupBox3aLayout->addWidget( langCombo, 1, 1 ); */
1253
// pageLayout_3->addLayout(GroupBox3aLayout);
1255
// QSpacerItem* spacer8 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
1256
// pageLayout_3->addItem( spacer8 );
1257
idTextItem=TabStack->addItem( page_3, "&Text" );
1259
page_4 = new QWidget( TabStack );
1260
pageLayout_4 = new QVBoxLayout( page_4 );
1261
pageLayout_4->setSpacing( 5 );
1262
pageLayout_4->setMargin( 0 );
1264
imagePageNumberSelector = new QGridLayout();
1265
imagePageNumberSelector->setSpacing( 5 );
1266
imagePageNumberSelector->setMargin( 0 );
1267
imagePageNumber = new QSpinBox( page_4 );
1268
imagePageNumber->setMinimum(0);
1269
imagePageNumber->setSpecialValueText(tr( "Auto" ));
1270
imagePageNumberLabel = new QLabel( "&Page Number:", page_4 );
1271
imagePageNumberLabel->setBuddy(imagePageNumber);
1272
imagePageNumberSelector->addWidget( imagePageNumberLabel, 0, 0 );
1273
imagePageNumberSelector->addWidget( imagePageNumber, 0, 1);
1274
pageLayout_4->addLayout( imagePageNumberSelector );
1276
FreeScale = new QRadioButton( "&Free Scaling", page_4 );
1277
FreeScale->setChecked( true );
1278
pageLayout_4->addWidget( FreeScale );
1280
layout43 = new QGridLayout;
1281
layout43->setSpacing( 5 );
1282
layout43->setMargin( 0 );
1283
imageXOffsetSpinBox = new ScrSpinBox( page_4, 0 );
1284
installSniffer(imageXOffsetSpinBox);
1285
xposImgLabel = new QLabel( "&X-Pos:", page_4 );
1286
xposImgLabel->setBuddy(imageXOffsetSpinBox);
1287
layout43->addWidget( xposImgLabel, 0, 0 );
1288
layout43->addWidget( imageXOffsetSpinBox, 0, 1 );
1289
imageYOffsetSpinBox = new ScrSpinBox( page_4, 0 );
1290
installSniffer(imageYOffsetSpinBox);
1291
yposImgLabel = new QLabel( "&Y-Pos:", page_4 );
1292
yposImgLabel->setBuddy(imageYOffsetSpinBox);
1293
layout43->addWidget( yposImgLabel, 1, 0 );
1294
layout43->addWidget( imageYOffsetSpinBox, 1, 1 );
1295
imageXScaleSpinBox = new ScrSpinBox( page_4, 0 );
1296
installSniffer(imageXScaleSpinBox);
1297
xscaleLabel = new QLabel( "X-Sc&ale:", page_4 );
1298
xscaleLabel->setBuddy(imageXScaleSpinBox);
1299
layout43->addWidget( xscaleLabel, 2, 0 );
1300
layout43->addWidget( imageXScaleSpinBox, 2, 1 );
1301
imageYScaleSpinBox = new ScrSpinBox( page_4, 0 );
1302
installSniffer(imageYScaleSpinBox);
1303
yscaleLabel = new QLabel( "Y-Scal&e:", page_4 );
1304
yscaleLabel->setBuddy(imageYScaleSpinBox);
1305
layout43->addWidget( yscaleLabel, 3, 0 );
1306
layout43->addWidget( imageYScaleSpinBox, 3, 1 );
1307
keepImageWHRatioButton = new LinkButton( page_4 );
1308
keepImageWHRatioButton->setCheckable( true );
1309
keepImageWHRatioButton->setAutoRaise( true );
1310
keepImageWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
1311
layout43->addWidget( keepImageWHRatioButton, 2, 2, 2, 1 );
1312
imgDpiX = new ScrSpinBox( page_4, 0 );
1313
installSniffer(imgDpiX);
1314
imgDPIXLabel = new QLabel( "Actual X-DPI:", page_4 );
1315
imgDPIXLabel->setBuddy(imgDpiX);
1316
layout43->addWidget( imgDPIXLabel, 4, 0 );
1317
layout43->addWidget( imgDpiX, 4, 1 );
1318
imgDpiY = new ScrSpinBox( page_4, 0 );
1319
installSniffer(imgDpiY);
1320
imgDPIYLabel = new QLabel( "Actual Y-DPI:", page_4 );
1321
imgDPIYLabel->setBuddy(imgDpiY);
1322
layout43->addWidget( imgDPIYLabel, 5, 0 );
1323
layout43->addWidget( imgDpiY, 5, 1 );
1324
keepImageDPIRatioButton = new LinkButton( page_4 );
1325
keepImageDPIRatioButton->setCheckable( true );
1326
keepImageDPIRatioButton->setAutoRaise( true );
1327
keepImageDPIRatioButton->setMaximumSize( QSize( 15, 32767 ) );
1328
layout43->addWidget( keepImageDPIRatioButton, 4, 2, 2, 1 );
1329
pageLayout_4->addLayout( layout43 );
1331
Layout24 = new QVBoxLayout;
1332
Layout24->setSpacing( 3 );
1333
Layout24->setMargin( 0 );
1335
FrameScale = new QRadioButton( page_4 );
1336
FrameScale->setText( "Scale &To Frame Size" );
1337
Layout24->addWidget( FrameScale );
1339
Layout18 = new QHBoxLayout;
1340
Layout18->setSpacing( 5 );
1341
Layout18->setMargin( 0 );
1343
Frame4 = new QFrame( page_4 );
1344
Frame4->setMinimumSize( QSize( 15, 2 ) );
1345
Frame4->setMaximumSize( QSize( 15, 10 ) );
1346
Frame4->setFrameShape( QFrame::NoFrame );
1347
Frame4->setFrameShadow( QFrame::Plain );
1348
Layout18->addWidget( Frame4 );
1350
Aspect = new QCheckBox( page_4 );
1351
Aspect->setEnabled( false );
1352
Aspect->setText( "P&roportional" );
1353
Aspect->setChecked( true );
1355
Layout18->addWidget( Aspect );
1356
Layout24->addLayout( Layout18 );
1357
pageLayout_4->addLayout( Layout24 );
1359
EditEffects = new QToolButton( page_4);
1360
pageLayout_4->addWidget( EditEffects );
1362
EditPSDProps = new QToolButton( page_4);
1363
pageLayout_4->addWidget( EditPSDProps );
1365
GroupBoxCM = new QFrame( page_4 );
1366
GroupBoxCM->setFrameShape( QFrame::NoFrame );
1367
GroupBoxCM->setFrameShadow( QFrame::Plain );
1368
GroupBoxCMLayout = new QVBoxLayout( GroupBoxCM );
1369
GroupBoxCMLayout->setSpacing( 2 );
1370
GroupBoxCMLayout->setMargin( 5 );
1371
GroupBoxCMLayout->setAlignment( Qt::AlignTop );
1372
TextCms1 = new QLabel( GroupBoxCM );
1373
GroupBoxCMLayout->addWidget( TextCms1 );
1374
InputP = new ScComboBox( GroupBoxCM );
1375
GroupBoxCMLayout->addWidget(InputP);
1376
TextCms2 = new QLabel( GroupBoxCM );
1377
GroupBoxCMLayout->addWidget(TextCms2);
1378
MonitorI = new ScComboBox( GroupBoxCM );
1379
GroupBoxCMLayout->addWidget(MonitorI);
1380
pageLayout_4->addWidget(GroupBoxCM);
1382
QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
1383
pageLayout_4->addItem( spacer9 );
1384
idImageItem=TabStack->addItem( page_4, "&Image" );
1386
page_5 = new QWidget( TabStack );
1387
pageLayout_5 = new QVBoxLayout( page_5 );
1388
pageLayout_5->setSpacing( 5 );
1389
pageLayout_5->setMargin( 0 );
1393
Layout12_2 = new QGridLayout;
1394
Layout12_2->setSpacing( 3 );
1395
Layout12_2->setMargin( 0 );
1396
LStyle = new LineCombo(page_5);
1397
LStyle->addItem( tr("Custom"));
1398
LineMode = new ScComboBox( page_5 );
1399
LineModeT = new QLabel( "&Basepoint:", page_5 );
1400
LineModeT->setBuddy(LineMode);
1401
Layout12_2->addWidget( LineModeT, 0, 0 );
1402
Layout12_2->addWidget( LineMode, 0, 1 );
1403
linetypeLabel = new QLabel( "T&ype of Line:", page_5 );
1404
linetypeLabel->setBuddy(LStyle);
1405
Layout12_2->addWidget( linetypeLabel, 1, 0 );
1406
Layout12_2->addWidget( LStyle, 1, 1 );
1408
dashEditor = new DashEditor(page_5);
1409
Layout12_2->addWidget(dashEditor, 2, 0, 1, 2);
1411
startArrow = new ArrowChooser(page_5, true);
1412
Layout12_2->addWidget( startArrow, 4, 0 );
1413
endArrow = new ArrowChooser(page_5, false);
1414
Layout12_2->addWidget( endArrow, 4, 1 );
1415
startArrowText = new QLabel( "Start Arrow:", page_5 );
1416
startArrowText->setBuddy(startArrow);
1417
Layout12_2->addWidget( startArrowText, 3, 0 );
1418
endArrowText = new QLabel( "End Arrow:", page_5 );
1419
endArrowText->setBuddy(endArrow);
1420
Layout12_2->addWidget( endArrowText, 3, 1 );
1421
LSize = new ScrSpinBox( page_5, 0 );
1422
linewidthLabel = new QLabel( "Line &Width:", page_5 );
1423
linewidthLabel->setBuddy(LSize);
1424
Layout12_2->addWidget( linewidthLabel, 5, 0 );
1425
Layout12_2->addWidget( LSize, 5, 1 );
1426
LJoinStyle = new ScComboBox( page_5 );
1427
edgesLabel = new QLabel( "Ed&ges:", page_5 );
1428
edgesLabel->setBuddy(LJoinStyle);
1429
Layout12_2->addWidget( edgesLabel, 6, 0 );
1430
Layout12_2->addWidget( LJoinStyle, 6, 1 );
1431
LEndStyle = new ScComboBox( page_5 );
1432
endingsLabel = new QLabel( "&Endings:", page_5 );
1433
endingsLabel->setBuddy(LEndStyle);
1434
Layout12_2->addWidget( endingsLabel, 7, 0 );
1435
Layout12_2->addWidget( LEndStyle, 7, 1 );
1436
pageLayout_5->addLayout( Layout12_2 );
1438
TabStack3 = new QStackedWidget( page_5 );
1439
TabStack3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
1441
page_5a = new QWidget( TabStack3 );
1442
pageLayout_5a = new QVBoxLayout( page_5a );
1443
pageLayout_5a->setSpacing( 5 );
1444
pageLayout_5a->setMargin( 0 );
1445
StyledLine = new QListWidget(page_5a);
1446
StyledLine->setItemDelegate(new LineFormatItemDelegate);
1447
StyledLine->addItem( "No Style" );
1448
pageLayout_5a->addWidget(StyledLine);
1449
TabStack3->addWidget( page_5a );
1451
page_5b = new QWidget( TabStack3 );
1452
pageLayout_5b = new QVBoxLayout( page_5b );
1453
pageLayout_5b->setSpacing( 5 );
1454
pageLayout_5b->setMargin( 0 );
1455
TLines = new QGroupBox( "Cell Lines", page_5b );
1456
TLineLayout = new QVBoxLayout( TLines );
1457
TLineLayout->setSpacing( 2 );
1458
TLineLayout->setMargin( 5 );
1459
TLineLayout->setAlignment( Qt::AlignTop );
1460
TopLine = new QCheckBox( TLines );
1461
TopLine->setText( "Line at Top" );
1462
TLineLayout->addWidget(TopLine);
1463
LeftLine = new QCheckBox( TLines );
1464
LeftLine->setText( "Line at the Left" );
1465
TLineLayout->addWidget(LeftLine);
1466
RightLine = new QCheckBox( TLines );
1467
RightLine->setText( "Line at the Right " );
1468
TLineLayout->addWidget(RightLine);
1469
BottomLine = new QCheckBox( TLines );
1470
BottomLine->setText( "Line at Bottom" );
1471
TLineLayout->addWidget(BottomLine);
1472
pageLayout_5b->addWidget(TLines);
1473
TabStack3->addWidget( page_5b );
1474
pageLayout_5->addWidget( TabStack3 );
1475
idLineItem=TabStack->addItem( page_5, "&Line" );
1477
page_6 = new QWidget( TabStack );
1478
pageLayout_6 = new QVBoxLayout( page_6 );
1479
pageLayout_6->setSpacing( 5 );
1480
pageLayout_6->setMargin( 0 );
1482
Cpal = new Cpalette(page_6);
1483
pageLayout_6->addWidget( Cpal );
1485
OverP = new QGroupBox( "Overprinting", page_6 );
1486
OverPLayout = new QVBoxLayout( OverP );
1487
OverPLayout->setSpacing( 2 );
1488
OverPLayout->setMargin( 5 );
1489
OverPLayout->setAlignment( Qt::AlignTop );
1490
KnockOut = new QRadioButton( "Knockout", OverP );
1491
OverPLayout->addWidget( KnockOut );
1492
Overprint = new QRadioButton( "Overprint", OverP );
1493
OverPLayout->addWidget( Overprint );
1494
KnockOut->setChecked( true );
1495
pageLayout_6->addWidget(OverP);
1497
idColorsItem = TabStack->addItem(page_6, "&Colors" );
1498
MpalLayout->addWidget( TabStack );
1502
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
1503
connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
1504
connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
1505
connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
1506
connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
1507
connect(RoundRect, SIGNAL(valueChanged(double)), this, SLOT(NewCornerRadius()));
1508
connect(LineSp, SIGNAL(valueChanged(double)), this, SLOT(NewLineSpacing()));
1509
connect(Size, SIGNAL(valueChanged(double)), this, SLOT(NewSize()));
1510
connect(Extra, SIGNAL(valueChanged(double)), this, SLOT(NewTracking()));
1511
connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
1512
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
1513
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
1514
connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
1515
connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
1516
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
1517
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
1518
connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
1519
connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
1520
connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
1521
connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
1522
connect(LineMode, SIGNAL(activated(int)), this, SLOT(NewLineMode()));
1523
connect(dashEditor, SIGNAL(dashChanged()), this, SLOT(dashChange()));
1524
connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
1525
connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
1526
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
1527
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
1528
connect(GroupAlign, SIGNAL(State(int)), this, SLOT(NewAlignement(int)));
1529
connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
1530
connect(charStyleClear, SIGNAL(clicked()), this, SLOT(doClearCStyle()));
1531
connect(paraStyleClear, SIGNAL(clicked()), this, SLOT(doClearPStyle()));
1532
connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
1533
connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
1534
connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
1535
connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
1536
connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
1537
connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
1538
connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
1539
connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
1540
connect(FreeScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
1541
connect(FrameScale, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
1542
connect(Aspect, SIGNAL(clicked()), this, SLOT(ChangeScaling()));
1543
connect(EditEffects, SIGNAL(clicked()), this, SLOT(handleImageEffects()));
1544
connect(EditPSDProps, SIGNAL(clicked()), this, SLOT(handleExtImgProperties()));
1545
connect(Zup, SIGNAL(clicked()), this, SLOT(DoRaise()));
1546
connect(ZDown, SIGNAL(clicked()), this, SLOT(DoLower()));
1547
connect(ZTop, SIGNAL(clicked()), this, SLOT(DoFront()));
1548
connect(ZBottom, SIGNAL(clicked()), this, SLOT(DoBack()));
1549
connect(RotationGroup, SIGNAL(buttonClicked(int)), this, SLOT(NewRotMode(int)));
1550
connect(textFlowOptionsB , SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
1551
connect(textFlowOptionsB2, SIGNAL(buttonClicked(int)), this, SLOT(DoFlow()));
1553
connect(SCustom, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
1554
connect(EditShape, SIGNAL(clicked()), this, SLOT(handleShapeEdit()));
1555
connect(SCustom2, SIGNAL(FormSel(int, int, qreal *)), this, SLOT(MakeIrre(int, int, qreal *)));
1556
connect(EditShape2, SIGNAL(clicked()), this, SLOT(handleShapeEdit2()));
1557
connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
1558
connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
1559
connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
1560
connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
1561
connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
1562
connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
1563
connect(flopGroup, SIGNAL(buttonClicked( int )), this, SLOT(flop(int)));
1564
connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
1565
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
1566
connect(Fonts, SIGNAL(fontSelected(QString )), this, SLOT(NewTFont(QString)));
1567
connect(TxFill, SIGNAL(activated(int)), this, SLOT(newTxtFill()));
1568
connect(TxStroke, SIGNAL(activated(int)), this, SLOT(newTxtStroke()));
1569
connect(PM1, SIGNAL(clicked()), this, SLOT(setActShade()));
1570
connect(PM2, SIGNAL(clicked()), this, SLOT(setActShade()));
1571
connect(ChScale, SIGNAL(valueChanged(double)), this, SLOT(NewTScale()));
1572
connect(ChScaleV, SIGNAL(valueChanged(double)), this, SLOT(NewTScaleV()));
1573
connect(ChBase, SIGNAL(valueChanged(double)), this, SLOT(NewTBase()));
1574
connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
1575
connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
1576
connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
1577
connect(showcurveCheckBox, SIGNAL(clicked()), this, SLOT(handlePathLine()));
1578
connect(pathTextType, SIGNAL(activated(int)), this, SLOT(handlePathType()));
1579
connect(flippedPathText, SIGNAL(clicked()), this, SLOT(handlePathFlip()));
1580
connect(Dist, SIGNAL(valueChanged(double)), this, SLOT(handlePathDist()));
1581
connect(LineW, SIGNAL(valueChanged(double)), this, SLOT(handlePathOffs()));
1582
connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
1583
connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
1584
connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
1585
// connect(langCombo, SIGNAL(activated(int)), this, SLOT(NewLanguage()));
1586
connect( TabsButton, SIGNAL( clicked() ), this, SLOT( ManageTabs() ) );
1587
connect( TopLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
1588
connect( LeftLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
1589
connect( RightLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
1590
connect( BottomLine, SIGNAL( clicked() ), this, SLOT( HandleTLines() ) );
1591
// connect( colgapLabel, SIGNAL( clicked() ), this, SLOT( HandleGapSwitch() ) );
1592
connect(colgapLabel, SIGNAL(activated(int)), this, SLOT(HandleGapSwitch()));
1593
connect( Cpal, SIGNAL(NewSpecial(double, double, double, double )), this, SLOT(NewSpGradient(double, double, double, double )));
1594
connect( Cpal, SIGNAL(editGradient()), this, SLOT(toggleGradientEdit()));
1595
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
1596
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
1597
// connect(lineSpacingPop, SIGNAL(triggered(QAction *)), this, SLOT(setLspMode(QAction *)));
1598
connect(lineSpacingModeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setLineSpacingMode(int)));
1599
connect( EvenOdd, SIGNAL( clicked() ), this, SLOT(handleFillRule() ) );
1600
connect( NonZero, SIGNAL( clicked() ), this, SLOT( handleFillRule() ) );
1601
connect( KnockOut, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
1602
connect( Overprint, SIGNAL( clicked() ), this, SLOT( handleOverprint() ) );
1603
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
1604
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
1605
connect(DoGroup, SIGNAL(clicked()), this, SLOT(doGrouping()) );
1606
// connect(optMarginCombo, SIGNAL(activated(int)), this, SLOT(setOpticalMargins(int)) );
1607
// connect(optMarginCheckLeftProtruding, SIGNAL(stateChanged(int)), this, SLOT(setOpticalMargins(int)) );
1608
connect(optMarginRadioNone, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1609
connect(optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1610
connect(optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1611
connect(optMarginRadioRight, SIGNAL(clicked()), this, SLOT(setOpticalMargins()) );
1612
connect(optMarginResetButton, SIGNAL(clicked()), this, SLOT(resetOpticalMargins()) );
1615
connect(minWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMinWordTracking()) );
1616
connect(normWordTrackingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setNormWordTracking()) );
1617
connect(minGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMinGlyphExtension()) );
1618
connect(maxGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMaxGlyphExtension()) );
1624
Height->setValue(0);
1625
Rotation->setValue(0);
1626
RoundRect->setValue(0);
1627
TabStack3->setCurrentIndex(0);
1628
TabStack2->setCurrentIndex(0);
1629
for (int ws = 1; ws < 7; ++ws)
1630
TabStack->setItemEnabled(ws, false);
1631
TabStack->setCurrentIndex(0);
1632
TabStack->widget(0)->setEnabled(false);
1633
TabStack->setItemEnabled(0, false);
1634
StrokeIcon->setEnabled(false);
1635
TxStroke->setEnabled(false);
1636
PM1->setEnabled(false);
1637
colgapLabel->setCurrentIndex(0);
1640
void PropertiesPalette::closeEvent(QCloseEvent *closeEvent)
1642
if (m_ScMW && !m_ScMW->scriptIsRunning())
1644
if ((HaveDoc) && (HaveItem))
1646
if (Cpal->gradEditButton->isChecked())
1648
m_ScMW->view->requestMode(modeNormal);
1649
m_ScMW->view->RefreshGradient(CurItem);
1653
ScrPaletteBase::closeEvent(closeEvent);
1656
void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
1659
QPoint p1 = mapToGlobal(pos());
1660
QPoint p2 = m_ScMW->mapFromGlobal(p1);
1661
//Qt4 reparent(m_ScMW, this->getWFlags(), p2);
1665
connect(this, SIGNAL(DocChanged()), m_ScMW, SLOT(slotDocCh()));
1666
// connect(this, SIGNAL(NewParStyle(int)), m_ScMW, SLOT(setNewParStyle(int)));
1667
connect(this, SIGNAL(NewAlignment(int)), m_ScMW, SLOT(setNewAlignment(int)));
1668
connect(this, SIGNAL(NewEffects(int)), m_ScMW, SLOT(setItemHoch(int)));
1669
// connect(this, SIGNAL(ShapeEdit()), m_ScMW, SLOT(ToggleFrameEdit()));
1670
connect(this, SIGNAL(NewFont(const QString&)), m_ScMW, SLOT(SetNewFont(const QString&)));
1671
connect(this, SIGNAL(UpdtGui(int)), m_ScMW, SLOT(HaveNewSel(int)));
1672
//CB unused in 135 connect(this->Cpal, SIGNAL(modeChanged()), m_ScMW, SLOT(setCSMenu()));
1673
connect(this->Cpal->gradEdit->Preview, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
1674
connect(this->Cpal, SIGNAL(gradientChanged()), m_ScMW, SLOT(updtGradFill()));
1675
connect(DoUnGroup, SIGNAL(clicked()), m_ScMW, SLOT(UnGroupObj()) );
1679
void PropertiesPalette::SelTab(int t)
1681
if (!m_ScMW || m_ScMW->scriptIsRunning())
1683
// fix for #5991: Property Palette text input box focus stays even when on another tab
1684
// Disable widgets in all pages except current one - PV
1686
foreach (QObject *o, TabStack->widget(t)->children())
1688
// Layouts, boxes etc aren't widgets at all
1689
// so let's skip them silently...
1690
QWidget *w = qobject_cast<QWidget*>(o);
1693
QWidget *i = TabStack->widget(t);
1694
while ((i = i->nextInFocusChain()) != TabStack->widget(t))
1696
if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) && !i->focusProxy() && i->isEnabled())
1706
for (int i = 0; i < TabStack->count(); ++i)
1709
foreach (QObject * o, TabStack->widget(i)->children())
1711
// Layouts, boxes etc aren't widgets at all
1712
// so let's skip them silently...
1713
QWidget * w = qobject_cast<QWidget*>(o);
1715
w->setEnabled(enable);
1718
// now restore the dis-/enabled settings of the current tab
1719
if ((HaveDoc) && (HaveItem))
1724
if ((CurItem->isTableItem) && (CurItem->isSingleSel))
1727
Xpos->setEnabled(false);
1728
Ypos->setEnabled(false);
1729
Rotation->setEnabled(false);
1733
LayerGroup->setEnabled(!setter);
1734
if ((CurItem->itemType() == PageItem::Line) && LMode)
1735
Rotation->setEnabled(false);
1737
Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
1738
if (CurItem->asLine())
1740
keepFrameWHRatioButton->setEnabled(false);
1741
Height->setEnabled(LMode && !CurItem->locked());
1745
Height->setEnabled(true);
1746
keepFrameWHRatioButton->setEnabled(true);
1748
DoGroup->setEnabled(false);
1749
DoUnGroup->setEnabled(false);
1750
if (doc->m_Selection->count() > 1)
1752
bool isGroup = true;
1754
if (CurItem->Groups.count() != 0)
1755
firstElem = CurItem->Groups.top();
1756
for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
1758
if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
1760
if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
1767
DoGroup->setEnabled(true);
1770
if (CurItem->isGroupControl)
1771
NameEdit->setEnabled(true);
1773
if ((CurItem->Groups.count() != 0) && (isGroup))
1774
DoUnGroup->setEnabled(true);
1777
else if (t == idShapeItem)
1779
DCol->setMaximum(qMax(qRound(CurItem->width() / qMax(CurItem->ColGap, 10.0)), 1));
1780
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
1781
RoundRect->setEnabled(true);
1783
RoundRect->setEnabled ((CurItem->asPolygon()) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
1785
else if (t == idImageItem)
1787
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
1788
setter = CurItem->ScaleType;
1789
if (CurItem->asLatexFrame())
1791
FreeScale->setEnabled(false);
1792
FrameScale->setEnabled(false);
1793
Aspect->setEnabled(false);
1794
imageXScaleSpinBox->setEnabled(false);
1795
imageYScaleSpinBox->setEnabled(false);
1796
imgDpiX->setEnabled(false);
1797
imgDpiY->setEnabled(false);
1801
imageXScaleSpinBox->setEnabled(setter);
1802
imageYScaleSpinBox->setEnabled(setter);
1803
imgDpiX->setEnabled(setter);
1804
imgDpiY->setEnabled(setter);
1805
Aspect->setEnabled(!setter);
1806
FreeScale->setEnabled(true);
1807
FrameScale->setEnabled(true);
1809
imageXOffsetSpinBox->setEnabled(setter);
1810
imageYOffsetSpinBox->setEnabled(setter);
1812
else if (t == idLineItem)
1814
if ((CurItem->asLine()) || (CurItem->asPolyLine()))
1816
startArrow->setEnabled(true);
1817
endArrow->setEnabled(true);
1821
startArrow->setEnabled(false);
1822
endArrow->setEnabled(false);
1824
if (CurItem->NamedLStyle.isEmpty())
1828
LStyle->setEnabled(setter);
1829
LSize->setEnabled(setter);
1830
LJoinStyle->setEnabled(setter);
1831
LEndStyle->setEnabled(setter);
1833
else if (t == idColorsItem)
1835
Cpal->setActGradient(CurItem->GrType);
1836
updateColorSpecialGradient();
1837
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
1838
Cpal->gradEdit->Preview->updateDisplay();
1839
KnockOut->setChecked(!CurItem->doOverprint);
1840
Overprint->setChecked(CurItem->doOverprint);
1846
void PropertiesPalette::setDoc(ScribusDoc *d)
1848
if(doc == d || (m_ScMW && m_ScMW->scriptIsRunning()))
1851
disconnect(this->Cpal, SIGNAL(NewTrans(double)), 0, 0);
1852
disconnect(this->Cpal, SIGNAL(NewTransS(double)), 0, 0);
1853
disconnect(this->Cpal, SIGNAL(NewPen(QString)), 0, 0);
1854
disconnect(this->Cpal, SIGNAL(NewBrush(QString)), 0, 0);
1855
disconnect(this->Cpal, SIGNAL(NewPenShade(int)), 0, 0);
1856
disconnect(this->Cpal, SIGNAL(NewBrushShade(int)), 0, 0);
1857
disconnect(this->Cpal, SIGNAL(NewGradient(int)), 0, 0);
1858
disconnect(this->Cpal, SIGNAL(NewBlend(int)), 0, 0);
1859
disconnect(this->Cpal, SIGNAL(NewBlendS(int)), 0, 0);
1860
disconnect(this->Cpal, SIGNAL(NewPattern(QString)), 0, 0);
1861
disconnect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double)), 0, 0);
1865
Cpal->setDocument(doc);
1866
Cpal->setCurrentItem(NULL);
1867
m_unitRatio=doc->unitRatio();
1868
m_unitIndex=doc->unitIndex();
1869
int precision = unitGetPrecisionFromIndex(m_unitIndex);
1871
double maxXYWHVal= 16777215 * m_unitRatio;
1872
double minXYVal= -16777215 * m_unitRatio;
1876
QMap<QString, double>* docConstants = doc? &doc->constants() : NULL;
1877
Xpos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
1878
Xpos->setConstants(docConstants);
1879
Ypos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
1880
Ypos->setConstants(docConstants);
1881
Width->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
1882
Width->setConstants(docConstants);
1883
Height->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
1884
Height->setConstants(docConstants);
1885
imageXOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
1886
imageYOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
1888
Rotation->setValues( 0, 359.99, 1, 0);
1889
RoundRect->setValues( -300, 300, 2, 0);
1890
Extra->setValues( -300, 300, 2, 0);
1891
Size->setValues( 0.5, 2048, 2, 1);
1892
LineSp->setValues( 1, 2048, 2, 1);
1893
minWordTrackingSpinBox->setValues(1, 100, 2, 100);
1894
normWordTrackingSpinBox->setValues(1, 200, 2, 100);
1895
minGlyphExtSpinBox->setValues(90, 110, 2, 100);
1896
maxGlyphExtSpinBox->setValues(90, 110, 2, 100);
1897
imageXScaleSpinBox->setValues( 1, 30000, 2, 1);
1898
imageYScaleSpinBox->setValues( 1, 30000, 2, 1);
1899
imgDpiX->setValues( 1, 30000, 2, 1);
1900
imgDpiY->setValues( 1, 30000, 2, 1);
1902
dGap->setDecimals(2);
1903
DTop->setDecimals(2);
1904
DLeft->setDecimals(2);
1905
DBottom->setDecimals(2);
1906
DRight->setDecimals(2);
1907
LSize->setMaximum( 300 );
1908
LSize->setMinimum( 0 );
1909
Dist->setMaximum( 30000 );
1910
Dist->setMinimum( 0 );
1911
Dist->setSingleStep(10);
1912
LineW->setMaximum( 300 );
1913
LineW->setMinimum( -300 );
1914
LineW->setSingleStep(10);
1918
updateSpinBoxConstants();
1919
paraStyleCombo->setDoc(doc);
1920
charStyleCombo->setDoc(doc);
1921
SetLineFormats(doc);
1922
startArrow->rebuildList(&doc->arrowStyles);
1923
endArrow->rebuildList(&doc->arrowStyles);
1925
connect(this->Cpal, SIGNAL(NewTrans(double)), doc, SLOT(itemSelection_SetItemFillTransparency(double)));
1926
connect(this->Cpal, SIGNAL(NewTransS(double)), doc, SLOT(itemSelection_SetItemLineTransparency(double)));
1927
connect(this->Cpal, SIGNAL(NewBlend(int)), doc, SLOT(itemSelection_SetItemFillBlend(int)));
1928
connect(this->Cpal, SIGNAL(NewBlendS(int)), doc, SLOT(itemSelection_SetItemLineBlend(int)));
1929
connect(this->Cpal, SIGNAL(NewPen(QString)), doc, SLOT(itemSelection_SetItemPen(QString)));
1930
connect(this->Cpal, SIGNAL(NewBrush(QString)), doc, SLOT(itemSelection_SetItemBrush(QString)));
1931
connect(this->Cpal, SIGNAL(NewPenShade(int)), doc, SLOT(itemSelection_SetItemPenShade(int)));
1932
connect(this->Cpal, SIGNAL(NewBrushShade(int)), doc, SLOT(itemSelection_SetItemBrushShade(int)));
1933
connect(this->Cpal, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradFill(int)));
1934
connect(this->Cpal, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternFill(QString)));
1935
connect(this->Cpal, SIGNAL(NewPatternProps(double, double, double, double, double)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double)));
1938
void PropertiesPalette::unsetDoc()
1944
Cpal->setCurrentItem(NULL);
1945
Cpal->setDocument(NULL);
1946
Xpos->setConstants(NULL);
1947
Ypos->setConstants(NULL);
1948
Width->setConstants(NULL);
1949
Height->setConstants(NULL);
1950
paraStyleCombo->setDoc(0);
1951
charStyleCombo->setDoc(0);
1953
DoGroup->setEnabled(false);
1954
DoUnGroup->setEnabled(false);
1955
EditShape->setEnabled(false);
1956
// ShapeGroup->setEnabled(false);
1957
FlipH->setEnabled(false);
1958
FlipV->setEnabled(false);
1959
xposLabel->setText( tr( "&X-Pos:" ) );
1960
widthLabel->setText( tr( "&Width:" ) );
1961
yposLabel->setText( tr( "&Y-Pos:" ) );
1962
heightLabel->setText( tr( "&Height:" ) );
1963
RoundRect->setEnabled(false);
1968
Height->setValue(0);
1969
Rotation->setValue(0);
1970
RoundRect->setValue(0);
1971
for (int ws = 1; ws < 7; ++ws)
1972
TabStack->setItemEnabled(ws, false);
1973
TabStack->widget(0)->setEnabled(false);
1974
TabStack->setItemEnabled(idXYZItem, false);
1975
Cpal->ChooseGrad(0);
1978
void PropertiesPalette::unsetItem()
1982
Cpal->setCurrentItem(NULL);
1987
void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode)
1989
if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveItem)
1991
if (CurItem->isGroupControl)
1993
if (mode == PageItem::TextFlowDisabled)
1994
textFlowDisabled2->setChecked(true);
1995
else if (mode == PageItem::TextFlowUsesFrameShape)
1996
textFlowUsesFrameShape2->setChecked(true);
1997
else if (mode == PageItem::TextFlowUsesBoundingBox)
1998
textFlowUsesBoundingBox2->setChecked(true);
1999
else if (mode == PageItem::TextFlowUsesContourLine)
2000
textFlowUsesContourLine2->setChecked(true);
2001
else if (mode == PageItem::TextFlowUsesImageClipping)
2002
textFlowUsesImageClipping2->setChecked(true);
2003
if ((CurItem->asImageFrame()) && (CurItem->imageClip.size() != 0))
2004
textFlowUsesImageClipping2->setEnabled(true);
2006
textFlowUsesImageClipping2->setEnabled(false);
2010
if (mode == PageItem::TextFlowDisabled)
2011
textFlowDisabled->setChecked(true);
2012
else if (mode == PageItem::TextFlowUsesFrameShape)
2013
textFlowUsesFrameShape->setChecked(true);
2014
else if (mode == PageItem::TextFlowUsesBoundingBox)
2015
textFlowUsesBoundingBox->setChecked(true);
2016
else if (mode == PageItem::TextFlowUsesContourLine)
2017
textFlowUsesContourLine->setChecked(true);
2018
else if (mode == PageItem::TextFlowUsesImageClipping)
2019
textFlowUsesImageClipping->setChecked(true);
2020
if ((CurItem->asImageFrame()) && (CurItem->imageClip.size() != 0))
2021
textFlowUsesImageClipping->setEnabled(true);
2023
textFlowUsesImageClipping->setEnabled(false);
2027
void PropertiesPalette::SetCurItem(PageItem *i)
2029
if (!m_ScMW || m_ScMW->scriptIsRunning())
2031
//CB We shouldnt really need to process this if our item is the same one
2032
//maybe we do if the item has been changed by scripter.. but that should probably
2033
//set some status if so.
2034
//FIXME: This wont work until when a canvas deselect happens, CurItem must be NULL.
2041
disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2042
disconnect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
2043
disconnect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
2044
disconnect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2045
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2047
SelTab(TabStack->currentIndex());
2052
Cpal->setCurrentItem(CurItem);
2053
Cpal->updateFromItem();
2054
/* if (TabStack->currentIndex() == idColorsItem)
2055
Cpal->setActGradient(CurItem->GrType);
2056
updateColorSpecialGradient();
2057
Cpal->gradEdit->Preview->fill_gradient = CurItem->fill_gradient;
2058
Cpal->gradEdit->Preview->updateDisplay(); */
2059
if (CurItem->FrameType == 0)
2060
SCustom->setIcon(SCustom->getIconPixmap(0));
2061
if (CurItem->FrameType == 1)
2062
SCustom->setIcon(SCustom->getIconPixmap(1));
2063
if (CurItem->FrameType > 3)
2064
SCustom->setIcon(SCustom->getIconPixmap(CurItem->FrameType-2));
2065
if ((CurItem->asLine()) || (CurItem->asPolyLine()))
2067
startArrow->setEnabled(true);
2068
endArrow->setEnabled(true);
2069
startArrow->setCurrentIndex(CurItem->startArrowIndex());
2070
endArrow->setCurrentIndex(CurItem->endArrowIndex());
2074
startArrow->setEnabled(false);
2075
endArrow->setEnabled(false);
2077
NameEdit->setText(CurItem->itemName());
2078
RoundRect->setValue(CurItem->cornerRadius()*m_unitRatio);
2080
LevelTxt->setText(tm.setNum(CurItem->ItemNr + 1));
2081
PageItem_TextFrame *i2=CurItem->asTextFrame();
2084
disconnect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
2085
disconnect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
2086
DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
2087
DCol->setMinimum(1);
2088
DCol->setValue(i2->Cols);
2089
dGap->setMinimum(0);
2090
if (colgapLabel->currentIndex() == 0)
2092
dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
2093
dGap->setValue(i2->ColGap*m_unitRatio);
2097
dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
2098
dGap->setValue(i2->columnWidth()*m_unitRatio);
2100
DLeft->setValue(i2->textToFrameDistLeft()*m_unitRatio);
2101
DTop->setValue(i2->textToFrameDistTop()*m_unitRatio);
2102
DBottom->setValue(i2->textToFrameDistBottom()*m_unitRatio);
2103
DRight->setValue(i2->textToFrameDistRight()*m_unitRatio);
2104
// I put it here because it’s visually grouped with these elements
2105
// but it’s a PageItem prop. and as such should be set without considering
2107
setFlop(CurItem->firstLineOffset());
2110
updateStyle(i2->currentStyle());
2112
connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
2113
connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
2115
if (CurItem->asImageFrame())
2117
disconnect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2118
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
2119
imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
2120
connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2122
Revert->setChecked(CurItem->reversed());
2123
setTextFlowMode(CurItem->textFlowMode());
2125
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2126
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2127
FlipH->setChecked(i->imageFlippedH());
2128
FlipV->setChecked(i->imageFlippedV());
2129
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2130
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2132
// langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
2133
if (StyledLine->currentItem())
2134
StyledLine->currentItem()->setSelected(false);
2136
if (CurItem->NamedLStyle.isEmpty())
2139
QListWidgetItem *itemStl = NULL;
2140
itemStl = StyledLine->item(0);
2141
if (itemStl != NULL)
2142
itemStl->setSelected(true);
2146
QList<QListWidgetItem*> results (StyledLine->findItems(CurItem->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
2147
if (results.count() > 0)
2148
results[0]->setSelected(true); //Qt3-QListBox::ExactMatch));
2151
LStyle->setEnabled(setter);
2152
LSize->setEnabled(setter);
2153
LJoinStyle->setEnabled(setter);
2154
LEndStyle->setEnabled(setter);
2155
if (CurItem->dashes().count() == 0)
2159
LStyle->setCurrentIndex(37);
2160
dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
2163
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2164
connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
2165
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
2166
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2168
//CB replaces old emits from PageItem::emitAllToGUI()
2169
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2170
disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2171
disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2172
disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2173
disconnect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2174
disconnect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2175
disconnect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2176
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2177
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2178
disconnect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2179
disconnect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2180
disconnect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2181
disconnect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2182
disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2183
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2184
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2185
disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2186
disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2187
disconnect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2188
disconnect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2189
disconnect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2190
disconnect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2191
setXY(i->xPos(), i->yPos());
2192
setBH(i->width(), i->height());
2193
NoPrint->setChecked(!i->printEnabled());
2194
setFlippedH(i->imageFlippedH());
2195
setFlippedV(i->imageFlippedV());
2196
RoVal = i->rotation();
2197
double rr = i->rotation();
2198
if (i->rotation() > 0)
2200
Rotation->setValue(fabs(rr));
2201
// setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2202
setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
2203
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
2204
i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2205
Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2207
//CB TODO reconnect PP signals from here
2208
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2209
connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2210
connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2211
connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2212
connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2213
connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2214
connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2215
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2216
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2217
connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2218
connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2219
connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2220
connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2221
connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2222
connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2223
connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2224
connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2225
connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2227
if ((CurItem->isTableItem) && (CurItem->isSingleSel))
2230
TabStack3->setCurrentIndex(1);
2231
TopLine->setChecked(CurItem->TopLine);
2232
LeftLine->setChecked(CurItem->LeftLine);
2233
RightLine->setChecked(CurItem->RightLine);
2234
BottomLine->setChecked(CurItem->BottomLine);
2235
Rotation->setEnabled(false);
2240
TabStack3->setCurrentIndex(0);
2242
Xpos->setEnabled(!setter);
2243
Ypos->setEnabled(!setter);
2244
LayerGroup->setEnabled(!setter);
2245
disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2246
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2247
if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2249
TabStack->setItemEnabled(idXYZItem, true);
2250
TabStack->setItemEnabled(idShapeItem, false);
2251
TabStack->setItemEnabled(idGroupItem, true);
2252
TabStack->setItemEnabled(idLineItem, true);
2253
TabStack->setItemEnabled(idColorsItem, true);
2254
// TabStack->setItemEnabled(idLineItem, false);
2255
// TabStack->setItemEnabled(idColorsItem, false);
2256
TabStack->setItemEnabled(idTextItem, false);
2257
TabStack->setItemEnabled(idImageItem, false);
2258
if (CurItem->FrameType == 0)
2259
SCustom2->setIcon(SCustom2->getIconPixmap(0));
2260
if (CurItem->FrameType == 1)
2261
SCustom2->setIcon(SCustom2->getIconPixmap(1));
2262
if (CurItem->FrameType > 3)
2263
SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
2264
TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
2265
blendMode->setCurrentIndex(CurItem->fillBlendmode());
2268
TabStack->setItemEnabled(idGroupItem, false);
2269
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2270
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2272
Xpos->setReadOnly(setter);
2273
Ypos->setReadOnly(setter);
2274
Rotation->setReadOnly(setter);
2276
if (CurItem->asPathText())
2278
TabStack2->setCurrentIndex(0);
2279
pathTextType->setCurrentIndex(CurItem->textPathType);
2280
flippedPathText->setChecked(CurItem->textPathFlipped);
2281
showcurveCheckBox->setChecked(CurItem->PoShow);
2282
LineW->setValue(CurItem->BaseOffs * -1);
2283
Dist->setValue(CurItem->textToFrameDistLeft());
2284
flopItem->setHidden(true);
2285
DistanceItem->setHidden(true);
2286
Distance2Item->setHidden(false);
2288
else if (CurItem->asTextFrame())
2290
TabStack2->setCurrentIndex(0);
2291
flopItem->setHidden(false);
2292
DistanceItem->setHidden(false);
2293
Distance2Item->setHidden(true);
2297
TabStack2->setCurrentIndex(1);
2298
Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
2299
flopItem->setHidden(false);
2300
DistanceItem->setHidden(false);
2301
Distance2Item->setHidden(true);
2303
NonZero->setChecked(!CurItem->fillRule);
2304
EvenOdd->setChecked(CurItem->fillRule);
2305
// Frame type 3 is obsolete: CR 2005-02-06
2306
//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) && (!i->ClipEdited))
2307
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
2308
RoundRect->setEnabled(true);
2311
RoundRect->setEnabled ((CurItem->asPolygon()) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
2313
KnockOut->setChecked(!CurItem->doOverprint);
2314
Overprint->setChecked(CurItem->doOverprint);
2315
if ((CurItem->itemType() == PageItem::Line) && LMode)
2317
xposLabel->setText( tr( "&X1:" ) );
2318
widthLabel->setText( tr( "X&2:" ) );
2319
yposLabel->setText( tr( "Y&1:" ) );
2320
heightLabel->setText( tr( "&Y2:" ) );
2321
Rotation->setEnabled(false);
2325
xposLabel->setText( tr( "&X-Pos:" ) );
2326
widthLabel->setText( tr( "&Width:" ) );
2327
yposLabel->setText( tr( "&Y-Pos:" ) );
2328
heightLabel->setText( tr( "&Height:" ) );
2329
Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
2332
if (CurItem->asLine())
2334
keepFrameWHRatioButton->setEnabled(false);
2335
Height->setEnabled(LMode && !CurItem->locked());
2339
Height->setEnabled(true);
2340
keepFrameWHRatioButton->setEnabled(true);
2341
if (CurItem->asImageFrame())
2344
EditEffects->setShown(CurItem->PictureIsAvailable && CurItem->isRaster);
2345
EditPSDProps->setShown(CurItem->PictureIsAvailable && CurItem->pixm.imgInfo.valid);
2346
setter = CurItem->ScaleType;
2347
FreeScale->setChecked(setter);
2348
FrameScale->setChecked(!setter);
2349
if (CurItem->asLatexFrame())
2351
FreeScale->setEnabled(false);
2352
FrameScale->setEnabled(false);
2353
Aspect->setEnabled(false);
2354
imageXScaleSpinBox->setEnabled(false);
2355
imageYScaleSpinBox->setEnabled(false);
2356
imgDpiX->setEnabled(false);
2357
imgDpiY->setEnabled(false);
2361
imageXScaleSpinBox->setEnabled(setter);
2362
imageYScaleSpinBox->setEnabled(setter);
2363
imgDpiX->setEnabled(setter);
2364
imgDpiY->setEnabled(setter);
2365
Aspect->setEnabled(!setter);
2366
Aspect->setChecked(CurItem->AspectRatio);
2367
FreeScale->setEnabled(true);
2368
FrameScale->setEnabled(true);
2370
//CB Why do we need this? Setting it too much here
2371
// if (setter == true)
2373
// keepImageWHRatioButton->setChecked(setter);
2374
// keepImageDPIRatioButton->setChecked(setter);
2376
imageXOffsetSpinBox->setEnabled(setter);
2377
imageYOffsetSpinBox->setEnabled(setter);
2380
setXY(CurItem->xPos(), CurItem->yPos());
2381
setLocked(i->locked());
2382
setSizeLocked(i->sizeLocked());
2383
setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2384
setLineWidth(i->lineWidth());
2385
setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
2386
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2387
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2388
connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2389
connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2391
DoGroup->setEnabled(false);
2392
DoUnGroup->setEnabled(false);
2393
if (doc->m_Selection->count() > 1)
2395
bool isGroup = true;
2397
if (CurItem->Groups.count() != 0)
2398
firstElem = CurItem->Groups.top();
2399
for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
2401
if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
2403
if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
2410
DoGroup->setEnabled(true);
2413
if (CurItem->isGroupControl)
2414
NameEdit->setEnabled(true);
2416
if ((CurItem->Groups.count() != 0) && (isGroup))
2417
DoUnGroup->setEnabled(true);
2419
updateSpinBoxConstants();
2422
void PropertiesPalette::NewSel(int nr)
2424
if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
2428
int currentTab = TabStack->currentIndex();
2429
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2430
if (doc->m_Selection->count()>1)
2433
double gx, gy, gh, gw;
2434
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
2435
int bp = RotationGroup->checkedId();
2437
m_ScMW->view->RCenter = FPoint(gx, gy);
2439
m_ScMW->view->RCenter = FPoint(gx + gw, gy);
2441
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
2443
m_ScMW->view->RCenter = FPoint(gx, gy + gh);
2445
m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
2446
xposLabel->setText( tr( "&X-Pos:" ) );
2447
widthLabel->setText( tr( "&Width:" ) );
2448
yposLabel->setText( tr( "&Y-Pos:" ) );
2449
heightLabel->setText( tr( "&Height:" ) );
2454
Height->setValue(0);
2455
Rotation->setValue(0);
2456
RoundRect->setValue(0);
2458
Xpos->setEnabled(true);
2459
Ypos->setEnabled(true);
2460
Width->setEnabled(true);
2461
Height->setEnabled(true);
2462
Rotation->setEnabled(true);
2463
// TabStack->setCurrentIndex(0);
2464
for (int ws = 1; ws < 7; ++ws)
2465
TabStack->setItemEnabled(ws, false);
2466
TabStack->widget(0)->setEnabled(true);
2467
TabStack->setItemEnabled(idXYZItem, true);
2468
NameEdit->setEnabled(false);
2469
TabStack->setItemEnabled(idLineItem, true);
2470
TabStack->setItemEnabled(idColorsItem, true);
2471
if (HaveItem && CurItem)
2473
if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2474
TabStack->setItemEnabled(idGroupItem, true);
2476
FlipH->setCheckable( false );
2477
FlipV->setCheckable( false );
2478
FlipH->setChecked(false);
2479
FlipV->setChecked(false);
2480
flopRealHeight->setChecked(true);
2486
i=doc->m_Selection->itemAt(0);
2488
EditShape->setEnabled(!i->locked());
2489
SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
2493
DoGroup->setEnabled(false);
2494
DoUnGroup->setEnabled(false);
2495
EditShape->setEnabled(false);
2496
SCustom->setEnabled(false);
2498
NameEdit->setEnabled(true);
2499
// ShapeGroup->setEnabled(false);
2500
// RoundRect->setEnabled(false);
2501
// Distance->setEnabled(false);
2502
LineMode->setEnabled(false);
2503
RotationGroup->setEnabled(true);
2504
/* TopLeft->setEnabled(true);
2505
TopRight->setEnabled(true);
2506
BottomLeft->setEnabled(true);
2507
BottomRight->setEnabled(true);
2508
Center->setEnabled(true); */
2509
visID = TabStack->currentIndex();
2510
TabStack->widget(0)->setEnabled(true);
2511
TabStack->setItemEnabled(idXYZItem, true);
2512
TabStack->setItemEnabled(idColorsItem, true);
2514
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2515
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2516
FlipH->setChecked(false);
2517
FlipV->setChecked(false);
2518
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2519
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2522
//CB If Toggle is not possible, then we need to enable it so we can turn it off
2523
//It then gets reset below for items where its valid
2524
if ((nr>4) && (nr<9))
2526
FlipH->setCheckable(true);
2527
FlipV->setCheckable(true);
2528
FlipH->setChecked(false);
2529
FlipV->setChecked(false);
2531
FlipH->setCheckable((nr>=0) && (nr<5));
2532
FlipV->setCheckable((nr>=0) && (nr<5));
2533
//CB Why cant we do this for lines?
2534
// FlipH->setEnabled((nr!=-1) && (nr!=5));
2535
// FlipV->setEnabled((nr!=-1) && (nr!=5));
2536
FlipH->setEnabled(nr!=-1);
2537
FlipV->setEnabled(nr!=-1);
2541
xposLabel->setText( tr( "&X-Pos:" ) );
2542
widthLabel->setText( tr( "&Width:" ) );
2543
yposLabel->setText( tr( "&Y-Pos:" ) );
2544
heightLabel->setText( tr( "&Height:" ) );
2545
//Rotation->setEnabled(true);
2546
//Height->setEnabled(true);
2547
RoundRect->setEnabled(false);
2552
Height->setValue(0);
2553
Rotation->setValue(0);
2554
RoundRect->setValue(0);
2555
for (int ws = 1; ws < 7; ++ws)
2556
TabStack->setItemEnabled(ws, false);
2557
// TabStack->setCurrentIndex(0);
2558
TabStack->widget(0)->setEnabled(false);
2559
TabStack->setItemEnabled(idXYZItem, false);
2560
Cpal->ChooseGrad(0);
2561
LevelTxt->setText(" ");
2564
TabStack->setItemEnabled(idShapeItem, true);
2565
TabStack->setItemEnabled(idTextItem, false);
2566
TabStack->setItemEnabled(idImageItem, true);
2567
TabStack->setItemEnabled(idLineItem, true);
2568
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2569
RoundRect->setEnabled(!i->locked());
2571
RoundRect->setEnabled(false);
2572
if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
2573
RoundRect->setEnabled(!i->locked());
2575
// TabStack->setCurrentIndex(0);
2578
TabStack->setItemEnabled(idShapeItem, true);
2579
TabStack->setItemEnabled(idTextItem, true);
2580
TabStack->setItemEnabled(idImageItem, false);
2581
TabStack->setItemEnabled(idLineItem, true);
2582
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2583
RoundRect->setEnabled(!i->locked());
2585
RoundRect->setEnabled(false);
2586
// Distance->setEnabled(true);
2588
// TabStack->setCurrentIndex(0);
2591
TabStack->setItemEnabled(idShapeItem, false);
2592
TabStack->setItemEnabled(idTextItem, false);
2593
TabStack->setItemEnabled(idImageItem, false);
2594
TabStack->setItemEnabled(idLineItem, true);
2595
RoundRect->setEnabled(false);
2596
LineMode->setEnabled(true);
2597
RotationGroup->setEnabled(false);
2598
/* TopLeft->setEnabled(false);
2599
TopRight->setEnabled(false);
2600
BottomLeft->setEnabled(false);
2601
BottomRight->setEnabled(false);
2602
Center->setEnabled(false); */
2603
// if ((visID == 1) || (visID == 2) || (visID == 3))
2604
// TabStack->setCurrentIndex(0);
2609
TabStack->setItemEnabled(idShapeItem, true);
2610
TabStack->setItemEnabled(idTextItem, false);
2611
TabStack->setItemEnabled(idImageItem, false);
2612
TabStack->setItemEnabled(idLineItem, true);
2613
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2614
RoundRect->setEnabled(!i->locked());
2616
RoundRect->setEnabled(false);
2617
// if ((visID == 2) || (visID == 3))
2618
// TabStack->setCurrentIndex(0);
2621
TabStack->setItemEnabled(idShapeItem, true);
2622
TabStack->setItemEnabled(idTextItem, false);
2623
TabStack->setItemEnabled(idImageItem, false);
2624
TabStack->setItemEnabled(idLineItem, true);
2625
RoundRect->setEnabled(false);
2626
// if ((visID == 2) || (visID == 3))
2627
// TabStack->setCurrentIndex(0);
2630
TabStack->setItemEnabled(idShapeItem, true);
2631
TabStack->setItemEnabled(idTextItem, true);
2632
TabStack->setItemEnabled(idImageItem, false);
2633
TabStack->setItemEnabled(idLineItem, true);
2634
RoundRect->setEnabled(false);
2636
// TabStack->setCurrentIndex(0);
2640
if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
2641
TabStack->setCurrentIndex(currentTab);
2645
connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2648
void PropertiesPalette::setMultipleSelection(bool isMultiple)
2652
//CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
2653
//these can be enabled all the time
2654
FlipH->setEnabled(true);
2655
FlipV->setEnabled(true);
2656
NameEdit->setEnabled(!isMultiple);
2657
if (doc->m_Selection->count() > 1)
2659
FlipH->setCheckable( false );
2660
FlipV->setCheckable( false );
2662
uint lowestItem = 999999;
2663
for (int a=0; a<doc->m_Selection->count(); ++a)
2665
i = doc->m_Selection->itemAt(a);
2666
lowestItem = qMin(lowestItem, i->ItemNr);
2668
i = doc->Items->at(lowestItem);
2673
void PropertiesPalette::unitChange()
2677
bool tmp = HaveItem;
2679
double oldRatio = m_unitRatio;
2680
m_unitRatio = doc->unitRatio();
2681
m_unitIndex = doc->unitIndex();
2682
Xpos->setNewUnit( m_unitIndex );
2683
Ypos->setNewUnit( m_unitIndex );
2684
Width->setNewUnit( m_unitIndex );
2685
Height->setNewUnit( m_unitIndex );
2686
imageXOffsetSpinBox->setNewUnit( m_unitIndex );
2687
imageYOffsetSpinBox->setNewUnit( m_unitIndex );
2688
dGap->setNewUnit( m_unitIndex );
2689
DLeft->setNewUnit( m_unitIndex );
2690
DTop->setNewUnit( m_unitIndex );
2691
DBottom->setNewUnit( m_unitIndex );
2692
DRight->setNewUnit( m_unitIndex );
2693
RoundRect->setNewUnit( m_unitIndex );
2694
LSize->setNewUnit( m_unitIndex );
2696
double maxXYWHVal=30000 * m_unitRatio;
2697
double minXYVal=-30000 * m_unitRatio;
2699
double ratioDivisor = m_unitRatio / oldRatio;
2700
double newX = Xpos->value() * ratioDivisor;
2701
double newY = Ypos->value() * ratioDivisor;
2702
double newW = Width->value() * ratioDivisor;
2703
double newH = Height->value() * ratioDivisor;
2704
double newLX = imageXOffsetSpinBox->value() * ratioDivisor;
2705
double newLY = imageYOffsetSpinBox->value() * ratioDivisor;
2706
double newG = dGap->value() * ratioDivisor;
2707
double newGM = dGap->maximum() * ratioDivisor;
2708
double newDT = DTop->value() * ratioDivisor;
2709
double newDL = DLeft->value() * ratioDivisor;
2710
double newDB = DBottom->value() * ratioDivisor;
2711
double newDR = DRight->value() * ratioDivisor;
2712
double newRR = RoundRect->value() * ratioDivisor;
2713
double newRM = RoundRect->maximum() * ratioDivisor;
2714
double newLZ = LSize->value() * ratioDivisor;
2716
if (doc->unitIndex() > unitGetMaxIndex())
2717
doc->setUnitIndex(0);
2718
QString ein = unitGetSuffixFromIndex(doc->unitIndex());
2720
Xpos->setSuffix( ein );
2721
Ypos->setSuffix( ein );
2722
Width->setSuffix( ein );
2723
Height->setSuffix( ein );
2724
imageXOffsetSpinBox->setSuffix( ein );
2725
imageYOffsetSpinBox->setSuffix( ein );
2726
dGap->setSuffix( ein );
2727
DLeft->setSuffix( ein );
2728
DTop->setSuffix( ein );
2729
DBottom->setSuffix( ein );
2730
DRight->setSuffix( ein );
2731
RoundRect->setSuffix( ein );
2732
LSize->setSuffix( ein );
2733
LSize->setValue(newLZ);
2735
int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
2737
Xpos->setValues( minXYVal, maxXYWHVal, decimals, newX );
2738
Ypos->setValues( minXYVal, maxXYWHVal, decimals, newY );
2739
Width->setValues( m_unitRatio, maxXYWHVal, decimals, newW );
2740
Height->setValues( m_unitRatio, maxXYWHVal, decimals, newH );
2742
imageXOffsetSpinBox->setDecimals(decimals);
2743
imageXOffsetSpinBox->setMaximum( maxXYWHVal );
2744
imageXOffsetSpinBox->setValue(newLX);
2746
imageYOffsetSpinBox->setDecimals(decimals);
2747
imageYOffsetSpinBox->setMaximum( maxXYWHVal );
2748
imageYOffsetSpinBox->setValue(newLY);
2750
dGap->setDecimals(decimals);
2751
dGap->setMaximum(newGM);
2752
dGap->setValue(newG);
2754
DLeft->setDecimals(decimals);
2755
DLeft->setMaximum( 300 );
2756
DLeft->setValue(newDL);
2758
DTop->setDecimals(decimals);
2759
DTop->setMaximum( 300 );
2760
DTop->setValue(newDT);
2762
DBottom->setDecimals(decimals);
2763
DBottom->setMaximum( 300 );
2764
DBottom->setValue(newDB);
2766
DRight->setDecimals(decimals);
2767
DRight->setMaximum( 300 );
2768
DRight->setValue(newDR);
2770
RoundRect->setValues(-newRM, newRM, decimals, newRR);
2772
Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
2776
void PropertiesPalette::setLevel(uint l)
2779
LevelTxt->setText(tm.setNum(l + 1));
2782
void PropertiesPalette::setXY(double x, double y)
2784
if (!m_ScMW || m_ScMW->scriptIsRunning())
2786
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2787
disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2788
bool useLineMode = false;
2789
bool tmp = HaveItem;
2790
double inX, inY, b, h, r, dummy1, dummy2;
2795
if (doc->m_Selection->isMultipleSelection())
2797
doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
2799
ma.translate(dummy1, dummy2);
2803
b = CurItem->width();
2804
h = CurItem->height();
2805
r = CurItem->rotation();
2807
useLineMode = (LMode && CurItem->isLine());
2818
// ma.translate(x, y);
2820
int bp = RotationGroup->checkedId();
2821
// #8890 : basepoint is meaningless when lines use "end points" mode
2822
if (bp == 0 || useLineMode)
2823
n = FPoint(0.0, 0.0);
2827
n = FPoint(b / 2.0, h / 2.0);
2832
inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
2833
inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
2836
inX -= doc->rulerXoffset;
2837
inY -= doc->rulerYoffset;
2838
if (doc->guidesSettings.rulerMode)
2840
inX -= doc->currentPage()->xOffset();
2841
inY -= doc->currentPage()->yOffset();
2844
Xpos->setValue(inX*m_unitRatio);
2845
Ypos->setValue(inY*m_unitRatio);
2847
setBH(CurItem->width(), CurItem->height());
2849
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2850
connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2853
void PropertiesPalette::setBH(double x, double y)
2855
if (!m_ScMW || m_ScMW->scriptIsRunning())
2857
bool tmp = HaveItem;
2861
if ((LMode) && (CurItem->asLine()))
2863
ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
2864
ma.rotate(static_cast<double>(Rotation->value())*(-1));
2865
// Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
2866
dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
2867
Width->setValue(dp.x()*m_unitRatio);
2868
Height->setValue(dp.y()*m_unitRatio);
2872
RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
2873
RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
2874
Width->setValue(x*m_unitRatio);
2875
Height->setValue(y*m_unitRatio);
2880
void PropertiesPalette::setR(double r)
2882
if (!m_ScMW || m_ScMW->scriptIsRunning())
2884
bool tmp = HaveItem;
2889
Rotation->setValue(fabs(rr));
2893
void PropertiesPalette::setRR(double r)
2895
if (!m_ScMW || m_ScMW->scriptIsRunning())
2897
bool tmp = HaveItem;
2899
RoundRect->setValue(r*m_unitRatio);
2903
void PropertiesPalette::setCols(int r, double g)
2905
if (!m_ScMW || m_ScMW->scriptIsRunning())
2907
bool tmp = HaveItem;
2910
dGap->setValue(g*m_unitRatio);
2913
PageItem_TextFrame *i2=CurItem->asTextFrame();
2916
DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
2917
if (colgapLabel->currentIndex() == 0)
2919
dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
2920
dGap->setValue(i2->ColGap*m_unitRatio);
2924
dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
2925
dGap->setValue(i2->columnWidth()*m_unitRatio);
2929
DCol->setMinimum(1);
2930
dGap->setMinimum(0);
2935
// void PropertiesPalette::setLspMode(QAction *id)
2937
// if ((HaveDoc) && (HaveItem))
2939
// doc->itemSelection_SetLineSpacingMode(lineSpacingPop->actions().indexOf(id));
2940
// updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2945
void PropertiesPalette::setLineSpacingMode(int id)
2947
if ((HaveDoc) && (HaveItem))
2949
if (CurItem->asTextFrame())
2951
// CurItem->asTextFrame()->ExpandParSel();
2952
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
2953
// CurItem->asTextFrame()->lastAction4Paragraph = true;
2955
doc->itemSelection_SetLineSpacingMode(id);
2956
updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2957
if (CurItem->asTextFrame())
2958
CurItem->asTextFrame()->updateUndo();
2962
void PropertiesPalette::setLsp(double r)
2964
if (!m_ScMW || m_ScMW->scriptIsRunning())
2966
bool tmp = HaveItem;
2968
LineSp->setValue(r);
2969
const ParagraphStyle& curStyle(tmp && doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2972
setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r);
2973
lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode());
2975
QList<QAction*> actList = lineSpacingPop->actions();
2976
for (int al = 0; al < actList.count(); ++al)
2978
actList[al]->setChecked(false);
2980
actList[curStyle.lineSpacingMode()]->setChecked(true);
2986
void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
2988
if (!m_ScMW || m_ScMW->scriptIsRunning())
2990
bool tmp = HaveItem;
2992
DLeft->setValue(left*m_unitRatio);
2993
DTop->setValue(top*m_unitRatio);
2994
DBottom->setValue(bottom*m_unitRatio);
2995
DRight->setValue(right*m_unitRatio);
2999
void PropertiesPalette::setFontFace(const QString& newFont)
3001
if (!m_ScMW || m_ScMW->scriptIsRunning())
3003
bool tmp = HaveItem;
3005
if (CurItem != NULL)
3006
Fonts->RebuildList(doc, CurItem->isAnnotation());
3007
Fonts->setCurrentFont(newFont);
3012
void PropertiesPalette::setSize(double s)
3014
if (!m_ScMW || m_ScMW->scriptIsRunning())
3016
bool tmp = HaveItem;
3018
Size->setValue(s / 10.0);
3022
void PropertiesPalette::setExtra(double e)
3024
if (!m_ScMW || m_ScMW->scriptIsRunning())
3026
bool tmp = HaveItem;
3028
Extra->setValue(e / 10.0);
3032
void PropertiesPalette::ChangeScaling()
3034
if (!m_ScMW || m_ScMW->scriptIsRunning())
3036
if (FreeScale == sender())
3038
FrameScale->setChecked(false);
3039
FreeScale->setChecked(true);
3040
Aspect->setEnabled(false);
3041
imageXOffsetSpinBox->setEnabled(true);
3042
imageYOffsetSpinBox->setEnabled(true);
3043
imageXScaleSpinBox->setEnabled(true);
3044
imageYScaleSpinBox->setEnabled(true);
3045
imgDpiX->setEnabled(true);
3046
imgDpiY->setEnabled(true);
3048
if (FrameScale == sender())
3050
FrameScale->setChecked(true);
3051
FreeScale->setChecked(false);
3052
Aspect->setEnabled(true);
3053
imageXOffsetSpinBox->setEnabled(false);
3054
imageYOffsetSpinBox->setEnabled(false);
3055
imageXScaleSpinBox->setEnabled(false);
3056
imageYScaleSpinBox->setEnabled(false);
3057
imgDpiX->setEnabled(false);
3058
imgDpiY->setEnabled(false);
3060
if ((HaveDoc) && (HaveItem))
3062
CurItem->setImageScalingMode(FreeScale->isChecked(), Aspect->isChecked());
3063
emit UpdtGui(PageItem::ImageFrame);
3069
void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
3071
if (!m_ScMW || m_ScMW->scriptIsRunning())
3073
bool tmp = HaveItem;
3075
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3076
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3077
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3078
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3079
disconnect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3080
disconnect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3081
if (fabs(scx - scy) > 0.0002)
3083
keepImageWHRatioButton->setChecked(false);
3084
keepImageDPIRatioButton->setChecked(false);
3088
imageXOffsetSpinBox->setValue(x * m_unitRatio * CurItem->imageXScale());
3089
imageYOffsetSpinBox->setValue(y * m_unitRatio * CurItem->imageYScale());
3090
imageXScaleSpinBox->setValue(scx * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
3091
imageYScaleSpinBox->setValue(scy * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
3092
imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3093
imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3097
imageXOffsetSpinBox->setValue(x * m_unitRatio);
3098
imageYOffsetSpinBox->setValue(y * m_unitRatio);
3099
imageXScaleSpinBox->setValue(scx * 100);
3100
imageYScaleSpinBox->setValue(scy * 100);
3101
imgDpiX->setValue(72);
3102
imgDpiY->setValue(72);
3104
connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3105
connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3106
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3107
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3108
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3109
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3113
void PropertiesPalette::setLineWidth(double s)
3115
if (!m_ScMW || m_ScMW->scriptIsRunning())
3117
bool tmp = HaveItem;
3119
LSize->setValue(s*m_unitRatio);
3122
if (CurItem->dashes().count() != 0)
3124
if (CurItem->lineWidth() != 0.0)
3126
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
3127
dashEditor->setEnabled(true);
3130
dashEditor->setEnabled(false);
3136
void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
3138
if (!m_ScMW || m_ScMW->scriptIsRunning())
3140
bool tmp = HaveItem;
3144
if (CurItem->dashes().count() != 0)
3146
LStyle->setCurrentIndex(37);
3147
dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
3150
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3153
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3157
LEndStyle->setCurrentIndex(0);
3160
LEndStyle->setCurrentIndex(1);
3163
LEndStyle->setCurrentIndex(2);
3166
LEndStyle->setCurrentIndex(0);
3172
LJoinStyle->setCurrentIndex(0);
3175
LJoinStyle->setCurrentIndex(1);
3178
LJoinStyle->setCurrentIndex(2);
3181
LJoinStyle->setCurrentIndex(0);
3187
void PropertiesPalette::setFlop( FirstLineOffsetPolicy f )
3189
if(f == FLOPFontAscent)
3190
flopFontAscent->setChecked(true);
3191
else if(f == FLOPLineSpacing)
3192
flopLineSpacing->setChecked(true);
3194
flopRealHeight->setChecked(true); //It’s historical behaviour.
3197
void PropertiesPalette::setupLineSpacingSpinbox(int mode, double value)
3202
LineSp->setSpecialValueText( tr( "Auto" ) );
3204
LineSp->setSpecialValueText( tr( "Baseline" ) );
3205
LineSp->setMinimum(0);
3206
LineSp->setValue(0);
3207
LineSp->setEnabled(false);
3211
LineSp->setSpecialValueText("");
3212
LineSp->setMinimum(1);
3213
LineSp->setValue(value);
3214
LineSp->setEnabled(true);
3218
void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
3220
if (!m_ScMW || m_ScMW->scriptIsRunning())
3222
bool tmp = HaveItem;
3224
setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
3225
lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
3227
QList<QAction*> actList = lineSpacingPop->actions();
3228
for (int al = 0; al < actList.count(); ++al)
3230
actList[al]->setChecked(false);
3232
actList[newCurrent.lineSpacingMode()]->setChecked(true);
3234
GroupAlign->setStyle(newCurrent.alignment());
3235
minWordTrackingSpinBox->setValue(newCurrent.minWordTracking() * 100.0);
3236
normWordTrackingSpinBox->setValue(newCurrent.charStyle().wordTracking() * 100.0);
3237
minGlyphExtSpinBox->setValue(newCurrent.minGlyphExtension() * 100.0);
3238
maxGlyphExtSpinBox->setValue(newCurrent.maxGlyphExtension() * 100.0);
3240
updateOpticalMargins(newCurrent);
3247
void PropertiesPalette::setStil(int s)
3249
if (!m_ScMW || m_ScMW->scriptIsRunning())
3251
StrokeIcon->setEnabled(false);
3252
TxStroke->setEnabled(false);
3253
PM1->setEnabled(false);
3254
SeStyle->setStyle(s);
3255
if ((s & 4) || (s & 256))
3257
StrokeIcon->setEnabled(true);
3258
TxStroke->setEnabled(true);
3259
PM1->setEnabled(true);
3263
void PropertiesPalette::setAli(int e)
3265
if (!m_ScMW || m_ScMW->scriptIsRunning())
3267
bool tmp = HaveItem;
3269
GroupAlign->setEnabled(true);
3270
GroupAlign->setStyle(e);
3275
void PropertiesPalette::setParStyle(const QString& name)
3277
if (!m_ScMW || m_ScMW->scriptIsRunning())
3279
bool tmp = HaveItem;
3281
paraStyleCombo->setFormat(name);
3286
void PropertiesPalette::setCharStyle(const QString& name)
3288
if (!m_ScMW || m_ScMW->scriptIsRunning())
3290
bool tmp = HaveItem;
3292
charStyleCombo->setFormat(name);
3296
void PropertiesPalette::setOpticalMargins()
3298
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3300
if (CurItem->asTextFrame())
3301
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(PageItem::FRAME);
3302
int omt(ParagraphStyle::OM_None);
3303
// if (optMarginCheckLeftProtruding->isChecked()) omt+=ParagraphStyle::OM_LeftProtruding;
3304
if (optMarginRadioBoth->isChecked())
3305
omt =ParagraphStyle::OM_Default;
3306
else if (optMarginRadioLeft->isChecked())
3307
omt = ParagraphStyle::OM_LeftHangingPunct;
3308
else if (optMarginRadioRight->isChecked())
3309
omt = ParagraphStyle::OM_RightHangingPunct;
3311
doc->itemSelection_SetOpticalMargins(omt);
3312
if (CurItem->asTextFrame())
3313
CurItem->asTextFrame()->updateUndo();
3316
void PropertiesPalette::resetOpticalMargins()
3318
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3320
doc->itemSelection_resetOpticalMargins();
3323
void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
3326
ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins()));
3327
if (omt == ParagraphStyle::OM_Default)
3328
optMarginRadioBoth->setChecked(true);
3329
else if (omt == ParagraphStyle::OM_LeftHangingPunct)
3330
optMarginRadioLeft->setChecked(true);
3331
else if (omt == ParagraphStyle::OM_RightHangingPunct)
3332
optMarginRadioRight->setChecked(true);
3334
optMarginRadioNone->setChecked(true);
3337
void PropertiesPalette::setMinWordTracking()
3339
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3341
if (CurItem->asTextFrame())
3342
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3343
ParagraphStyle newStyle;
3344
newStyle.setMinWordTracking(minWordTrackingSpinBox->value() / 100.0);
3345
doc->itemSelection_ApplyParagraphStyle(newStyle);
3346
if (CurItem->asTextFrame())
3347
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3351
void PropertiesPalette::setNormWordTracking()
3353
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3355
if (CurItem->asTextFrame())
3356
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3357
ParagraphStyle newStyle;
3358
// newStyle.setNormWordTracking(percent / 100.0);
3359
newStyle.charStyle().setWordTracking(normWordTrackingSpinBox->value() / 100.0);
3360
doc->itemSelection_ApplyParagraphStyle(newStyle);
3361
if (CurItem->asTextFrame())
3362
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3365
void PropertiesPalette::setMinGlyphExtension()
3367
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3369
if (CurItem->asTextFrame())
3370
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3371
ParagraphStyle newStyle;
3372
newStyle.setMinGlyphExtension(minGlyphExtSpinBox->value() / 100.0);
3373
doc->itemSelection_ApplyParagraphStyle(newStyle);
3374
if (CurItem->asTextFrame())
3375
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3378
void PropertiesPalette::setMaxGlyphExtension()
3380
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3382
if (CurItem->asTextFrame())
3383
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3384
ParagraphStyle newStyle;
3385
newStyle.setMaxGlyphExtension(maxGlyphExtSpinBox->value() / 100.0);
3386
doc->itemSelection_ApplyParagraphStyle(newStyle);
3387
if (CurItem->asTextFrame())
3388
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3392
void PropertiesPalette::setTScaleV(double e)
3394
if (!m_ScMW || m_ScMW->scriptIsRunning())
3396
bool tmp = HaveItem;
3398
ChScaleV->setValue(e / 10.0);
3402
void PropertiesPalette::NewTScaleV()
3404
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3406
if (CurItem->asTextFrame())
3407
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3408
doc->itemSelection_SetScaleV(qRound(ChScaleV->value() * 10));
3409
if (CurItem->asTextFrame())
3410
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3413
void PropertiesPalette::NewTBase()
3415
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3417
if (CurItem->asTextFrame())
3418
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3419
doc->itemSelection_SetBaselineOffset(qRound(ChBase->value() * 10));
3420
if (CurItem->asTextFrame())
3421
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3424
void PropertiesPalette::setTScale(double e)
3426
if (!m_ScMW || m_ScMW->scriptIsRunning())
3428
bool tmp = HaveItem;
3430
ChScale->setValue(e / 10.0);
3434
void PropertiesPalette::setTBase(double e)
3436
if (!m_ScMW || m_ScMW->scriptIsRunning())
3438
bool tmp = HaveItem;
3440
ChBase->setValue(e / 10.0);
3444
void PropertiesPalette::NewTScale()
3446
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3448
if (CurItem->asTextFrame())
3449
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3450
doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
3451
if (CurItem->asTextFrame())
3452
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3455
void PropertiesPalette::NewX()
3457
if (!m_ScMW || m_ScMW->scriptIsRunning())
3459
if ((HaveDoc) && (HaveItem))
3461
double x,y,w,h, gx, gy, gh, gw, base;
3463
x = Xpos->value() / m_unitRatio;
3464
y = Ypos->value() / m_unitRatio;
3465
w = Width->value() / m_unitRatio;
3466
h = Height->value() / m_unitRatio;
3468
x += doc->rulerXoffset;
3469
y += doc->rulerYoffset;
3470
if (doc->guidesSettings.rulerMode)
3472
x += doc->currentPage()->xOffset();
3473
y += doc->currentPage()->yOffset();
3475
if (doc->m_Selection->isMultipleSelection())
3477
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3478
int bp = RotationGroup->checkedId();
3479
if ((bp == 0) || (bp == 3))
3482
base = gx + gw / 2.0;
3483
else if ((bp == 1) || (bp == 4))
3486
m_ScMW->view->startGroupTransaction();
3487
doc->moveGroup(x - base, 0, true);
3490
m_ScMW->view->endGroupTransaction();
3492
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3497
if ((CurItem->asLine()) && (LMode))
3499
w += doc->rulerXoffset;
3500
h += doc->rulerYoffset;
3501
if (doc->guidesSettings.rulerMode)
3503
w += doc->currentPage()->xOffset();
3504
h += doc->currentPage()->yOffset();
3506
double r = atan2(h-y,w-x)*(180.0/M_PI);
3507
w = sqrt(pow(w-x,2)+pow(h-y,2));
3508
// doc->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
3509
CurItem->setXYPos(x, CurItem->yPos(), true);
3510
CurItem->setRotation(r, true);
3511
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3512
// doc->RotateItem(r, CurItem->ItemNr);
3516
ma.translate(CurItem->xPos(), CurItem->yPos());
3517
ma.rotate(CurItem->rotation());
3518
int bp = RotationGroup->checkedId();
3520
base = CurItem->xPos();
3522
base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
3524
base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
3526
base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
3528
base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
3529
doc->MoveItem(x - base, 0, CurItem, true);
3532
doc->regionsChanged()->update(QRect());
3537
void PropertiesPalette::NewY()
3539
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3542
double x,y,w,h, gx, gy, gh, gw, base;
3544
x = Xpos->value() / m_unitRatio;
3545
y = Ypos->value() / m_unitRatio;
3546
w = Width->value() / m_unitRatio;
3547
h = Height->value() / m_unitRatio;
3549
x += doc->rulerXoffset;
3550
y += doc->rulerYoffset;
3551
if (doc->guidesSettings.rulerMode)
3553
x += doc->currentPage()->xOffset();
3554
y += doc->currentPage()->yOffset();
3556
if (doc->m_Selection->isMultipleSelection())
3558
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3559
int bp = RotationGroup->checkedId();
3560
if ((bp == 0) || (bp == 1))
3563
base = gy + gh / 2.0;
3564
else if ((bp == 3) || (bp == 4))
3567
m_ScMW->view->startGroupTransaction();
3568
doc->moveGroup(0, y - base, true);
3571
m_ScMW->view->endGroupTransaction();
3573
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3578
if ((CurItem->asLine()) && (LMode))
3580
w += doc->rulerXoffset;
3581
h += doc->rulerYoffset;
3582
if (doc->guidesSettings.rulerMode)
3584
w += doc->currentPage()->xOffset();
3585
h += doc->currentPage()->yOffset();
3587
double r = atan2(h-y,w-x)*(180.0/M_PI);
3588
w = sqrt(pow(w-x,2)+pow(h-y,2));
3589
doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
3590
CurItem->setXYPos(CurItem->xPos(), y, true);
3591
CurItem->setRotation(r, true);
3592
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3593
doc->RotateItem(r, CurItem->ItemNr);
3597
ma.translate(CurItem->xPos(), CurItem->yPos());
3598
ma.rotate(CurItem->rotation());
3599
int bp = RotationGroup->checkedId();
3601
base = CurItem->yPos();
3603
base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
3605
base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
3607
base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
3609
base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
3610
doc->MoveItem(0, y - base, CurItem, true);
3613
doc->regionsChanged()->update(QRect());
3617
void PropertiesPalette::NewW()
3619
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3622
double x,y,w,h, gx, gy, gh, gw;
3623
x = Xpos->value() / m_unitRatio;
3624
y = Ypos->value() / m_unitRatio;
3625
w = Width->value() / m_unitRatio;
3626
h = Height->value() / m_unitRatio;
3627
if (doc->m_Selection->isMultipleSelection())
3630
m_ScMW->view->startGroupTransaction();
3631
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3632
if (keepFrameWHRatioButton->isChecked())
3634
// m_ScMW->view->frameResizeHandle = 1;
3635
doc->scaleGroup(w / gw, w / gw, false);
3636
setBH(w, (w / gw) * gh);
3640
// m_ScMW->view->frameResizeHandle = 6;
3641
doc->scaleGroup(w / gw, 1.0, false);
3642
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3647
m_ScMW->view->endGroupTransaction();
3652
bool oldS = CurItem->Sizing;
3653
CurItem->Sizing = false;
3654
CurItem->OldB2 = CurItem->width();
3655
CurItem->OldH2 = CurItem->height();
3656
if (CurItem->asLine())
3660
double r = atan2(h-y,w-x)*(180.0/M_PI);
3661
CurItem->setRotation(r, true);
3662
w = sqrt(pow(w-x,2)+pow(h-y,2));
3664
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3668
double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
3669
if (CurItem->isTableItem)
3671
int rmo = doc->RotMode;
3673
double dist = w - CurItem->width();
3675
PageItem* bb = CurItem;
3676
while (bb->TopLink != 0)
3680
while (bb->BottomLink != 0)
3683
while (bb2->RightLink != 0)
3685
doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
3686
bb2 = bb2->RightLink;
3688
doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
3689
bb = bb->BottomLink;
3692
while (bb2->RightLink != 0)
3694
doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
3695
bb2 = bb2->RightLink;
3697
doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
3699
if (keepFrameWHRatioButton->isChecked())
3701
keepFrameWHRatioButton->setChecked(false);
3702
setBH(w, (w / oldW) * CurItem->height());
3704
keepFrameWHRatioButton->setChecked(true);
3709
if (keepFrameWHRatioButton->isChecked())
3711
setBH(w, (w / oldW) * CurItem->height());
3712
doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
3715
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3718
CurItem->Sizing = oldS;
3721
doc->regionsChanged()->update(QRect());
3724
void PropertiesPalette::NewH()
3726
if (!m_ScMW || m_ScMW->scriptIsRunning())
3728
if ((HaveDoc) && (HaveItem))
3730
double x,y,w,h, gx, gy, gh, gw;
3731
x = Xpos->value() / m_unitRatio;
3732
y = Ypos->value() / m_unitRatio;
3733
w = Width->value() / m_unitRatio;
3734
h = Height->value() / m_unitRatio;
3735
if (doc->m_Selection->isMultipleSelection())
3738
m_ScMW->view->startGroupTransaction();
3739
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3740
if (keepFrameWHRatioButton->isChecked())
3742
// m_ScMW->view->frameResizeHandle = 1;
3743
doc->scaleGroup(h / gh, h / gh, false);
3744
setBH((h / gh) * gw, h);
3748
// m_ScMW->view->frameResizeHandle = 5;
3749
doc->scaleGroup(1.0, h / gh, false);
3750
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3755
m_ScMW->view->endGroupTransaction();
3760
bool oldS = CurItem->Sizing;
3761
CurItem->Sizing = false;
3762
CurItem->OldB2 = CurItem->width();
3763
CurItem->OldH2 = CurItem->height();
3764
if (CurItem->asLine())
3768
double r = atan2(h-y,w-x)*(180.0/M_PI);
3769
CurItem->setRotation(r, true);
3770
w = sqrt(pow(w-x,2)+pow(h-y,2));
3772
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3776
double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
3777
if (CurItem->isTableItem)
3779
int rmo = doc->RotMode;
3781
double dist = h - CurItem->height();
3783
PageItem* bb = CurItem;
3784
while (bb->LeftLink != 0)
3788
while (bb->RightLink != 0)
3791
while (bb2->BottomLink != 0)
3793
doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
3794
bb2 = bb2->BottomLink;
3796
doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
3800
while (bb2->BottomLink != 0)
3802
doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
3803
bb2 = bb2->BottomLink;
3805
doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
3807
if (keepFrameWHRatioButton->isChecked())
3809
keepFrameWHRatioButton->setChecked(false);
3810
setBH((h / oldH) * CurItem->width(), h);
3812
keepFrameWHRatioButton->setChecked(true);
3817
if (keepFrameWHRatioButton->isChecked())
3819
setBH((h / oldH) * CurItem->width(), h);
3820
doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
3823
doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
3826
CurItem->Sizing = oldS;
3829
doc->regionsChanged()->update(QRect());
3833
void PropertiesPalette::setRotation()
3835
if (!m_ScMW || m_ScMW->scriptIsRunning())
3837
double gx, gy, gh, gw;
3838
if ((HaveDoc) && (HaveItem))
3841
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
3842
if (doc->m_Selection->isMultipleSelection())
3844
doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
3845
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3849
doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
3852
for (int i = 0; i < doc->m_Selection->count(); ++i)
3853
doc->m_Selection->itemAt(i)->checkChanges(true);
3854
m_ScMW->view->endGroupTransaction();
3857
doc->regionsChanged()->update(QRect());
3858
RoVal = Rotation->value();
3862
void PropertiesPalette::NewCornerRadius()
3864
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3866
CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
3867
m_ScMW->view->SetFrameRounded();
3869
doc->regionsChanged()->update(QRect());
3872
void PropertiesPalette::NewLineSpacing()
3874
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3876
if (CurItem->asTextFrame())
3878
// CurItem->asTextFrame()->ExpandParSel();
3879
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
3880
// CurItem->asTextFrame()->lastAction4Paragraph = true;
3882
doc->itemSelection_SetLineSpacing(LineSp->value());
3883
if (CurItem->asTextFrame())
3884
CurItem->asTextFrame()->updateUndo();
3887
void PropertiesPalette::HandleGapSwitch()
3889
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3891
setCols(CurItem->Cols, CurItem->ColGap);
3892
dGap->setToolTip("");
3893
// if (colgapLabel->getState())
3894
if (colgapLabel->currentIndex() == 0)
3895
dGap->setToolTip( tr( "Distance between columns" ) );
3897
dGap->setToolTip( tr( "Column width" ) );
3900
void PropertiesPalette::NewCols()
3902
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3904
CurItem->Cols = DCol->value();
3905
setCols(CurItem->Cols, CurItem->ColGap);
3910
void PropertiesPalette::NewPage()
3912
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3914
bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
3915
CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
3917
CurItem->loadImage(CurItem->externalFile(), true);
3921
void PropertiesPalette::NewGap()
3923
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3925
if (colgapLabel->currentIndex() == 0)
3926
CurItem->ColGap = dGap->value() / m_unitRatio;
3930
if (CurItem->lineColor() != CommonStrings::None)
3931
lineCorr = CurItem->lineWidth();
3934
double newWidth = dGap->value() / m_unitRatio;
3935
double newGap = qMax(((CurItem->width() - CurItem->textToFrameDistLeft() - CurItem->textToFrameDistRight() - lineCorr) - (newWidth * CurItem->Cols)) / (CurItem->Cols - 1), 0.0);
3936
CurItem->ColGap = newGap;
3942
void PropertiesPalette::NewSize()
3944
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3946
if (CurItem->asTextFrame())
3947
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3948
doc->itemSelection_SetFontSize(qRound(Size->value()*10.0));
3949
if (CurItem->asTextFrame())
3950
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3953
void PropertiesPalette::NewTracking()
3955
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3957
if (CurItem->asTextFrame())
3958
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3959
doc->itemSelection_SetTracking(qRound(Extra->value() * 10.0));
3960
if (CurItem->asTextFrame())
3961
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3964
void PropertiesPalette::NewLocalXY()
3966
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3968
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3971
void PropertiesPalette::NewLocalSC()
3973
if (!m_ScMW || m_ScMW->scriptIsRunning())
3975
if ((HaveDoc) && (HaveItem))
3977
/*doc->itemSelection_SetImageScale(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0);
3978
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3980
//CB Dont pass in the scale to the offset change as its taken from the new scale
3981
doc->itemSelection_SetImageScaleAndOffset(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0, imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
3982
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3983
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3984
imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3985
imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3986
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3987
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3991
void PropertiesPalette::NewLocalDpi()
3993
if (!m_ScMW || m_ScMW->scriptIsRunning())
3995
if ((HaveDoc) && (HaveItem))
3998
doc->itemSelection_SetImageScale(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value());
3999
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
4001
//CB Dont pass in the scale to the offset change as its taken from the new scale
4002
doc->itemSelection_SetImageScaleAndOffset(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value(), imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
4003
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4004
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4005
imageXScaleSpinBox->setValue(CurItem->imageXScale() * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
4006
imageYScaleSpinBox->setValue(CurItem->imageYScale() * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
4007
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4008
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4012
void PropertiesPalette::handleImageEffects()
4014
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4016
m_ScMW->ImageEffects();
4019
void PropertiesPalette::handleExtImgProperties()
4021
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4023
m_ScMW->view->editExtendedImageProperties();
4027
void PropertiesPalette::NewLineWidth()
4029
if (!m_ScMW || m_ScMW->scriptIsRunning())
4031
if ((HaveDoc) && (HaveItem))
4033
double oldL = CurItem->lineWidth();
4034
doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
4035
if (CurItem->dashes().count() != 0)
4037
if ((oldL != 0.0) && (CurItem->lineWidth() != 0.0))
4039
for (int a = 0; a < CurItem->DashValues.count(); a++)
4041
CurItem->DashValues[a] = CurItem->DashValues[a] / oldL * CurItem->lineWidth();
4043
CurItem->setDashOffset(CurItem->dashOffset() / oldL * CurItem->lineWidth());
4045
if (CurItem->lineWidth() != 0.0)
4047
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4048
dashEditor->setEnabled(true);
4051
dashEditor->setEnabled(false);
4053
// emit DocChanged();
4057
void PropertiesPalette::setStartArrow(int id)
4059
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4061
doc->itemSelection_ApplyArrowHead(id,-1);
4064
void PropertiesPalette::setEndArrow(int id)
4066
if (!m_ScMW || m_ScMW->scriptIsRunning())
4068
if ((HaveDoc) && (HaveItem))
4069
doc->itemSelection_ApplyArrowHead(-1, id);
4072
void PropertiesPalette::NewLineStyle()
4074
if (!m_ScMW || m_ScMW->scriptIsRunning())
4076
if ((HaveDoc) && (HaveItem))
4078
if (LStyle->currentIndex() == 37)
4080
if (CurItem->dashes().count() == 0)
4082
if ((CurItem->lineStyle() == 0) || (CurItem->lineStyle() == 1))
4084
CurItem->DashValues.append(4.0 * qMax(CurItem->lineWidth(), 1.0));
4085
CurItem->DashValues.append(2.0 * qMax(CurItem->lineWidth(), 1.0));
4088
getDashArray(CurItem->lineStyle(), qMax(CurItem->lineWidth(), 1.0), CurItem->DashValues);
4090
if (CurItem->lineWidth() != 0.0)
4091
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4094
dashEditor->setEnabled(false);
4095
dashEditor->setDashValues(CurItem->dashes(), 1.0, CurItem->dashOffset());
4102
CurItem->DashValues.clear();
4104
doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
4109
void PropertiesPalette::dashChange()
4111
if (!m_ScMW || m_ScMW->scriptIsRunning())
4113
if ((HaveDoc) && (HaveItem))
4115
if (CurItem->lineWidth() != 0.0)
4117
CurItem->setDashes(dashEditor->getDashValues(CurItem->lineWidth()));
4118
CurItem->setDashOffset(dashEditor->Offset->value() * CurItem->lineWidth());
4125
void PropertiesPalette::NewLineMode()
4127
if (!m_ScMW || m_ScMW->scriptIsRunning())
4129
if (LineMode->currentIndex() == 0)
4131
xposLabel->setText( tr( "&X-Pos:" ) );
4132
widthLabel->setText( tr( "&Width:" ) );
4133
yposLabel->setText( tr( "&Y-Pos:" ) );
4134
heightLabel->setText( tr( "&Height:" ) );
4135
Rotation->setEnabled(true);
4136
Height->setEnabled(false);
4141
xposLabel->setText( tr( "&X1:" ) );
4142
widthLabel->setText( tr( "X&2:" ) );
4143
yposLabel->setText( tr( "Y&1:" ) );
4144
heightLabel->setText( tr( "&Y2:" ) );
4145
Rotation->setEnabled(false);
4146
Height->setEnabled(true);
4149
setBH(CurItem->width(), CurItem->height());
4155
void PropertiesPalette::NewLineJoin()
4157
if (!m_ScMW || m_ScMW->scriptIsRunning())
4159
Qt::PenJoinStyle c = Qt::MiterJoin;
4160
switch (LJoinStyle->currentIndex())
4172
if ((HaveDoc) && (HaveItem))
4173
doc->itemSelection_SetLineJoin(c);
4176
void PropertiesPalette::NewLineEnd()
4178
if (!m_ScMW || m_ScMW->scriptIsRunning())
4180
Qt::PenCapStyle c = Qt::FlatCap;
4181
switch (LEndStyle->currentIndex())
4193
if ((HaveDoc) && (HaveItem))
4194
doc->itemSelection_SetLineEnd(c);
4197
void PropertiesPalette::ToggleKette()
4199
if (!m_ScMW || m_ScMW->scriptIsRunning())
4201
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4202
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4203
if (keepImageWHRatioButton->isChecked())
4205
imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4207
keepImageDPIRatioButton->setChecked(true);
4210
keepImageDPIRatioButton->setChecked(false);
4211
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4212
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4215
void PropertiesPalette::HChange()
4217
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4218
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4219
if (keepImageWHRatioButton->isChecked())
4220
imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4222
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4223
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4226
void PropertiesPalette::VChange()
4228
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4229
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4230
if (keepImageWHRatioButton->isChecked())
4231
imageXScaleSpinBox->setValue(imageYScaleSpinBox->value());
4233
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4234
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4237
void PropertiesPalette::ToggleKetteD()
4239
if (!m_ScMW || m_ScMW->scriptIsRunning())
4241
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4242
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4243
if (keepImageDPIRatioButton->isChecked())
4245
imgDpiY->setValue(imgDpiX->value());
4247
keepImageWHRatioButton->setChecked(true);
4250
keepImageWHRatioButton->setChecked(false);
4251
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4252
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4255
void PropertiesPalette::HChangeD()
4257
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4258
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4259
if (keepImageDPIRatioButton->isChecked())
4260
imgDpiY->setValue(imgDpiX->value());
4262
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4263
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4266
void PropertiesPalette::VChangeD()
4268
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4269
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4270
if (keepImageDPIRatioButton->isChecked())
4271
imgDpiX->setValue(imgDpiY->value());
4273
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4274
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4277
void PropertiesPalette::NewAlignement(int a)
4279
int selStart = 0, selEnd = 0, selLength = 0;
4280
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4282
if (CurItem->asTextFrame())
4284
// hack for apply left align for text with no align at all
4285
//so during Undo/Redo some align will be applied
4286
StoryText& itemText(CurItem->itemText);
4287
if (doc->appMode == modeEdit)
4289
//selected parapgraph(s) only
4290
selStart = (itemText.lengthOfSelection() > 0) ? itemText.startOfSelection() : CurItem->CPos;
4291
selEnd = (itemText.lengthOfSelection() > 0) ? itemText.endOfSelection() : CurItem->CPos;
4292
selStart = itemText.startOfParagraph( itemText.nrOfParagraph(selStart) );
4293
selEnd = itemText.endOfParagraph ( itemText.nrOfParagraph(selEnd) );
4298
selStart = itemText.startOfParagraph( 0 );
4299
selEnd = itemText.endOfParagraph ( itemText.nrOfParagraph(itemText.lastInFrame()) );
4301
selLength = qMin(selEnd - selStart + 1, itemText.length() - selStart);
4302
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(selStart, selLength);
4303
// CurItem->asTextFrame()->lastAction4Paragraph = true;
4305
doc->itemSelection_SetAlignment(a);
4306
if (CurItem->asTextFrame())
4307
CurItem->asTextFrame()->updateUndo();
4310
void PropertiesPalette::setTypeStyle(int s)
4312
if (!m_ScMW || m_ScMW->scriptIsRunning())
4314
if (CurItem->asTextFrame())
4315
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4317
if (CurItem->asTextFrame())
4318
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4321
void PropertiesPalette::newShadowOffs()
4323
if ((HaveDoc) && (HaveItem))
4325
if (CurItem->asTextFrame())
4326
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4327
int x = qRound(SeStyle->ShadowVal->Xoffset->value() * 10.0);
4328
int y = qRound(SeStyle->ShadowVal->Yoffset->value() * 10.0);
4329
doc->itemSelection_SetShadowOffsets(x, y);
4330
if (CurItem->asTextFrame())
4331
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4335
void PropertiesPalette::setShadowOffs(double x, double y)
4337
if (!m_ScMW || m_ScMW->scriptIsRunning())
4339
disconnect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4340
disconnect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4341
SeStyle->ShadowVal->Xoffset->setValue(x / 10.0);
4342
SeStyle->ShadowVal->Yoffset->setValue(y / 10.0);
4343
connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4344
connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4347
void PropertiesPalette::newUnderline()
4349
if ((HaveDoc) && (HaveItem))
4351
if (CurItem->asTextFrame())
4352
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4353
int x = qRound(SeStyle->UnderlineVal->LPos->value() * 10.0);
4354
int y = qRound(SeStyle->UnderlineVal->LWidth->value() * 10.0);
4355
doc->itemSelection_SetUnderline(x, y);
4356
if (CurItem->asTextFrame())
4357
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4361
void PropertiesPalette::setUnderline(double p, double w)
4363
if (!m_ScMW || m_ScMW->scriptIsRunning())
4365
disconnect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4366
disconnect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4367
SeStyle->UnderlineVal->LPos->setValue(p / 10.0);
4368
SeStyle->UnderlineVal->LWidth->setValue(w / 10.0);
4369
connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4370
connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4373
void PropertiesPalette::newStrike()
4375
if ((HaveDoc) && (HaveItem))
4377
if (CurItem->asTextFrame())
4378
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4379
int x = qRound(SeStyle->StrikeVal->LPos->value() * 10.0);
4380
int y = qRound(SeStyle->StrikeVal->LWidth->value() * 10.0);
4381
doc->itemSelection_SetStrikethru(x, y);
4382
if (CurItem->asTextFrame())
4383
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4387
void PropertiesPalette::setStrike(double p, double w)
4389
if (!m_ScMW || m_ScMW->scriptIsRunning())
4391
disconnect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4392
disconnect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4393
SeStyle->StrikeVal->LPos->setValue(p / 10.0);
4394
SeStyle->StrikeVal->LWidth->setValue(w / 10.0);
4395
connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4396
connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4399
void PropertiesPalette::setOutlineW(double x)
4401
if (!m_ScMW || m_ScMW->scriptIsRunning())
4403
disconnect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4404
SeStyle->OutlineVal->LWidth->setValue(x / 10.0);
4405
connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4408
void PropertiesPalette::newOutlineW()
4410
int x = qRound(SeStyle->OutlineVal->LWidth->value() * 10.0);
4411
if ((HaveDoc) && (HaveItem))
4413
if (CurItem->asTextFrame())
4414
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4415
doc->itemSelection_SetOutlineWidth(x);
4416
if (CurItem->asTextFrame())
4417
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4421
void PropertiesPalette::DoLower()
4423
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4425
m_ScMW->view->LowerItem();
4428
void PropertiesPalette::DoRaise()
4430
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4432
m_ScMW->view->RaiseItem();
4435
void PropertiesPalette::DoFront()
4437
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4439
m_ScMW->view->ToFront();
4442
void PropertiesPalette::DoBack()
4444
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4446
m_ScMW->view->ToBack();
4449
void PropertiesPalette::NewRotMode(int m)
4451
if (!m_ScMW || m_ScMW->scriptIsRunning())
4453
double inX, inY, gx, gy, gh, gw;
4456
if ((HaveDoc) && (HaveItem))
4460
if (doc->m_Selection->isMultipleSelection())
4462
doc->m_Selection->setGroupRect();
4463
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
4466
m_ScMW->view->RCenter = FPoint(gx, gy);
4472
m_ScMW->view->RCenter = FPoint(gx+gw, gy);
4478
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
4479
inX = gx + gw / 2.0;
4480
inY = gy + gh / 2.0;
4484
m_ScMW->view->RCenter = FPoint(gx, gy+gh);
4490
m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
4494
inX -= doc->rulerXoffset;
4495
inY -= doc->rulerYoffset;
4496
if (doc->guidesSettings.rulerMode)
4498
inX -= doc->currentPage()->xOffset();
4499
inY -= doc->currentPage()->yOffset();
4501
Xpos->setValue(inX*m_unitRatio);
4502
Ypos->setValue(inY*m_unitRatio);
4509
b = CurItem->width();
4510
h = CurItem->height();
4511
r = CurItem->rotation();
4512
// ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getYOffsetForPage(CurItem->OwnPage));
4513
ma.translate(CurItem->xPos(), CurItem->yPos());
4515
int bp = RotationGroup->checkedId();
4517
n = FPoint(0.0, 0.0);
4521
n = FPoint(b / 2.0, h / 2.0);
4526
inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
4527
inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
4528
inX -= doc->rulerXoffset;
4529
inY -= doc->rulerYoffset;
4530
if (doc->guidesSettings.rulerMode)
4532
inX -= doc->currentPage()->xOffset();
4533
inY -= doc->currentPage()->yOffset();
4535
Xpos->setValue(inX*m_unitRatio);
4536
Ypos->setValue(inY*m_unitRatio);
4538
if (CurItem->itemType() == PageItem::ImageFrame)
4540
if (!FreeScale->isChecked())
4542
CurItem->AdjustPictScale();
4544
disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4545
disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4546
imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
4547
imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
4548
connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4549
connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4557
void PropertiesPalette::DoFlow()
4559
PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
4560
if (!m_ScMW || m_ScMW->scriptIsRunning())
4562
if ((HaveDoc) && (HaveItem))
4564
if (CurItem->isGroupControl)
4566
if (textFlowDisabled2->isChecked())
4567
mode = PageItem::TextFlowDisabled;
4568
if (textFlowUsesFrameShape2->isChecked())
4569
mode = PageItem::TextFlowUsesFrameShape;
4570
if (textFlowUsesBoundingBox2->isChecked())
4571
mode = PageItem::TextFlowUsesBoundingBox;
4572
if (textFlowUsesContourLine2->isChecked())
4573
mode = PageItem::TextFlowUsesContourLine;
4574
if (textFlowUsesImageClipping2->isChecked())
4575
mode = PageItem::TextFlowUsesImageClipping;
4579
if (textFlowDisabled->isChecked())
4580
mode = PageItem::TextFlowDisabled;
4581
if (textFlowUsesFrameShape->isChecked())
4582
mode = PageItem::TextFlowUsesFrameShape;
4583
if (textFlowUsesBoundingBox->isChecked())
4584
mode = PageItem::TextFlowUsesBoundingBox;
4585
if (textFlowUsesContourLine->isChecked())
4586
mode = PageItem::TextFlowUsesContourLine;
4587
if (textFlowUsesImageClipping->isChecked())
4588
mode = PageItem::TextFlowUsesImageClipping;
4590
CurItem->setTextFlowMode(mode);
4591
m_ScMW->view->DrawNew();
4596
void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
4598
if (!m_ScMW || m_ScMW->scriptIsRunning())
4600
if ((HaveDoc) && (HaveItem))
4602
if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
4605
if (UndoManager::undoEnabled())
4607
// Store shape info in this form:
4608
// CHANGE_SHAPE_TYPE - ID of the undo operation
4609
// OLD_FRAME_TYPE - original frame type
4610
// NEW_FRAME_TYPE - change of frame type
4611
// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
4612
ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
4613
is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
4614
is->set("OLD_FRAME_TYPE", CurItem->FrameType);
4615
is->set("NEW_FRAME_TYPE", f);
4616
// HACK: this is propably Evil Code (TM). I have to find better way...
4617
FPointArray newShape;
4619
for (int i = 0; i < c/2; ++i)
4621
double x = CurItem->width() * vals[ix] / 100.0;
4622
double y = CurItem->height() * vals[ix+1] / 100.0;
4623
newShape.addPoint(x, y);
4626
// HACK: end of hack
4627
is->setItem(qMakePair(CurItem->shape(), newShape));
4628
UndoManager::instance()->action(CurItem, is);
4634
CurItem->SetRectFrame();
4635
doc->setRedrawBounding(CurItem);
4638
CurItem->SetOvalFrame();
4639
doc->setRedrawBounding(CurItem);
4642
CurItem->SetFrameShape(c, vals);
4643
doc->setRedrawBounding(CurItem);
4644
CurItem->FrameType = f+2;
4647
//qt4 m_ScMW->SCustom->setPixmap(m_ScMW->SCustom->getIconPixmap(f));
4650
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
4652
RoundRect->setEnabled(f == 0);
4655
CurItem->convertTo(PageItem::Polygon);
4657
RoundRect->setEnabled(f == 0);
4658
// TabStack->setCurrentIndex(1);
4662
void PropertiesPalette::handleShapeEdit()
4664
if (!m_ScMW || m_ScMW->scriptIsRunning())
4666
if ((HaveDoc) && (HaveItem))
4668
tmpSelection->clear();
4669
m_ScMW->view->requestMode(modeEditClip);
4670
RoundRect->setEnabled(false);
4674
void PropertiesPalette::NewTDist()
4676
if (!m_ScMW || m_ScMW->scriptIsRunning())
4678
if ((HaveDoc) && (HaveItem))
4680
CurItem->setTextToFrameDist(DLeft->value() / m_unitRatio, DRight->value() / m_unitRatio, DTop->value() / m_unitRatio, DBottom->value() / m_unitRatio);
4681
setCols(CurItem->Cols, CurItem->ColGap);
4687
void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2)
4689
if (!m_ScMW || m_ScMW->scriptIsRunning())
4691
if ((HaveDoc) && (HaveItem))
4693
CurItem->GrStartX = x1 / m_unitRatio;
4694
CurItem->GrStartY = y1 / m_unitRatio;
4695
CurItem->GrEndX = x2 / m_unitRatio;
4696
CurItem->GrEndY = y2 / m_unitRatio;
4698
QRectF upRect(QPointF(CurItem->GrStartX, CurItem->GrStartY), QPointF(CurItem->GrEndX, CurItem->GrEndY));
4699
upRect.translate(CurItem->xPos(), CurItem->yPos());
4700
doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
4705
void PropertiesPalette::toggleGradientEdit()
4707
if (!m_ScMW || m_ScMW->scriptIsRunning())
4709
if ((HaveDoc) && (HaveItem))
4711
if (Cpal->gradEditButton->isChecked())
4712
m_ScMW->view->requestMode(modeEditGradientVectors);
4714
m_ScMW->view->requestMode(modeNormal);
4715
m_ScMW->view->RefreshGradient(CurItem);
4719
void PropertiesPalette::NewTFont(QString c)
4721
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4726
void PropertiesPalette::DoRevert()
4728
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4730
bool setter=Revert->isChecked();
4731
CurItem->setImageFlippedH(setter);
4732
CurItem->setReversed(setter);
4738
void PropertiesPalette::doClearCStyle()
4740
if (!m_ScMW || m_ScMW->scriptIsRunning())
4744
if (CurItem->asTextFrame())
4745
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4746
doc->itemSelection_EraseCharStyle();
4747
if (CurItem->asTextFrame())
4748
CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit? PageItem::PARAMSEL : PageItem::PARAMFULL);
4753
void PropertiesPalette::doClearPStyle()
4755
if (!m_ScMW || m_ScMW->scriptIsRunning())
4759
if (CurItem->asTextFrame())
4761
// CurItem->asTextFrame()->ExpandParSel();
4762
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
4763
// CurItem->asTextFrame()->lastAction4Paragraph = true;
4765
doc->itemSelection_EraseParagraphStyle();
4766
CharStyle emptyCStyle;
4767
doc->itemSelection_SetCharStyle(emptyCStyle);
4768
if (CurItem->asTextFrame())
4769
CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit ? PageItem::PARAMSEL : PageItem::PARAMFULL);
4774
void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
4776
if (!m_ScMW || m_ScMW->scriptIsRunning())
4778
disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4779
StyledLine->clear();
4782
QMap<QString,multiLine>::Iterator it;
4783
for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
4784
StyledLine->addItem( new LineFormatItem(dd, it.value(), it.key()) );
4785
StyledLine->sortItems();
4786
StyledLine->insertItem( 0, tr("No Style"));
4787
if (StyledLine->currentItem())
4788
StyledLine->currentItem()->setSelected(false);
4790
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4793
void PropertiesPalette::SetSTline(QListWidgetItem *c)
4795
if (!m_ScMW || m_ScMW->scriptIsRunning())
4799
bool setter = (c->listWidget()->currentRow() == 0);
4800
doc->itemSelection_SetNamedLineStyle(setter ? QString("") : c->text());
4801
LStyle->setEnabled(setter);
4802
LSize->setEnabled(setter);
4803
LJoinStyle->setEnabled(setter);
4804
LEndStyle->setEnabled(setter);
4807
void PropertiesPalette::updateColorList()
4809
if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
4811
Cpal->SetColors(doc->PageColors);
4812
Cpal->SetPatterns(&doc->docPatterns);
4813
assert (doc->PageColors.document());
4814
TxFill->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
4815
TxStroke->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, false);
4816
TxFill->view()->setMinimumWidth(TxFill->view()->maximumViewportSize().width() + 24);
4817
TxStroke->view()->setMinimumWidth(TxStroke->view()->maximumViewportSize().width() + 24);
4820
void PropertiesPalette::updateCmsList()
4822
if (!m_ScMW || m_ScMW->scriptIsRunning())
4826
if (ScCore->haveCMS() && doc->CMSSettings.CMSinUse)
4833
disconnect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4834
disconnect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4838
if (CurItem->pixm.imgInfo.colorspace == ColorSpaceCMYK)
4840
ProfilesL::Iterator itP;
4841
ProfilesL::Iterator itPend=ScCore->InputProfilesCMYK.end();
4842
for (itP = ScCore->InputProfilesCMYK.begin(); itP != itPend; ++itP)
4844
InputP->addItem(itP.key());
4845
if (itP.key() == CurItem->IProfile)
4846
InputP->setCurrentIndex(InputP->count()-1);
4848
if (!ScCore->InputProfilesCMYK.contains(CurItem->IProfile))
4850
InputP->addItem(CurItem->IProfile);
4851
InputP->setCurrentIndex(InputP->count()-1);
4855
if (!CurItem->EmProfile.isEmpty())
4856
InputP->addItem(CurItem->EmProfile);
4861
ProfilesL::Iterator itP;
4862
ProfilesL::Iterator itPend=ScCore->InputProfiles.end();
4863
for (itP = ScCore->InputProfiles.begin(); itP != itPend; ++itP)
4865
InputP->addItem(itP.key());
4866
if (itP.key() == CurItem->IProfile)
4867
InputP->setCurrentIndex(InputP->count()-1);
4869
if (!ScCore->InputProfiles.contains(CurItem->IProfile))
4871
InputP->addItem(CurItem->IProfile);
4872
InputP->setCurrentIndex(InputP->count()-1);
4876
if (!CurItem->EmProfile.isEmpty())
4877
InputP->addItem(CurItem->EmProfile);
4880
MonitorI->setCurrentIndex(CurItem->IRender);
4882
connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4883
connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4887
void PropertiesPalette::ChangeProfile(const QString& prn)
4889
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4891
doc->itemSelection_SetColorProfile(InputP->currentText());
4894
void PropertiesPalette::ChangeIntent()
4896
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4898
doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
4901
void PropertiesPalette::ShowCMS()
4903
if (!m_ScMW || m_ScMW->scriptIsRunning())
4908
GroupBoxCM->setVisible(ScCore->haveCMS() && doc->CMSSettings.CMSinUse);
4911
void PropertiesPalette::newTxtFill()
4913
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4915
if (CurItem->asTextFrame())
4916
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4917
doc->itemSelection_SetFillColor(TxFill->currentColor());
4918
if (CurItem->asTextFrame())
4919
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4922
void PropertiesPalette::newTxtStroke()
4924
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4926
if (CurItem->asTextFrame())
4927
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4928
doc->itemSelection_SetStrokeColor(TxStroke->currentColor());
4929
if (CurItem->asTextFrame())
4930
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4934
void PropertiesPalette::setActShade()
4936
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4939
if (CurItem->asTextFrame())
4940
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4941
if (PM1 == sender())
4943
b = PM1->getValue();
4944
doc->itemSelection_SetStrokeShade(b);
4948
b = PM2->getValue();
4949
doc->itemSelection_SetFillShade(b);
4951
if (CurItem->asTextFrame())
4952
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4955
void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
4957
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4959
ColorList::Iterator it;
4961
PM2->setValue(qRound(shb));
4962
PM1->setValue(qRound(shp));
4963
if ((b != CommonStrings::None) && (!b.isEmpty()))
4966
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4973
TxFill->setCurrentIndex(c);
4975
if ((p != CommonStrings::None) && (!p.isEmpty()))
4978
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4985
TxStroke->setCurrentIndex(c);
4988
void PropertiesPalette::handleLock()
4990
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4992
m_ScMW->scrActions["itemLock"]->toggle();
4995
void PropertiesPalette::handleLockSize()
4997
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4999
m_ScMW->scrActions["itemLockSize"]->toggle();
5002
void PropertiesPalette::handlePrint()
5004
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5006
m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
5009
void PropertiesPalette::handleFlipH()
5011
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5013
m_ScMW->scrActions["itemFlipH"]->toggle();
5015
if ((HaveDoc) && (HaveItem))
5017
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5026
void PropertiesPalette::handleFlipV()
5028
if (!m_ScMW || m_ScMW->scriptIsRunning())
5030
m_ScMW->scrActions["itemFlipV"]->toggle();
5032
if ((HaveDoc) && (HaveItem))
5034
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5044
void PropertiesPalette::handlePathType()
5046
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5048
CurItem->textPathType = pathTextType->currentIndex();
5053
void PropertiesPalette::handlePathFlip()
5055
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5057
CurItem->textPathFlipped = flippedPathText->isChecked();
5058
CurItem->updatePolyClip();
5063
void PropertiesPalette::handlePathLine()
5065
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5067
CurItem->PoShow = showcurveCheckBox->isChecked();
5072
void PropertiesPalette::handlePathDist()
5074
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5076
CurItem->setTextToFrameDistLeft(Dist->value());
5077
doc->AdjustItemSize(CurItem);
5078
CurItem->updatePolyClip();
5083
void PropertiesPalette::handlePathOffs()
5085
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5087
CurItem->BaseOffs = -LineW->value();
5088
doc->AdjustItemSize(CurItem);
5089
CurItem->updatePolyClip();
5094
void PropertiesPalette::handleFillRule()
5096
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5098
CurItem->fillRule = EvenOdd->isChecked();
5100
qDebug() << "PropertiesPalette::handleFillRule() updateUNDO";
5101
if (CurItem->asTextFrame())
5102
CurItem->asTextFrame()->updateUndo();
5107
void PropertiesPalette::handleOverprint()
5109
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5111
doc->itemSelection_SetOverprint(Overprint->isChecked());
5114
void PropertiesPalette::NewName()
5116
if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5118
QString NameOld = CurItem->itemName();
5119
QString NameNew = NameEdit->text();
5120
if (NameNew.isEmpty())
5122
NameEdit->setText(NameOld);
5126
for (int b = 0; b < doc->Items->count(); ++b)
5128
if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
5136
QMessageBox::warning(this, CommonStrings::trWarning, "<qt>"+ tr("Name \"%1\" isn't unique.<br/>Please choose another.").arg(NameNew)+"</qt>", CommonStrings::tr_OK);
5137
NameEdit->setText(NameOld);
5138
NameEdit->setFocus();
5142
if (CurItem->itemName() != NameEdit->text())
5144
CurItem->setItemName(NameEdit->text());
5150
void PropertiesPalette::fillLangCombo(QMap<QString,QString> langMap)
5152
QStringList sortList;
5153
QMap<QString,QString>::Iterator it;
5154
if (!m_ScMW || m_ScMW->scriptIsRunning())
5157
for (it = langMap.begin(); it != langMap.end(); ++it)
5158
sortList.push_back(it.value());
5159
langCombo->addItems(sortQStringList(sortList));
5160
QListView *tmpView = dynamic_cast<QListView*>(langCombo->view()); Q_ASSERT(tmpView);
5161
int tmpWidth = tmpView->sizeHintForColumn(0);
5163
tmpView->setMinimumWidth(tmpWidth + 24);
5166
void PropertiesPalette::NewLanguage()
5168
if ((HaveDoc) && (HaveItem))
5170
CurItem->doc()->Language = (m_ScMW->GetLang(langCombo->currentText()));
5175
void PropertiesPalette::ManageTabs()
5177
if ((HaveDoc) && (HaveItem))
5179
PageItem_TextFrame *i2=CurItem->asTextFrame();
5182
const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
5183
TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
5186
if (CurItem->asTextFrame())
5188
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
5189
// CurItem->asTextFrame()->lastAction4Paragraph = true;
5191
if (doc->appMode != modeEdit)
5193
ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
5194
newStyle.setTabValues(dia->tmpTab);
5195
CurItem->itemText.setDefaultStyle(newStyle);
5199
ParagraphStyle newStyle;
5200
newStyle.setTabValues(dia->tmpTab);
5201
doc->itemSelection_ApplyParagraphStyle(newStyle);
5204
if (CurItem->asTextFrame())
5205
CurItem->asTextFrame()->updateUndo();
5213
void PropertiesPalette::HandleTLines()
5215
if ((HaveDoc) && (HaveItem))
5217
CurItem->TopLine = TopLine->isChecked();
5218
CurItem->LeftLine = LeftLine->isChecked();
5219
CurItem->RightLine = RightLine->isChecked();
5220
CurItem->BottomLine = BottomLine->isChecked();
5226
void PropertiesPalette::installSniffer(ScrSpinBox *spinBox)
5228
const QList<QObject*> list = spinBox->children();
5229
if (!list.isEmpty())
5231
QListIterator<QObject*> it(list);
5233
while (it.hasNext())
5236
obj->installEventFilter(userActionSniffer);
5241
bool PropertiesPalette::userActionOn()
5243
return _userActionOn;
5246
void PropertiesPalette::spinboxStartUserAction()
5248
// qDebug("%s", "sniffer: spinbox start action");
5249
_userActionOn = true;
5252
void PropertiesPalette::spinboxFinishUserAction()
5254
// qDebug("%s", "sniffer: spinbox finish action");
5255
_userActionOn = false;
5257
for (int i = 0; i < doc->m_Selection->count(); ++i)
5258
doc->m_Selection->itemAt(i)->checkChanges(true);
5259
if (m_ScMW->view->groupTransactionStarted())
5261
m_ScMW->view->endGroupTransaction();
5265
void PropertiesPalette::changeEvent(QEvent *e)
5267
if (e->type() == QEvent::LanguageChange)
5272
QWidget::changeEvent(e);
5275
void PropertiesPalette::languageChange()
5277
setWindowTitle( tr("Properties"));
5279
TabStack->setItemText(idXYZItem, tr("X, Y, &Z"));
5280
TabStack->setItemText(idTextItem, tr("&Text"));
5281
TabStack->setItemText(idImageItem, tr("&Image"));
5282
TabStack->setItemText(idShapeItem, tr("&Shape"));
5283
TabStack->setItemText(idLineItem, tr("&Line"));
5284
TabStack->setItemText(idColorsItem, tr("&Colors"));
5285
TabStack->setItemText(idGroupItem, tr("&Group"));
5287
NameGroup->setTitle( tr("Name"));
5288
GeoGroup->setTitle( tr("Geometry"));
5289
xposLabel->setText( tr("&X-Pos:"));
5290
yposLabel->setText( tr("&Y-Pos:"));
5291
widthLabel->setText( tr("&Width:"));
5292
heightLabel->setText( tr("&Height:"));
5293
rotationLabel->setText( tr("&Rotation:"));
5294
basepointLabel->setText( tr("Basepoint:"));
5295
LayerGroup->setTitle( tr("Level"));
5296
SRect->setText( tr("Shape:"));
5297
// EditShape->setText( tr("&Edit Shape..."));
5298
// EditShape2->setText( tr("&Edit Shape..."));
5299
EditShape->setText( tr("&Edit..."));
5300
EditShape2->setText( tr("&Edit..."));
5301
SRect2->setText( tr("Shape:"));
5302
TransGroup->setTitle( tr( "Transparency Settings" ));
5303
TransTxt->setText( tr( "Opacity:" ) );
5304
TransTxt2->setText( tr( "Blend Mode:" ) );
5305
int oldBlendMode = blendMode->currentIndex();
5307
blendMode->addItem( tr("Normal"));
5308
blendMode->addItem( tr("Darken"));
5309
blendMode->addItem( tr("Lighten"));
5310
blendMode->addItem( tr("Multiply"));
5311
blendMode->addItem( tr("Screen"));
5312
blendMode->addItem( tr("Overlay"));
5313
blendMode->addItem( tr("Hard Light"));
5314
blendMode->addItem( tr("Soft Light"));
5315
blendMode->addItem( tr("Difference"));
5316
blendMode->addItem( tr("Exclusion"));
5317
blendMode->addItem( tr("Color Dodge"));
5318
blendMode->addItem( tr("Color Burn"));
5319
blendMode->addItem( tr("Hue"));
5320
blendMode->addItem( tr("Saturation"));
5321
blendMode->addItem( tr("Color"));
5322
blendMode->setCurrentIndex(oldBlendMode);
5323
rndcornersLabel->setText( tr("R&ound\nCorners:"));
5324
columnsLabel->setText( tr("Colu&mns:"));
5325
int oldcolgapLabel = colgapLabel->currentIndex();
5326
colgapLabel->clear();
5327
colgapLabel->addItem( tr("Gap:"));
5328
colgapLabel->addItem( tr("Width:"));
5329
colgapLabel->setCurrentIndex(oldcolgapLabel);
5330
// colgapLabel->setTexts( tr("&Gap:"), tr("&Width:"));
5331
topLabel->setText( tr("To&p:"));
5332
bottomLabel->setText( tr("&Bottom:"));
5333
leftLabel->setText( tr("&Left:"));
5334
rightLabel->setText( tr("&Right:"));
5335
TabsButton->setText( tr("T&abulators..."));
5336
// Distance2->setTitle( tr("Path Text Properties"));
5337
int oldPathType = pathTextType->currentIndex();
5338
pathTextType->clear();
5339
pathTextType->addItem( tr("Default"));
5340
pathTextType->addItem( tr("Stair Step"));
5341
pathTextType->addItem( tr("Skew"));
5342
pathTextType->setCurrentIndex(oldPathType);
5343
flippedPathText->setText( tr("Flip Text"));
5344
showcurveCheckBox->setText( tr("Show Curve"));
5345
pathTextTypeLabel->setText( tr("Type:"));
5346
startoffsetLabel->setText( tr("Start Offset:"));
5347
distfromcurveLabel->setText( tr("Distance from Curve:"));
5348
Distance3->setTitle( tr("Fill Rule"));
5349
EvenOdd->setText( tr("Even-Odd"));
5350
NonZero->setText( tr("Non Zero"));
5351
textFlowOptions->setTitle( tr("Text &Flow Around Frame"));
5352
textFlowDisabled->setText( tr("Disabled"));
5353
textFlowUsesFrameShape->setText( tr("Use Frame &Shape"));
5354
textFlowUsesBoundingBox->setText( tr("Use &Bounding Box"));
5355
textFlowUsesContourLine->setText( tr("&Use Contour Line"));
5356
textFlowUsesImageClipping->setText( tr("Use Image Clip Path"));
5357
textFlowOptions2->setTitle( tr("Text &Flow Around Frame"));
5358
textFlowDisabled2->setText( tr("Disabled"));
5359
textFlowUsesFrameShape2->setText( tr("Use Frame &Shape"));
5360
textFlowUsesBoundingBox2->setText( tr("Use &Bounding Box"));
5361
textFlowUsesContourLine2->setText( tr("&Use Contour Line"));
5362
textFlowUsesImageClipping2->setText( tr("Use Image Clip Path"));
5363
paraStyleLabel->setText( tr("Paragraph St&yle:"));
5364
charStyleLabel->setText( tr("Character St&yle:"));
5365
// int c=optMarginCombo->currentIndex();
5366
// optMarginCombo->clear();
5367
// optMarginCombo->addItem( CommonStrings::trOpticalMarginsNone );
5369
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftProtruding );
5370
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightProtruding );
5371
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftHangPunct );
5372
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightHangPunct );
5373
// optMarginCombo->addItem( CommonStrings::trOpticalMarginsDefault );
5374
// optMarginCombo->setCurrentIndex(c);
5375
// optMarginCheckLeftProtruding->setText( tr("Left Protruding") );
5376
// optMarginCheckRightProtruding->setText( tr("Right Protruding") );
5377
// optMarginCheckLeftHangPunct->setText( tr("Left Hanging Punctuation") );
5378
// optMarginCheckRightHangPunct->setText( tr("Right Hanging Punctuation") );
5379
optMarginRadioNone->setText( tr("None","optical margins") );
5380
optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
5381
optMarginRadioLeft->setText( tr("Left Only","optical margins") );
5382
optMarginRadioRight->setText( tr("Right Only","optical margins") );
5383
optMarginResetButton->setText( tr("Reset") );
5384
OptMarginsItem->setText(0, tr("Optical Margins"));
5385
wordTrackingLabel->setText( tr("Word Tracking"));
5386
minWordTrackingLabel->setText( tr("Min:"));
5387
normWordTrackingLabel->setText( tr("Norm:"));
5388
glyphExtensionLabel->setText( tr("Glyph Extension"));
5389
minGlyphExtensionLabel->setText( tr("Min:"));
5390
maxGlyphExtensionLabel->setText( tr("Max:"));
5391
colorWidgetsItem->setText(0, tr("Color & Effects"));
5392
advancedWidgetsItem->setText(0, tr("Advanced Settings"));
5393
styleWidgetsItem->setText(0, tr("Style Settings"));
5394
flopItem->setText(0, tr("First Line Offset"));
5395
flopRealHeight->setText( tr("Maximum Ascent"));
5396
flopFontAscent->setText( tr("Font Ascent"));
5397
flopLineSpacing->setText( tr("Line Spacing"));
5398
DistanceItem->setText(0, tr("Columns & Text Distances"));
5399
Distance2Item->setText(0, tr("Path Text Properties"));
5400
imagePageNumberLabel->setText( tr("&Page Number:"));
5401
FreeScale->setText( tr("&Free Scaling"));
5402
imgDPIXLabel->setText( tr("Actual X-DPI:"));
5403
imgDPIYLabel->setText( tr("Actual Y-DPI:"));
5404
xposImgLabel->setText( tr("&X-Pos:"));
5405
yposImgLabel->setText( tr("&Y-Pos:"));
5406
xscaleLabel->setText( tr("X-Sc&ale:"));
5407
yscaleLabel->setText( tr("Y-Scal&e:"));
5408
FrameScale->setText( tr("Scale &To Frame Size"));
5409
Aspect->setText( tr("P&roportional"));
5410
EditEffects->setText( tr("Image Effects"));
5411
EditPSDProps->setText( tr("Extended Image Properties"));
5412
TextCms1->setText( tr("Input Profile:"));
5413
TextCms2->setText( tr("Rendering Intent:"));
5414
// QList<QAction*> actList = lineSpacingPop->actions();
5415
// actList[0]->setText( tr("Fixed Linespacing"));
5416
// actList[1]->setText( tr("Automatic Linespacing"));
5417
// actList[2]->setText( tr("Align to Baseline Grid"));
5418
int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
5419
lineSpacingModeCombo->clear();
5420
lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
5421
lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));
5422
lineSpacingModeCombo->addItem( tr("Align to Baseline Grid"));
5423
lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
5424
int oldMonitorI=MonitorI->currentIndex();
5426
MonitorI->addItem( tr("Perceptual"));
5427
MonitorI->addItem( tr("Relative Colorimetric"));
5428
MonitorI->addItem( tr("Saturation"));
5429
MonitorI->addItem( tr("Absolute Colorimetric"));
5430
MonitorI->setCurrentIndex(oldMonitorI);
5431
int oldLineStyle = LStyle->currentIndex();
5433
LStyle->updateList();
5434
LStyle->addItem( tr("Custom"));
5435
LStyle->setCurrentIndex(oldLineStyle);
5436
int oldLineMode=LineMode->currentIndex();
5438
LineMode->addItem( tr("Left Point"));
5439
LineMode->addItem( tr("End Points"));
5440
LineMode->setCurrentIndex(oldLineMode);
5441
LineModeT->setText( tr("&Basepoint:"));
5442
linetypeLabel->setText( tr("T&ype of Line:"));
5443
startArrowText->setText( tr("Start Arrow:"));
5444
endArrowText->setText( tr("End Arrow:"));
5447
int arrowItem=startArrow->currentIndex();
5448
startArrow->rebuildList(&doc->arrowStyles);
5449
startArrow->setCurrentIndex(arrowItem);
5450
arrowItem=endArrow->currentIndex();
5451
endArrow->rebuildList(&doc->arrowStyles);
5452
endArrow->setCurrentIndex(arrowItem);
5454
linewidthLabel->setText( tr("Line &Width:"));
5455
edgesLabel->setText( tr("Ed&ges:"));
5456
int oldLJoinStyle=LJoinStyle->currentIndex();
5457
LJoinStyle->clear();
5458
LJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
5459
LJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
5460
LJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
5461
LJoinStyle->setCurrentIndex(oldLJoinStyle);
5463
int oldLEndStyle=LEndStyle->currentIndex();
5465
LEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
5466
LEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
5467
LEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
5468
LEndStyle->setCurrentIndex(oldLEndStyle);
5469
endingsLabel->setText( tr("&Endings:"));
5471
TLines->setTitle( tr("Cell Lines"));
5472
TopLine->setText( tr("Line at Top"));
5473
LeftLine->setText( tr("Line at the Left"));
5474
RightLine->setText( tr("Line at the Right "));
5475
BottomLine->setText( tr("Line at Bottom"));
5477
OverP->setTitle( tr("Overprinting"));
5478
KnockOut->setText( tr("Knockout"));
5479
Overprint->setText( tr("Overprint"));
5481
QString pctSuffix=tr(" %");
5482
ChBase->setSuffix(pctSuffix);
5483
ChScale->setSuffix(pctSuffix);
5484
ChScaleV->setSuffix(pctSuffix);
5485
imageXScaleSpinBox->setSuffix(pctSuffix);
5486
imageYScaleSpinBox->setSuffix(pctSuffix);
5487
imgDpiX->setSuffix("");
5488
imgDpiY->setSuffix("");
5489
Extra->setSuffix(pctSuffix);
5490
minWordTrackingSpinBox->setSuffix(pctSuffix);
5491
normWordTrackingSpinBox->setSuffix(pctSuffix);
5492
minGlyphExtSpinBox->setSuffix(pctSuffix);
5493
maxGlyphExtSpinBox->setSuffix(pctSuffix);
5495
QString ptSuffix = tr(" pt");
5496
Dist->setSuffix(ptSuffix);
5497
LineW->setSuffix(ptSuffix);
5498
Size->setSuffix(ptSuffix);
5499
LineSp->setSuffix(ptSuffix);
5501
QString ein = (HaveDoc) ? unitGetSuffixFromIndex(doc->unitIndex()) : ptSuffix;
5503
LSize->setSuffix(ein);
5504
LSize->setSpecialValueText( tr("Hairline"));
5505
Xpos->setSuffix(ein);
5506
Ypos->setSuffix(ein);
5507
Width->setSuffix(ein);
5508
Height->setSuffix(ein);
5509
imageXOffsetSpinBox->setSuffix(ein);
5510
imageYOffsetSpinBox->setSuffix(ein);
5511
dGap->setSuffix(ein);
5512
DLeft->setSuffix(ein);
5513
DTop->setSuffix(ein);
5514
DBottom->setSuffix(ein);
5515
DRight->setSuffix(ein);
5516
RoundRect->setSuffix(ein);
5518
SeStyle->languageChange();
5519
GroupAlign->languageChange();
5521
if(StyledLine->count() > 0)
5522
StyledLine->item(0)->setText( tr("No Style") );
5525
/* CB: doesnt look like we need to do this on languageChange anymore with qt4
5526
NameEdit->setToolTip("");
5527
Xpos->setToolTip("");
5528
Ypos->setToolTip("");
5529
Width->setToolTip("");
5530
Height->setToolTip("");
5531
Rotation->setToolTip("");
5532
basepointLabel->setToolTip("");
5533
// TopLeft->setToolTip("");
5534
// TopRight->setToolTip("");
5535
// BottomLeft->setToolTip("");
5536
// BottomRight->setToolTip("");
5537
// Center->setToolTip("");
5538
FlipH->setToolTip("");
5539
FlipV->setToolTip("");
5540
Zup->setToolTip("");
5541
ZDown->setToolTip("");
5542
ZTop->setToolTip("");
5543
ZBottom->setToolTip("");
5544
LevelTxt->setToolTip("");
5545
Locked->setToolTip("");
5546
NoResize->setToolTip("");
5547
NoPrint->setToolTip("");
5548
textFlowOptions->setToolTip("");
5549
textFlowDisabled->setToolTip("");
5550
textFlowUsesFrameShape->setToolTip("");
5551
textFlowUsesBoundingBox->setToolTip("");
5552
textFlowUsesContourLine->setToolTip("");
5553
textFlowUsesImageClipping->setToolTip("");
5554
textFlowOptions2->setToolTip("");
5555
textFlowDisabled2->setToolTip("");
5556
textFlowUsesFrameShape2->setToolTip("");
5557
textFlowUsesBoundingBox2->setToolTip("");
5558
textFlowUsesContourLine2->setToolTip("");
5559
textFlowUsesImageClipping2->setToolTip("");
5561
//Fonts->setToolTip("");
5562
Size->setToolTip("");
5563
ChBase->setToolTip("");
5564
ChScale->setToolTip("");
5565
ChScaleV->setToolTip("");
5566
TxStroke->setToolTip("");
5567
TxFill->setToolTip("");
5568
PM1->setToolTip("");
5569
PM2->setToolTip("");
5570
Revert->setToolTip("");
5571
Extra->setToolTip("");
5572
LineSp->setToolTip("");
5573
linespacingButton->setToolTip("");
5574
paraStyleCombo->setToolTip("");
5575
charStyleCombo->setToolTip("");
5576
paraStyleClear->setToolTip("");
5577
charStyleClear->setToolTip("");
5578
// langCombo->setToolTip("");
5580
minWordTrackingSpinBox->setToolTip("");
5581
normWordTrackingSpinBox->setToolTip("");
5582
minGlyphExtSpinBox->setToolTip("");
5583
maxGlyphExtSpinBox->setToolTip("");
5584
optMarginCombo->setToolTip("");
5586
LineMode->setToolTip("");
5587
LStyle->setToolTip("");
5588
LSize->setToolTip("");
5589
LJoinStyle->setToolTip("");
5590
LEndStyle->setToolTip("");
5591
StyledLine->setToolTip("");
5593
SCustom->setToolTip("");
5594
EditShape->setToolTip("");
5595
RoundRect->setToolTip("");
5596
DCol->setToolTip("");
5597
colgapLabel->setToolTip("");
5598
dGap->setToolTip("");
5599
DTop->setToolTip("");
5600
DBottom->setToolTip("");
5601
DLeft->setToolTip("");
5602
DRight->setToolTip("");
5603
TabsButton->setToolTip("");
5605
FreeScale->setToolTip("");
5606
imageXOffsetSpinBox->setToolTip("");
5607
imageYOffsetSpinBox->setToolTip("");
5608
imageXScaleSpinBox->setToolTip("");
5609
imageYScaleSpinBox->setToolTip("");
5610
keepImageWHRatioButton->setToolTip("");
5611
keepFrameWHRatioButton->setToolTip("");
5612
FrameScale->setToolTip("");
5613
Aspect->setToolTip("");
5614
InputP->setToolTip("");
5615
MonitorI->setToolTip("");
5617
NameEdit->setToolTip( tr("Name of selected object"));
5618
Xpos->setToolTip( tr("Horizontal position of current basepoint"));
5619
Ypos->setToolTip( tr("Vertical position of current basepoint"));
5620
Width->setToolTip( tr("Width"));
5621
Height->setToolTip( tr("Height"));
5622
Rotation->setToolTip( tr("Rotation of object at current basepoint"));
5623
basepointLabel->setToolTip( tr("Point from which measurements or rotation angles are referenced"));
5624
// TopLeft->setToolTip( tr("Select top left for basepoint"));
5625
// TopRight->setToolTip( tr("Select top right for basepoint"));
5626
// BottomLeft->setToolTip( tr("Select bottom left for basepoint"));
5627
// BottomRight->setToolTip( tr("Select bottom right for basepoint"));
5628
// Center->setToolTip( tr("Select center for basepoint"));
5629
DoGroup->setToolTip( tr("Group the selected objects"));
5630
DoUnGroup->setToolTip( tr("Ungroup the selected group"));
5631
FlipH->setToolTip( tr("Flip Horizontal"));
5632
FlipV->setToolTip( tr("Flip Vertical"));
5633
Zup->setToolTip( tr("Move one level up"));
5634
ZDown->setToolTip( tr("Move one level down"));
5635
ZTop->setToolTip( tr("Move to front"));
5636
ZBottom->setToolTip( tr("Move to back"));
5637
LevelTxt->setToolTip( tr("Indicates the level the object is on, 0 means the object is at the bottom"));
5638
Locked->setToolTip( tr("Lock or unlock the object"));
5639
NoResize->setToolTip( tr("Lock or unlock the size of the object"));
5640
NoPrint->setToolTip( tr("Enable or disable exporting of the object"));
5641
/*textFlowOptions->setToolTip( tr("Make text in lower frames flow around the object shape")); */
5642
textFlowDisabled->setToolTip( tr("Disable text flow from lower frames around object"));
5643
textFlowUsesFrameShape->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5644
textFlowUsesBoundingBox->setToolTip( "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
5645
textFlowUsesContourLine->setToolTip( "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object. T") + "</qt>" );
5646
textFlowUsesImageClipping->setToolTip( "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5647
textFlowDisabled2->setToolTip( tr("Disable text flow from lower frames around object"));
5648
textFlowUsesFrameShape2->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5649
textFlowUsesBoundingBox2->setToolTip( "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
5650
textFlowUsesContourLine2->setToolTip( "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object. T") + "</qt>" );
5651
textFlowUsesImageClipping2->setToolTip( "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5653
//Fonts->setToolTip( tr("Font of selected text or object"));
5654
Size->setToolTip( tr("Font Size"));
5655
ChBase->setToolTip( tr("Offset to baseline of characters"));
5656
ChScale->setToolTip( tr("Scaling width of characters"));
5657
ChScaleV->setToolTip( tr("Scaling height of characters"));
5658
TxStroke->setToolTip( "<qt>" + tr("Color of text stroke and/or drop shadow, depending which is chosen.If both are chosen, then they share the same color.") + "</qt>" );
5659
TxFill->setToolTip( "<qt>" + tr("Color of selected text. If Outline text decoration is enabled, this color will be the fill color. If Drop Shadow Text is enabled, then this will be the top most color.") + "</qt>" );
5660
PM1->setToolTip( tr("Saturation of color of text stroke"));
5661
PM2->setToolTip( tr("Saturation of color of text fill"));
5662
Revert->setToolTip( tr("Right to Left Writing"));
5663
Extra->setToolTip( tr("Manual Tracking"));
5664
LineSp->setToolTip( tr("Line Spacing"));
5665
// linespacingButton->setToolTip( "<qt>" + tr("Click and hold down to select the line spacing mode.") + "</qt>" );
5666
lineSpacingModeCombo->setToolTip( tr("Select the line spacing mode.") );
5667
paraStyleCombo->setToolTip( tr("Paragraph style of currently selected text or paragraph"));
5668
charStyleCombo->setToolTip( tr("Character style of currently selected text or paragraph"));
5669
paraStyleClear->setToolTip( tr("Remove Direct Paragraph Formatting"));
5670
charStyleClear->setToolTip( tr("Remove Direct Character Formatting"));
5671
// langCombo->setToolTip( tr("Hyphenation language of frame"));
5673
flopRealHeight->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to use the tallest height of the included characters") + "</qt>" );
5674
flopFontAscent->setToolTip( "<qt>" + tr("Set the height of the first line of text frame to use the full ascent of the font(s) in use") + "</qt>" );
5675
flopLineSpacing->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to the specified line height") + "</qt>" );
5677
minWordTrackingSpinBox->setToolTip( tr("Minimal width of spaces between words"));
5678
normWordTrackingSpinBox->setToolTip( tr("Normal width of spaces between words"));
5679
minGlyphExtSpinBox->setToolTip( tr("Minimal shrinkage of glyphs for justification"));
5680
maxGlyphExtSpinBox->setToolTip( tr("Maximal extension of glyphs for justification"));
5681
// optMarginCombo->setToolTip( tr("Uses hanging punctuation and margin kerning to achieve nicer looking columns"));
5683
LineMode->setToolTip( tr("Change settings for left or end points"));
5684
LStyle->setToolTip( tr("Pattern of line"));
5685
LSize->setToolTip( tr("Thickness of line"));
5686
LJoinStyle->setToolTip( tr("Type of line joins"));
5687
LEndStyle->setToolTip( tr("Type of line end"));
5688
StyledLine->setToolTip( tr("Line style of current object"));
5689
startArrow->setToolTip( tr("Arrow head style for start of line"));
5690
endArrow->setToolTip( tr("Arrow head style for end of line"));
5692
SCustom->setToolTip( tr("Choose the shape of frame..."));
5693
EditShape->setToolTip( tr("Edit shape of the frame..."));
5694
RoundRect->setToolTip( tr("Set radius of corner rounding"));
5695
DCol->setToolTip( tr("Number of columns in text frame"));
5696
colgapLabel->setToolTip( tr("Switches between Gap or Column width"));
5697
dGap->setToolTip( tr("Distance between columns"));
5698
DTop->setToolTip( tr("Distance of text from top of frame"));
5699
DBottom->setToolTip( tr("Distance of text from bottom of frame"));
5700
DLeft->setToolTip( tr("Distance of text from left of frame"));
5701
DRight->setToolTip( tr("Distance of text from right of frame"));
5702
TabsButton->setToolTip( tr("Edit tab settings of text frame..."));
5704
FreeScale->setToolTip( tr("Allow the image to be a different size to the frame"));
5705
imageXOffsetSpinBox->setToolTip( tr("Horizontal offset of image within frame"));
5706
imageYOffsetSpinBox->setToolTip( tr("Vertical offset of image within frame"));
5707
imageXScaleSpinBox->setToolTip( tr("Resize the image horizontally"));
5708
imageYScaleSpinBox->setToolTip( tr("Resize the image vertically"));
5709
keepImageWHRatioButton->setToolTip( tr("Keep the X and Y scaling the same"));
5710
keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
5711
FrameScale->setToolTip( tr("Make the image fit within the size of the frame"));
5712
imgDpiX->setToolTip( tr("Effective horizontal DPI of the image after scaling"));
5713
imgDpiY->setToolTip( tr("Effective vertical DPI of the image after scaling"));
5714
Aspect->setToolTip( tr("Use image proportions rather than those of the frame"));
5715
InputP->setToolTip( tr("Source profile of the image"));
5716
MonitorI->setToolTip( tr("Rendering intent for the image"));
5720
const VGradient PropertiesPalette::getFillGradient()
5722
return Cpal->gradEdit->Preview->fill_gradient;
5725
void PropertiesPalette::setGradientEditMode(bool on)
5727
Cpal->gradEditButton->setChecked(on);
5730
void PropertiesPalette::updateColorSpecialGradient()
5734
if(doc->m_Selection->isEmpty())
5736
double dur=doc->unitRatio();
5737
PageItem *currItem=doc->m_Selection->itemAt(0);
5739
Cpal->setSpecialGradient(currItem->GrStartX * dur, currItem->GrStartY * dur, currItem->GrEndX * dur, currItem->GrEndY * dur);
5742
void PropertiesPalette::updateSpinBoxConstants()
5746
if(doc->m_Selection->count()==0)
5748
Width->setConstants(&doc->constants());
5749
Height->setConstants(&doc->constants());
5750
Xpos->setConstants(&doc->constants());
5751
Ypos->setConstants(&doc->constants());
5755
UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
5760
bool UserActionSniffer::eventFilter(QObject*, QEvent *e)
5762
if (e->type() == QEvent::MouseButtonPress)
5764
else if (e->type() == QEvent::MouseButtonRelease)
5766
else if (e->type() == QEvent::KeyPress)
5768
QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5769
if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5772
else if (e->type() == QEvent::KeyRelease)
5774
QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5775
if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5781
void PropertiesPalette::setLocked(bool isLocked)
5783
Xpos->setReadOnly(isLocked);
5784
Ypos->setReadOnly(isLocked);
5785
Width->setReadOnly(isLocked);
5786
Height->setReadOnly(isLocked);
5787
Rotation->setReadOnly(isLocked);
5788
QPalette pal(qApp->palette());
5790
pal.setCurrentColorGroup(QPalette::Disabled);
5792
Xpos->setPalette(pal);
5793
Ypos->setPalette(pal);
5794
Width->setPalette(pal);
5795
Height->setPalette(pal);
5796
Rotation->setPalette(pal);
5798
EditShape->setEnabled(!isLocked);
5799
LayerGroup->setEnabled(!isLocked);
5800
Locked->setChecked(isLocked);
5801
if ((HaveDoc) && (HaveItem))
5803
SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
5804
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
5805
RoundRect->setEnabled(!isLocked);
5807
RoundRect->setEnabled(false);
5811
void PropertiesPalette::setSizeLocked(bool isSizeLocked)
5813
bool b=isSizeLocked;
5814
if (HaveItem && CurItem->locked())
5816
Width->setReadOnly(b);
5817
Height->setReadOnly(b);
5818
QPalette pal(qApp->palette());
5821
pal.setCurrentColorGroup(QPalette::Disabled);
5823
Width->setPalette(pal);
5824
Height->setPalette(pal);
5825
NoResize->setChecked(isSizeLocked);
5828
void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
5830
NoPrint->setChecked(!isPrintingEnabled);
5833
void PropertiesPalette::setFlippedH(bool isFlippedH)
5835
FlipH->setChecked(isFlippedH);
5838
void PropertiesPalette::setFlippedV(bool isFlippedV)
5840
FlipV->setChecked(isFlippedV);
5843
void PropertiesPalette::setGroupTransparency(int trans)
5845
if ((HaveDoc) && (HaveItem))
5847
CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
5853
void PropertiesPalette::setGroupBlending(int blend)
5855
CurItem->setFillBlendmode(blend);
5860
void PropertiesPalette::doGrouping()
5863
DoGroup->setEnabled(false);
5864
DoUnGroup->setEnabled(true);
5865
setMultipleSelection(true);
5866
double gx, gy, gh, gw;
5867
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
5868
int bp = RotationGroup->checkedId();
5870
m_ScMW->view->RCenter = FPoint(gx, gy);
5872
m_ScMW->view->RCenter = FPoint(gx + gw, gy);
5874
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
5876
m_ScMW->view->RCenter = FPoint(gx, gy + gh);
5878
m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
5879
TabStack->setItemEnabled(idShapeItem, false);
5882
void PropertiesPalette::handleShapeEdit2()
5884
if (!m_ScMW || m_ScMW->scriptIsRunning())
5886
if ((HaveDoc) && (HaveItem))
5888
tmpSelection->clear();
5889
tmpSelection->copy(*doc->m_Selection, true);
5890
doc->m_Selection->clear();
5891
doc->m_Selection->addItem(CurItem);
5892
CurItem->isSingleSel = true;
5894
m_ScMW->view->requestMode(modeEditClip);
5895
RoundRect->setEnabled(false);
5899
void PropertiesPalette::endEdit2()
5901
if ((HaveDoc) && (HaveItem))
5903
if (tmpSelection->count() > 0)
5905
doc->m_Selection->copy(*tmpSelection, false);
5906
doc->m_Selection->connectItemToGUI();
5908
tmpSelection->clear();
5912
void PropertiesPalette::flop(int radioFlop)
5914
if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5916
// qDebug("%s", QString("rF %1").arg(radioFlop).toAscii());
5918
CurItem->setFirstLineOffset(FLOPRealGlyphHeight);
5919
else if( radioFlop == 1)
5920
CurItem->setFirstLineOffset(FLOPFontAscent);
5921
else if( radioFlop == 2)
5922
CurItem->setFirstLineOffset(FLOPLineSpacing);