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>
44
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
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<qreal> 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
colgapLabel->setEnabled(DCol->value() > 1);
2101
dGap->setEnabled(DCol->value() > 1);
2102
DLeft->setValue(i2->textToFrameDistLeft()*m_unitRatio);
2103
DTop->setValue(i2->textToFrameDistTop()*m_unitRatio);
2104
DBottom->setValue(i2->textToFrameDistBottom()*m_unitRatio);
2105
DRight->setValue(i2->textToFrameDistRight()*m_unitRatio);
2106
// I put it here because it’s visually grouped with these elements
2107
// but it’s a PageItem prop. and as such should be set without considering
2109
setFlop(CurItem->firstLineOffset());
2112
updateStyle(i2->currentStyle());
2114
connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
2115
connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
2117
if (CurItem->asImageFrame())
2119
if (CurItem->PictureIsAvailable)
2121
disconnect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2122
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
2123
imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
2124
connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2125
imagePageNumber->setEnabled(true);
2129
imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
2130
imagePageNumber->setEnabled(false);
2133
Revert->setChecked(CurItem->reversed());
2134
setTextFlowMode(CurItem->textFlowMode());
2136
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2137
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2138
FlipH->setChecked(i->imageFlippedH());
2139
FlipV->setChecked(i->imageFlippedV());
2140
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2141
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2143
// langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
2144
if (StyledLine->currentItem())
2145
StyledLine->currentItem()->setSelected(false);
2147
if (CurItem->NamedLStyle.isEmpty())
2150
QListWidgetItem *itemStl = NULL;
2151
itemStl = StyledLine->item(0);
2152
if (itemStl != NULL)
2153
itemStl->setSelected(true);
2157
QList<QListWidgetItem*> results (StyledLine->findItems(CurItem->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
2158
if (results.count() > 0)
2159
results[0]->setSelected(true); //Qt3-QListBox::ExactMatch));
2162
LStyle->setEnabled(setter);
2163
LSize->setEnabled(setter);
2164
LJoinStyle->setEnabled(setter);
2165
LEndStyle->setEnabled(setter);
2166
if (CurItem->dashes().count() == 0)
2170
LStyle->setCurrentIndex(37);
2171
dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
2174
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2175
connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
2176
connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
2177
connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2179
//CB replaces old emits from PageItem::emitAllToGUI()
2180
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2181
disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2182
disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2183
disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2184
disconnect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2185
disconnect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2186
disconnect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2187
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2188
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2189
disconnect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2190
disconnect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2191
disconnect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2192
disconnect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2193
disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2194
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2195
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2196
disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2197
disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2198
disconnect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2199
disconnect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2200
disconnect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2201
disconnect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2202
setXY(i->xPos(), i->yPos());
2203
setBH(i->width(), i->height());
2204
NoPrint->setChecked(!i->printEnabled());
2205
setFlippedH(i->imageFlippedH());
2206
setFlippedV(i->imageFlippedV());
2207
RoVal = i->rotation();
2208
double rr = i->rotation();
2209
if (i->rotation() > 0)
2211
Rotation->setValue(fabs(rr));
2212
// setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2213
setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
2214
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
2215
i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2216
Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2218
//CB TODO reconnect PP signals from here
2219
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2220
connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2221
connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2222
connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2223
connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2224
connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2225
connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2226
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2227
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2228
connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2229
connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2230
connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2231
connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2232
connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2233
connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2234
connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2235
connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2236
connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2238
if ((CurItem->isTableItem) && (CurItem->isSingleSel))
2241
TabStack3->setCurrentIndex(1);
2242
TopLine->setChecked(CurItem->TopLine);
2243
LeftLine->setChecked(CurItem->LeftLine);
2244
RightLine->setChecked(CurItem->RightLine);
2245
BottomLine->setChecked(CurItem->BottomLine);
2246
Rotation->setEnabled(false);
2251
TabStack3->setCurrentIndex(0);
2253
Xpos->setEnabled(!setter);
2254
Ypos->setEnabled(!setter);
2255
LayerGroup->setEnabled(!setter);
2256
disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2257
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2258
if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2260
TabStack->setItemEnabled(idXYZItem, true);
2261
TabStack->setItemEnabled(idShapeItem, false);
2262
TabStack->setItemEnabled(idGroupItem, true);
2263
TabStack->setItemEnabled(idLineItem, true);
2264
TabStack->setItemEnabled(idColorsItem, true);
2265
// TabStack->setItemEnabled(idLineItem, false);
2266
// TabStack->setItemEnabled(idColorsItem, false);
2267
TabStack->setItemEnabled(idTextItem, false);
2268
TabStack->setItemEnabled(idImageItem, false);
2269
if (CurItem->FrameType == 0)
2270
SCustom2->setIcon(SCustom2->getIconPixmap(0));
2271
if (CurItem->FrameType == 1)
2272
SCustom2->setIcon(SCustom2->getIconPixmap(1));
2273
if (CurItem->FrameType > 3)
2274
SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
2275
TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
2276
blendMode->setCurrentIndex(CurItem->fillBlendmode());
2279
TabStack->setItemEnabled(idGroupItem, false);
2280
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2281
connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2283
Xpos->setReadOnly(setter);
2284
Ypos->setReadOnly(setter);
2285
Rotation->setReadOnly(setter);
2287
if (CurItem->asPathText())
2289
TabStack2->setCurrentIndex(0);
2290
pathTextType->setCurrentIndex(CurItem->textPathType);
2291
flippedPathText->setChecked(CurItem->textPathFlipped);
2292
showcurveCheckBox->setChecked(CurItem->PoShow);
2293
LineW->setValue(CurItem->BaseOffs * -1);
2294
Dist->setValue(CurItem->textToFrameDistLeft());
2295
flopItem->setHidden(true);
2296
DistanceItem->setHidden(true);
2297
Distance2Item->setHidden(false);
2299
else if (CurItem->asTextFrame())
2301
TabStack2->setCurrentIndex(0);
2302
flopItem->setHidden(false);
2303
DistanceItem->setHidden(false);
2304
Distance2Item->setHidden(true);
2308
TabStack2->setCurrentIndex(1);
2309
Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
2310
flopItem->setHidden(false);
2311
DistanceItem->setHidden(false);
2312
Distance2Item->setHidden(true);
2314
NonZero->setChecked(!CurItem->fillRule);
2315
EvenOdd->setChecked(CurItem->fillRule);
2316
// Frame type 3 is obsolete: CR 2005-02-06
2317
//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) && (!i->ClipEdited))
2318
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
2319
RoundRect->setEnabled(true);
2322
RoundRect->setEnabled ((CurItem->asPolygon()) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
2324
KnockOut->setChecked(!CurItem->doOverprint);
2325
Overprint->setChecked(CurItem->doOverprint);
2326
if ((CurItem->itemType() == PageItem::Line) && LMode)
2328
xposLabel->setText( tr( "&X1:" ) );
2329
widthLabel->setText( tr( "X&2:" ) );
2330
yposLabel->setText( tr( "Y&1:" ) );
2331
heightLabel->setText( tr( "&Y2:" ) );
2332
Rotation->setEnabled(false);
2336
xposLabel->setText( tr( "&X-Pos:" ) );
2337
widthLabel->setText( tr( "&Width:" ) );
2338
yposLabel->setText( tr( "&Y-Pos:" ) );
2339
heightLabel->setText( tr( "&Height:" ) );
2340
Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
2343
if (CurItem->asLine())
2345
keepFrameWHRatioButton->setEnabled(false);
2346
Height->setEnabled(LMode && !CurItem->locked());
2350
Height->setEnabled(true);
2351
keepFrameWHRatioButton->setEnabled(true);
2352
if (CurItem->asImageFrame())
2355
EditEffects->setShown(CurItem->PictureIsAvailable && CurItem->isRaster);
2356
EditPSDProps->setShown(CurItem->PictureIsAvailable && CurItem->pixm.imgInfo.valid);
2357
setter = CurItem->ScaleType;
2358
FreeScale->setChecked(setter);
2359
FrameScale->setChecked(!setter);
2360
if (CurItem->asLatexFrame())
2362
FreeScale->setEnabled(false);
2363
FrameScale->setEnabled(false);
2364
Aspect->setEnabled(false);
2365
imageXScaleSpinBox->setEnabled(false);
2366
imageYScaleSpinBox->setEnabled(false);
2367
imgDpiX->setEnabled(false);
2368
imgDpiY->setEnabled(false);
2372
imageXScaleSpinBox->setEnabled(setter);
2373
imageYScaleSpinBox->setEnabled(setter);
2374
imgDpiX->setEnabled(setter);
2375
imgDpiY->setEnabled(setter);
2376
Aspect->setEnabled(!setter);
2377
Aspect->setChecked(CurItem->AspectRatio);
2378
FreeScale->setEnabled(true);
2379
FrameScale->setEnabled(true);
2381
//CB Why do we need this? Setting it too much here
2382
// if (setter == true)
2384
// keepImageWHRatioButton->setChecked(setter);
2385
// keepImageDPIRatioButton->setChecked(setter);
2387
imageXOffsetSpinBox->setEnabled(setter);
2388
imageYOffsetSpinBox->setEnabled(setter);
2391
setXY(CurItem->xPos(), CurItem->yPos());
2392
setLocked(i->locked());
2393
setSizeLocked(i->sizeLocked());
2394
setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2395
setLineWidth(i->lineWidth());
2396
setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
2397
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2398
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2399
connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2400
connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2402
DoGroup->setEnabled(false);
2403
DoUnGroup->setEnabled(false);
2404
if (doc->m_Selection->count() > 1)
2406
bool isGroup = true;
2408
if (CurItem->Groups.count() != 0)
2409
firstElem = CurItem->Groups.top();
2410
for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
2412
if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
2414
if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
2421
DoGroup->setEnabled(true);
2424
if (CurItem->isGroupControl)
2425
NameEdit->setEnabled(true);
2427
if ((CurItem->Groups.count() != 0) && (isGroup))
2428
DoUnGroup->setEnabled(true);
2430
updateSpinBoxConstants();
2433
void PropertiesPalette::NewSel(int nr)
2435
if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
2439
int currentTab = TabStack->currentIndex();
2440
disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2441
if (doc->m_Selection->count()>1)
2444
double gx, gy, gh, gw;
2445
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
2446
int bp = RotationGroup->checkedId();
2448
m_ScMW->view->RCenter = FPoint(gx, gy);
2450
m_ScMW->view->RCenter = FPoint(gx + gw, gy);
2452
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
2454
m_ScMW->view->RCenter = FPoint(gx, gy + gh);
2456
m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
2457
xposLabel->setText( tr( "&X-Pos:" ) );
2458
widthLabel->setText( tr( "&Width:" ) );
2459
yposLabel->setText( tr( "&Y-Pos:" ) );
2460
heightLabel->setText( tr( "&Height:" ) );
2465
Height->setValue(0);
2466
Rotation->setValue(0);
2467
RoundRect->setValue(0);
2469
Xpos->setEnabled(true);
2470
Ypos->setEnabled(true);
2471
Width->setEnabled(true);
2472
Height->setEnabled(true);
2473
Rotation->setEnabled(true);
2474
// TabStack->setCurrentIndex(0);
2475
for (int ws = 1; ws < 7; ++ws)
2476
TabStack->setItemEnabled(ws, false);
2477
TabStack->widget(0)->setEnabled(true);
2478
TabStack->setItemEnabled(idXYZItem, true);
2479
NameEdit->setEnabled(false);
2480
TabStack->setItemEnabled(idLineItem, true);
2481
TabStack->setItemEnabled(idColorsItem, true);
2482
if (HaveItem && CurItem)
2484
if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2485
TabStack->setItemEnabled(idGroupItem, true);
2487
FlipH->setCheckable( false );
2488
FlipV->setCheckable( false );
2489
FlipH->setChecked(false);
2490
FlipV->setChecked(false);
2491
flopRealHeight->setChecked(true);
2497
i=doc->m_Selection->itemAt(0);
2499
EditShape->setEnabled(!i->locked() && !i->sizeLocked());
2500
SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
2504
DoGroup->setEnabled(false);
2505
DoUnGroup->setEnabled(false);
2506
EditShape->setEnabled(false);
2507
SCustom->setEnabled(false);
2509
NameEdit->setEnabled(true);
2510
// ShapeGroup->setEnabled(false);
2511
// RoundRect->setEnabled(false);
2512
// Distance->setEnabled(false);
2513
LineMode->setEnabled(false);
2514
RotationGroup->setEnabled(true);
2515
/* TopLeft->setEnabled(true);
2516
TopRight->setEnabled(true);
2517
BottomLeft->setEnabled(true);
2518
BottomRight->setEnabled(true);
2519
Center->setEnabled(true); */
2520
visID = TabStack->currentIndex();
2521
TabStack->widget(0)->setEnabled(true);
2522
TabStack->setItemEnabled(idXYZItem, true);
2523
TabStack->setItemEnabled(idColorsItem, true);
2525
disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2526
disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2527
FlipH->setChecked(false);
2528
FlipV->setChecked(false);
2529
connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2530
connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2533
//CB If Toggle is not possible, then we need to enable it so we can turn it off
2534
//It then gets reset below for items where its valid
2535
if ((nr>4) && (nr<9))
2537
FlipH->setCheckable(true);
2538
FlipV->setCheckable(true);
2539
FlipH->setChecked(false);
2540
FlipV->setChecked(false);
2542
FlipH->setCheckable((nr>=0) && (nr<5));
2543
FlipV->setCheckable((nr>=0) && (nr<5));
2544
//CB Why cant we do this for lines?
2545
// FlipH->setEnabled((nr!=-1) && (nr!=5));
2546
// FlipV->setEnabled((nr!=-1) && (nr!=5));
2547
FlipH->setEnabled(nr!=-1);
2548
FlipV->setEnabled(nr!=-1);
2552
xposLabel->setText( tr( "&X-Pos:" ) );
2553
widthLabel->setText( tr( "&Width:" ) );
2554
yposLabel->setText( tr( "&Y-Pos:" ) );
2555
heightLabel->setText( tr( "&Height:" ) );
2556
//Rotation->setEnabled(true);
2557
//Height->setEnabled(true);
2558
RoundRect->setEnabled(false);
2563
Height->setValue(0);
2564
Rotation->setValue(0);
2565
RoundRect->setValue(0);
2566
for (int ws = 1; ws < 7; ++ws)
2567
TabStack->setItemEnabled(ws, false);
2568
// TabStack->setCurrentIndex(0);
2569
TabStack->widget(0)->setEnabled(false);
2570
TabStack->setItemEnabled(idXYZItem, false);
2571
Cpal->ChooseGrad(0);
2572
LevelTxt->setText(" ");
2575
TabStack->setItemEnabled(idShapeItem, true);
2576
TabStack->setItemEnabled(idTextItem, false);
2577
TabStack->setItemEnabled(idImageItem, true);
2578
TabStack->setItemEnabled(idLineItem, true);
2579
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2580
RoundRect->setEnabled(!i->locked());
2582
RoundRect->setEnabled(false);
2583
if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
2584
RoundRect->setEnabled(!i->locked());
2586
// TabStack->setCurrentIndex(0);
2589
TabStack->setItemEnabled(idShapeItem, true);
2590
TabStack->setItemEnabled(idTextItem, true);
2591
TabStack->setItemEnabled(idImageItem, false);
2592
TabStack->setItemEnabled(idLineItem, true);
2593
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2594
RoundRect->setEnabled(!i->locked());
2596
RoundRect->setEnabled(false);
2597
// Distance->setEnabled(true);
2599
// TabStack->setCurrentIndex(0);
2602
TabStack->setItemEnabled(idShapeItem, false);
2603
TabStack->setItemEnabled(idTextItem, false);
2604
TabStack->setItemEnabled(idImageItem, false);
2605
TabStack->setItemEnabled(idLineItem, true);
2606
RoundRect->setEnabled(false);
2607
LineMode->setEnabled(true);
2608
RotationGroup->setEnabled(false);
2609
/* TopLeft->setEnabled(false);
2610
TopRight->setEnabled(false);
2611
BottomLeft->setEnabled(false);
2612
BottomRight->setEnabled(false);
2613
Center->setEnabled(false); */
2614
// if ((visID == 1) || (visID == 2) || (visID == 3))
2615
// TabStack->setCurrentIndex(0);
2620
TabStack->setItemEnabled(idShapeItem, true);
2621
TabStack->setItemEnabled(idTextItem, false);
2622
TabStack->setItemEnabled(idImageItem, false);
2623
TabStack->setItemEnabled(idLineItem, true);
2624
if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2625
RoundRect->setEnabled(!i->locked());
2627
RoundRect->setEnabled(false);
2628
// if ((visID == 2) || (visID == 3))
2629
// TabStack->setCurrentIndex(0);
2632
TabStack->setItemEnabled(idShapeItem, true);
2633
TabStack->setItemEnabled(idTextItem, false);
2634
TabStack->setItemEnabled(idImageItem, false);
2635
TabStack->setItemEnabled(idLineItem, true);
2636
RoundRect->setEnabled(false);
2637
// if ((visID == 2) || (visID == 3))
2638
// TabStack->setCurrentIndex(0);
2641
TabStack->setItemEnabled(idShapeItem, true);
2642
TabStack->setItemEnabled(idTextItem, true);
2643
TabStack->setItemEnabled(idImageItem, false);
2644
TabStack->setItemEnabled(idLineItem, true);
2645
RoundRect->setEnabled(false);
2647
// TabStack->setCurrentIndex(0);
2651
if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
2652
TabStack->setCurrentIndex(currentTab);
2656
connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2659
void PropertiesPalette::setMultipleSelection(bool isMultiple)
2663
//CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
2664
//these can be enabled all the time
2665
FlipH->setEnabled(true);
2666
FlipV->setEnabled(true);
2667
NameEdit->setEnabled(!isMultiple);
2668
if (doc->m_Selection->count() > 1)
2670
FlipH->setCheckable( false );
2671
FlipV->setCheckable( false );
2673
uint lowestItem = 999999;
2674
for (int a=0; a<doc->m_Selection->count(); ++a)
2676
i = doc->m_Selection->itemAt(a);
2677
lowestItem = qMin(lowestItem, i->ItemNr);
2679
i = doc->Items->at(lowestItem);
2684
void PropertiesPalette::unitChange()
2688
bool tmp = HaveItem;
2690
double oldRatio = m_unitRatio;
2691
m_unitRatio = doc->unitRatio();
2692
m_unitIndex = doc->unitIndex();
2693
Xpos->setNewUnit( m_unitIndex );
2694
Ypos->setNewUnit( m_unitIndex );
2695
Width->setNewUnit( m_unitIndex );
2696
Height->setNewUnit( m_unitIndex );
2697
imageXOffsetSpinBox->setNewUnit( m_unitIndex );
2698
imageYOffsetSpinBox->setNewUnit( m_unitIndex );
2699
dGap->setNewUnit( m_unitIndex );
2700
DLeft->setNewUnit( m_unitIndex );
2701
DTop->setNewUnit( m_unitIndex );
2702
DBottom->setNewUnit( m_unitIndex );
2703
DRight->setNewUnit( m_unitIndex );
2704
RoundRect->setNewUnit( m_unitIndex );
2705
LSize->setNewUnit( m_unitIndex );
2707
double maxXYWHVal=30000 * m_unitRatio;
2708
double minXYVal=-30000 * m_unitRatio;
2710
double ratioDivisor = m_unitRatio / oldRatio;
2711
double newX = Xpos->value() * ratioDivisor;
2712
double newY = Ypos->value() * ratioDivisor;
2713
double newW = Width->value() * ratioDivisor;
2714
double newH = Height->value() * ratioDivisor;
2715
double newLX = imageXOffsetSpinBox->value() * ratioDivisor;
2716
double newLY = imageYOffsetSpinBox->value() * ratioDivisor;
2717
double newG = dGap->value() * ratioDivisor;
2718
double newGM = dGap->maximum() * ratioDivisor;
2719
double newDT = DTop->value() * ratioDivisor;
2720
double newDL = DLeft->value() * ratioDivisor;
2721
double newDB = DBottom->value() * ratioDivisor;
2722
double newDR = DRight->value() * ratioDivisor;
2723
double newRR = RoundRect->value() * ratioDivisor;
2724
double newRM = RoundRect->maximum() * ratioDivisor;
2725
double newLZ = LSize->value() * ratioDivisor;
2727
if (doc->unitIndex() > unitGetMaxIndex())
2728
doc->setUnitIndex(0);
2729
QString ein = unitGetSuffixFromIndex(doc->unitIndex());
2731
Xpos->setSuffix( ein );
2732
Ypos->setSuffix( ein );
2733
Width->setSuffix( ein );
2734
Height->setSuffix( ein );
2735
imageXOffsetSpinBox->setSuffix( ein );
2736
imageYOffsetSpinBox->setSuffix( ein );
2737
dGap->setSuffix( ein );
2738
DLeft->setSuffix( ein );
2739
DTop->setSuffix( ein );
2740
DBottom->setSuffix( ein );
2741
DRight->setSuffix( ein );
2742
RoundRect->setSuffix( ein );
2743
LSize->setSuffix( ein );
2744
LSize->setValue(newLZ);
2746
int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
2748
Xpos->setValues( minXYVal, maxXYWHVal, decimals, newX );
2749
Ypos->setValues( minXYVal, maxXYWHVal, decimals, newY );
2750
Width->setValues( m_unitRatio, maxXYWHVal, decimals, newW );
2751
Height->setValues( m_unitRatio, maxXYWHVal, decimals, newH );
2753
imageXOffsetSpinBox->setDecimals(decimals);
2754
imageXOffsetSpinBox->setMaximum( maxXYWHVal );
2755
imageXOffsetSpinBox->setValue(newLX);
2757
imageYOffsetSpinBox->setDecimals(decimals);
2758
imageYOffsetSpinBox->setMaximum( maxXYWHVal );
2759
imageYOffsetSpinBox->setValue(newLY);
2761
dGap->setDecimals(decimals);
2762
dGap->setMaximum(newGM);
2763
dGap->setValue(newG);
2765
DLeft->setDecimals(decimals);
2766
DLeft->setMaximum( 300 );
2767
DLeft->setValue(newDL);
2769
DTop->setDecimals(decimals);
2770
DTop->setMaximum( 300 );
2771
DTop->setValue(newDT);
2773
DBottom->setDecimals(decimals);
2774
DBottom->setMaximum( 300 );
2775
DBottom->setValue(newDB);
2777
DRight->setDecimals(decimals);
2778
DRight->setMaximum( 300 );
2779
DRight->setValue(newDR);
2781
RoundRect->setValues(-newRM, newRM, decimals, newRR);
2783
Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
2787
void PropertiesPalette::setLevel(uint l)
2790
LevelTxt->setText(tm.setNum(l + 1));
2793
void PropertiesPalette::setXY(double x, double y)
2795
if (!m_ScMW || m_ScMW->scriptIsRunning())
2797
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2798
disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2799
bool useLineMode = false;
2800
bool tmp = HaveItem;
2801
double inX, inY, b, h, r, dummy1, dummy2;
2806
if (doc->m_Selection->isMultipleSelection())
2808
doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
2810
ma.translate(dummy1, dummy2);
2814
b = CurItem->width();
2815
h = CurItem->height();
2816
r = CurItem->rotation();
2818
useLineMode = (LMode && CurItem->isLine());
2829
// ma.translate(x, y);
2831
int bp = RotationGroup->checkedId();
2832
// #8890 : basepoint is meaningless when lines use "end points" mode
2833
if (bp == 0 || useLineMode)
2834
n = FPoint(0.0, 0.0);
2838
n = FPoint(b / 2.0, h / 2.0);
2843
inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
2844
inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
2847
inX -= doc->rulerXoffset;
2848
inY -= doc->rulerYoffset;
2849
if (doc->guidesSettings.rulerMode)
2851
inX -= doc->currentPage()->xOffset();
2852
inY -= doc->currentPage()->yOffset();
2855
Xpos->setValue(inX*m_unitRatio);
2856
Ypos->setValue(inY*m_unitRatio);
2858
setBH(CurItem->width(), CurItem->height());
2860
connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2861
connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2864
void PropertiesPalette::setBH(double x, double y)
2866
if (!m_ScMW || m_ScMW->scriptIsRunning())
2868
bool tmp = HaveItem;
2872
if ((LMode) && (CurItem->asLine()))
2874
ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
2875
ma.rotate(static_cast<double>(Rotation->value())*(-1));
2876
// Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
2877
dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
2878
Width->setValue(dp.x()*m_unitRatio);
2879
Height->setValue(dp.y()*m_unitRatio);
2883
RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
2884
RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
2885
Width->setValue(x*m_unitRatio);
2886
Height->setValue(y*m_unitRatio);
2891
void PropertiesPalette::setR(double r)
2893
if (!m_ScMW || m_ScMW->scriptIsRunning())
2895
bool tmp = HaveItem;
2900
Rotation->setValue(fabs(rr));
2904
void PropertiesPalette::setRR(double r)
2906
if (!m_ScMW || m_ScMW->scriptIsRunning())
2908
bool tmp = HaveItem;
2910
RoundRect->setValue(r*m_unitRatio);
2914
void PropertiesPalette::setCols(int r, double g)
2916
if (!m_ScMW || m_ScMW->scriptIsRunning())
2918
bool tmp = HaveItem;
2921
dGap->setValue(g*m_unitRatio);
2924
PageItem_TextFrame *i2=CurItem->asTextFrame();
2927
DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
2928
if (colgapLabel->currentIndex() == 0)
2930
dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
2931
dGap->setValue(i2->ColGap * m_unitRatio);
2935
dGap->setMaximum(qMax((i2->width() / i2->Cols) *m_unitRatio, 0.0));
2936
dGap->setValue(i2->columnWidth() * m_unitRatio);
2940
DCol->setMinimum(1);
2941
dGap->setMinimum(0);
2942
colgapLabel->setEnabled(DCol->value() > 1);
2943
dGap->setEnabled(DCol->value() > 1);
2948
// void PropertiesPalette::setLspMode(QAction *id)
2950
// if ((HaveDoc) && (HaveItem))
2952
// doc->itemSelection_SetLineSpacingMode(lineSpacingPop->actions().indexOf(id));
2953
// updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2958
void PropertiesPalette::setLineSpacingMode(int id)
2960
if ((HaveDoc) && (HaveItem))
2962
if (CurItem->asTextFrame())
2963
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
2964
doc->itemSelection_SetLineSpacingMode(id);
2965
updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2966
if (CurItem->asTextFrame())
2967
CurItem->asTextFrame()->updateUndo();
2971
void PropertiesPalette::setLsp(double r)
2973
if (!m_ScMW || m_ScMW->scriptIsRunning())
2975
bool tmp = HaveItem;
2977
LineSp->setValue(r);
2978
const ParagraphStyle& curStyle(tmp && doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2981
setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r);
2982
lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode());
2984
QList<QAction*> actList = lineSpacingPop->actions();
2985
for (int al = 0; al < actList.count(); ++al)
2987
actList[al]->setChecked(false);
2989
actList[curStyle.lineSpacingMode()]->setChecked(true);
2995
void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
2997
if (!m_ScMW || m_ScMW->scriptIsRunning())
2999
bool tmp = HaveItem;
3001
DLeft->setValue(left*m_unitRatio);
3002
DTop->setValue(top*m_unitRatio);
3003
DBottom->setValue(bottom*m_unitRatio);
3004
DRight->setValue(right*m_unitRatio);
3008
void PropertiesPalette::setFontFace(const QString& newFont)
3010
if (!m_ScMW || m_ScMW->scriptIsRunning())
3012
bool tmp = HaveItem;
3014
if (CurItem != NULL)
3015
Fonts->RebuildList(doc, CurItem->isAnnotation());
3016
Fonts->setCurrentFont(newFont);
3021
void PropertiesPalette::setSize(double s)
3023
if (!m_ScMW || m_ScMW->scriptIsRunning())
3025
bool tmp = HaveItem;
3027
Size->setValue(s / 10.0);
3031
void PropertiesPalette::setExtra(double e)
3033
if (!m_ScMW || m_ScMW->scriptIsRunning())
3035
bool tmp = HaveItem;
3037
Extra->setValue(e / 10.0);
3041
void PropertiesPalette::ChangeScaling()
3043
if (!m_ScMW || m_ScMW->scriptIsRunning())
3045
if (FreeScale == sender())
3047
FrameScale->setChecked(false);
3048
FreeScale->setChecked(true);
3049
Aspect->setEnabled(false);
3050
imageXOffsetSpinBox->setEnabled(true);
3051
imageYOffsetSpinBox->setEnabled(true);
3052
imageXScaleSpinBox->setEnabled(true);
3053
imageYScaleSpinBox->setEnabled(true);
3054
imgDpiX->setEnabled(true);
3055
imgDpiY->setEnabled(true);
3057
if (FrameScale == sender())
3059
FrameScale->setChecked(true);
3060
FreeScale->setChecked(false);
3061
Aspect->setEnabled(true);
3062
imageXOffsetSpinBox->setEnabled(false);
3063
imageYOffsetSpinBox->setEnabled(false);
3064
imageXScaleSpinBox->setEnabled(false);
3065
imageYScaleSpinBox->setEnabled(false);
3066
imgDpiX->setEnabled(false);
3067
imgDpiY->setEnabled(false);
3069
if ((HaveDoc) && (HaveItem))
3071
CurItem->setImageScalingMode(FreeScale->isChecked(), Aspect->isChecked());
3072
emit UpdtGui(PageItem::ImageFrame);
3078
void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
3080
if (!m_ScMW || m_ScMW->scriptIsRunning())
3082
bool tmp = HaveItem;
3084
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3085
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3086
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3087
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3088
disconnect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3089
disconnect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3090
if (fabs(scx - scy) > 0.0002)
3092
keepImageWHRatioButton->setChecked(false);
3093
keepImageDPIRatioButton->setChecked(false);
3097
imageXOffsetSpinBox->setValue(x * m_unitRatio * CurItem->imageXScale());
3098
imageYOffsetSpinBox->setValue(y * m_unitRatio * CurItem->imageYScale());
3099
imageXScaleSpinBox->setValue(scx * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
3100
imageYScaleSpinBox->setValue(scy * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
3101
imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3102
imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3106
imageXOffsetSpinBox->setValue(x * m_unitRatio);
3107
imageYOffsetSpinBox->setValue(y * m_unitRatio);
3108
imageXScaleSpinBox->setValue(scx * 100);
3109
imageYScaleSpinBox->setValue(scy * 100);
3110
imgDpiX->setValue(72);
3111
imgDpiY->setValue(72);
3113
connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3114
connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3115
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3116
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3117
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3118
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3122
void PropertiesPalette::setLineWidth(double s)
3124
if (!m_ScMW || m_ScMW->scriptIsRunning())
3126
bool tmp = HaveItem;
3128
LSize->setValue(s*m_unitRatio);
3131
if (CurItem->dashes().count() != 0)
3133
if (CurItem->lineWidth() != 0.0)
3135
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
3136
dashEditor->setEnabled(true);
3139
dashEditor->setEnabled(false);
3145
void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
3147
if (!m_ScMW || m_ScMW->scriptIsRunning())
3149
bool tmp = HaveItem;
3153
if (CurItem->dashes().count() != 0)
3155
LStyle->setCurrentIndex(37);
3156
dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
3159
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3162
LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3166
LEndStyle->setCurrentIndex(0);
3169
LEndStyle->setCurrentIndex(1);
3172
LEndStyle->setCurrentIndex(2);
3175
LEndStyle->setCurrentIndex(0);
3181
LJoinStyle->setCurrentIndex(0);
3184
LJoinStyle->setCurrentIndex(1);
3187
LJoinStyle->setCurrentIndex(2);
3190
LJoinStyle->setCurrentIndex(0);
3196
void PropertiesPalette::setFlop( FirstLineOffsetPolicy f )
3198
if(f == FLOPFontAscent)
3199
flopFontAscent->setChecked(true);
3200
else if(f == FLOPLineSpacing)
3201
flopLineSpacing->setChecked(true);
3203
flopRealHeight->setChecked(true); //It’s historical behaviour.
3206
void PropertiesPalette::setupLineSpacingSpinbox(int mode, double value)
3211
LineSp->setSpecialValueText( tr( "Auto" ) );
3213
LineSp->setSpecialValueText( tr( "Baseline" ) );
3214
LineSp->setMinimum(0);
3215
LineSp->setValue(0);
3216
LineSp->setEnabled(false);
3220
LineSp->setSpecialValueText("");
3221
LineSp->setMinimum(1);
3222
LineSp->setValue(value);
3223
LineSp->setEnabled(true);
3227
void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
3229
if (!m_ScMW || m_ScMW->scriptIsRunning())
3231
bool tmp = HaveItem;
3233
setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
3234
lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
3236
QList<QAction*> actList = lineSpacingPop->actions();
3237
for (int al = 0; al < actList.count(); ++al)
3239
actList[al]->setChecked(false);
3241
actList[newCurrent.lineSpacingMode()]->setChecked(true);
3243
GroupAlign->setStyle(newCurrent.alignment());
3244
minWordTrackingSpinBox->setValue(newCurrent.minWordTracking() * 100.0);
3245
normWordTrackingSpinBox->setValue(newCurrent.charStyle().wordTracking() * 100.0);
3246
minGlyphExtSpinBox->setValue(newCurrent.minGlyphExtension() * 100.0);
3247
maxGlyphExtSpinBox->setValue(newCurrent.maxGlyphExtension() * 100.0);
3249
updateOpticalMargins(newCurrent);
3256
void PropertiesPalette::setStil(int s)
3258
if (!m_ScMW || m_ScMW->scriptIsRunning())
3260
StrokeIcon->setEnabled(false);
3261
TxStroke->setEnabled(false);
3262
PM1->setEnabled(false);
3263
SeStyle->setStyle(s);
3264
if ((s & 4) || (s & 256))
3266
StrokeIcon->setEnabled(true);
3267
TxStroke->setEnabled(true);
3268
PM1->setEnabled(true);
3272
void PropertiesPalette::setAli(int e)
3274
if (!m_ScMW || m_ScMW->scriptIsRunning())
3276
bool tmp = HaveItem;
3278
GroupAlign->setEnabled(true);
3279
GroupAlign->setStyle(e);
3284
void PropertiesPalette::setParStyle(const QString& name)
3286
if (!m_ScMW || m_ScMW->scriptIsRunning())
3288
bool tmp = HaveItem;
3290
paraStyleCombo->setFormat(name);
3295
void PropertiesPalette::setCharStyle(const QString& name)
3297
if (!m_ScMW || m_ScMW->scriptIsRunning())
3299
bool tmp = HaveItem;
3301
charStyleCombo->setFormat(name);
3305
void PropertiesPalette::setOpticalMargins()
3307
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3309
if (CurItem->asTextFrame())
3310
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(PageItem::FRAME);
3311
int omt(ParagraphStyle::OM_None);
3312
// if (optMarginCheckLeftProtruding->isChecked()) omt+=ParagraphStyle::OM_LeftProtruding;
3313
if (optMarginRadioBoth->isChecked())
3314
omt =ParagraphStyle::OM_Default;
3315
else if (optMarginRadioLeft->isChecked())
3316
omt = ParagraphStyle::OM_LeftHangingPunct;
3317
else if (optMarginRadioRight->isChecked())
3318
omt = ParagraphStyle::OM_RightHangingPunct;
3320
doc->itemSelection_SetOpticalMargins(omt);
3321
if (CurItem->asTextFrame())
3322
CurItem->asTextFrame()->updateUndo();
3325
void PropertiesPalette::resetOpticalMargins()
3327
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3329
doc->itemSelection_resetOpticalMargins();
3332
void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
3335
ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins()));
3336
if (omt == ParagraphStyle::OM_Default)
3337
optMarginRadioBoth->setChecked(true);
3338
else if (omt == ParagraphStyle::OM_LeftHangingPunct)
3339
optMarginRadioLeft->setChecked(true);
3340
else if (omt == ParagraphStyle::OM_RightHangingPunct)
3341
optMarginRadioRight->setChecked(true);
3343
optMarginRadioNone->setChecked(true);
3346
void PropertiesPalette::setMinWordTracking()
3348
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3350
if (CurItem->asTextFrame())
3351
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3352
ParagraphStyle newStyle;
3353
newStyle.setMinWordTracking(minWordTrackingSpinBox->value() / 100.0);
3354
doc->itemSelection_ApplyParagraphStyle(newStyle);
3355
if (CurItem->asTextFrame())
3356
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3360
void PropertiesPalette::setNormWordTracking()
3362
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3364
if (CurItem->asTextFrame())
3365
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3366
ParagraphStyle newStyle;
3367
// newStyle.setNormWordTracking(percent / 100.0);
3368
newStyle.charStyle().setWordTracking(normWordTrackingSpinBox->value() / 100.0);
3369
doc->itemSelection_ApplyParagraphStyle(newStyle);
3370
if (CurItem->asTextFrame())
3371
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3374
void PropertiesPalette::setMinGlyphExtension()
3376
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3378
if (CurItem->asTextFrame())
3379
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3380
ParagraphStyle newStyle;
3381
newStyle.setMinGlyphExtension(minGlyphExtSpinBox->value() / 100.0);
3382
doc->itemSelection_ApplyParagraphStyle(newStyle);
3383
if (CurItem->asTextFrame())
3384
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3387
void PropertiesPalette::setMaxGlyphExtension()
3389
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3391
if (CurItem->asTextFrame())
3392
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3393
ParagraphStyle newStyle;
3394
newStyle.setMaxGlyphExtension(maxGlyphExtSpinBox->value() / 100.0);
3395
doc->itemSelection_ApplyParagraphStyle(newStyle);
3396
if (CurItem->asTextFrame())
3397
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3401
void PropertiesPalette::setTScaleV(double e)
3403
if (!m_ScMW || m_ScMW->scriptIsRunning())
3405
bool tmp = HaveItem;
3407
ChScaleV->setValue(e / 10.0);
3411
void PropertiesPalette::NewTScaleV()
3413
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3415
if (CurItem->asTextFrame())
3416
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3417
doc->itemSelection_SetScaleV(qRound(ChScaleV->value() * 10));
3418
if (CurItem->asTextFrame())
3419
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3422
void PropertiesPalette::NewTBase()
3424
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3426
if (CurItem->asTextFrame())
3427
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3428
doc->itemSelection_SetBaselineOffset(qRound(ChBase->value() * 10));
3429
if (CurItem->asTextFrame())
3430
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3433
void PropertiesPalette::setTScale(double e)
3435
if (!m_ScMW || m_ScMW->scriptIsRunning())
3437
bool tmp = HaveItem;
3439
ChScale->setValue(e / 10.0);
3443
void PropertiesPalette::setTBase(double e)
3445
if (!m_ScMW || m_ScMW->scriptIsRunning())
3447
bool tmp = HaveItem;
3449
ChBase->setValue(e / 10.0);
3453
void PropertiesPalette::NewTScale()
3455
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3457
if (CurItem->asTextFrame())
3458
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3459
doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
3460
if (CurItem->asTextFrame())
3461
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3464
void PropertiesPalette::NewX()
3466
if (!m_ScMW || m_ScMW->scriptIsRunning())
3468
if ((HaveDoc) && (HaveItem))
3470
double x,y,w,h, gx, gy, gh, gw, base;
3472
x = Xpos->value() / m_unitRatio;
3473
y = Ypos->value() / m_unitRatio;
3474
w = Width->value() / m_unitRatio;
3475
h = Height->value() / m_unitRatio;
3477
x += doc->rulerXoffset;
3478
y += doc->rulerYoffset;
3479
if (doc->guidesSettings.rulerMode)
3481
x += doc->currentPage()->xOffset();
3482
y += doc->currentPage()->yOffset();
3484
if (doc->m_Selection->isMultipleSelection())
3486
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3487
int bp = RotationGroup->checkedId();
3488
if ((bp == 0) || (bp == 3))
3491
base = gx + gw / 2.0;
3492
else if ((bp == 1) || (bp == 4))
3495
m_ScMW->view->startGroupTransaction();
3496
doc->moveGroup(x - base, 0, true);
3499
m_ScMW->view->endGroupTransaction();
3501
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3506
if ((CurItem->asLine()) && (LMode))
3508
w += doc->rulerXoffset;
3509
h += doc->rulerYoffset;
3510
if (doc->guidesSettings.rulerMode)
3512
w += doc->currentPage()->xOffset();
3513
h += doc->currentPage()->yOffset();
3515
double r = atan2(h-y,w-x)*(180.0/M_PI);
3516
w = sqrt(pow(w-x,2)+pow(h-y,2));
3517
// doc->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
3518
CurItem->setXYPos(x, CurItem->yPos(), true);
3519
CurItem->setRotation(r, true);
3520
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3521
// doc->RotateItem(r, CurItem->ItemNr);
3525
ma.translate(CurItem->xPos(), CurItem->yPos());
3526
ma.rotate(CurItem->rotation());
3527
int bp = RotationGroup->checkedId();
3529
base = CurItem->xPos();
3531
base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
3533
base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
3535
base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
3537
base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
3538
doc->MoveItem(x - base, 0, CurItem, true);
3541
doc->regionsChanged()->update(QRect());
3546
void PropertiesPalette::NewY()
3548
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3551
double x,y,w,h, gx, gy, gh, gw, base;
3553
x = Xpos->value() / m_unitRatio;
3554
y = Ypos->value() / m_unitRatio;
3555
w = Width->value() / m_unitRatio;
3556
h = Height->value() / m_unitRatio;
3558
x += doc->rulerXoffset;
3559
y += doc->rulerYoffset;
3560
if (doc->guidesSettings.rulerMode)
3562
x += doc->currentPage()->xOffset();
3563
y += doc->currentPage()->yOffset();
3565
if (doc->m_Selection->isMultipleSelection())
3567
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3568
int bp = RotationGroup->checkedId();
3569
if ((bp == 0) || (bp == 1))
3572
base = gy + gh / 2.0;
3573
else if ((bp == 3) || (bp == 4))
3576
m_ScMW->view->startGroupTransaction();
3577
doc->moveGroup(0, y - base, true);
3580
m_ScMW->view->endGroupTransaction();
3582
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3587
if ((CurItem->asLine()) && (LMode))
3589
w += doc->rulerXoffset;
3590
h += doc->rulerYoffset;
3591
if (doc->guidesSettings.rulerMode)
3593
w += doc->currentPage()->xOffset();
3594
h += doc->currentPage()->yOffset();
3596
double r = atan2(h-y,w-x)*(180.0/M_PI);
3597
w = sqrt(pow(w-x,2)+pow(h-y,2));
3598
doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
3599
CurItem->setXYPos(CurItem->xPos(), y, true);
3600
CurItem->setRotation(r, true);
3601
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3602
doc->RotateItem(r, CurItem->ItemNr);
3606
ma.translate(CurItem->xPos(), CurItem->yPos());
3607
ma.rotate(CurItem->rotation());
3608
int bp = RotationGroup->checkedId();
3610
base = CurItem->yPos();
3612
base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
3614
base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
3616
base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
3618
base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
3619
doc->MoveItem(0, y - base, CurItem, true);
3622
doc->regionsChanged()->update(QRect());
3626
void PropertiesPalette::NewW()
3628
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3631
double x,y,w,h, gx, gy, gh, gw;
3632
x = Xpos->value() / m_unitRatio;
3633
y = Ypos->value() / m_unitRatio;
3634
w = Width->value() / m_unitRatio;
3635
h = Height->value() / m_unitRatio;
3636
if (doc->m_Selection->isMultipleSelection())
3639
m_ScMW->view->startGroupTransaction();
3640
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3641
if (keepFrameWHRatioButton->isChecked())
3643
// m_ScMW->view->frameResizeHandle = 1;
3644
doc->scaleGroup(w / gw, w / gw, false);
3645
setBH(w, (w / gw) * gh);
3649
// m_ScMW->view->frameResizeHandle = 6;
3650
doc->scaleGroup(w / gw, 1.0, false);
3651
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3656
m_ScMW->view->endGroupTransaction();
3661
bool oldS = CurItem->Sizing;
3662
CurItem->Sizing = false;
3663
CurItem->OldB2 = CurItem->width();
3664
CurItem->OldH2 = CurItem->height();
3665
if (CurItem->asLine())
3669
double r = atan2(h-y,w-x)*(180.0/M_PI);
3670
CurItem->setRotation(r, true);
3671
w = sqrt(pow(w-x,2)+pow(h-y,2));
3673
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3677
double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
3678
if (CurItem->isTableItem)
3680
int rmo = doc->RotMode;
3682
double dist = w - CurItem->width();
3684
PageItem* bb = CurItem;
3685
while (bb->TopLink != 0)
3689
while (bb->BottomLink != 0)
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);
3698
bb = bb->BottomLink;
3701
while (bb2->RightLink != 0)
3703
doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
3704
bb2 = bb2->RightLink;
3706
doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
3708
if (keepFrameWHRatioButton->isChecked())
3710
keepFrameWHRatioButton->setChecked(false);
3711
setBH(w, (w / oldW) * CurItem->height());
3713
keepFrameWHRatioButton->setChecked(true);
3718
if (keepFrameWHRatioButton->isChecked())
3720
setBH(w, (w / oldW) * CurItem->height());
3721
doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
3724
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3727
CurItem->Sizing = oldS;
3730
doc->regionsChanged()->update(QRect());
3733
void PropertiesPalette::NewH()
3735
if (!m_ScMW || m_ScMW->scriptIsRunning())
3737
if ((HaveDoc) && (HaveItem))
3739
double x,y,w,h, gx, gy, gh, gw;
3740
x = Xpos->value() / m_unitRatio;
3741
y = Ypos->value() / m_unitRatio;
3742
w = Width->value() / m_unitRatio;
3743
h = Height->value() / m_unitRatio;
3744
if (doc->m_Selection->isMultipleSelection())
3747
m_ScMW->view->startGroupTransaction();
3748
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3749
if (keepFrameWHRatioButton->isChecked())
3751
// m_ScMW->view->frameResizeHandle = 1;
3752
doc->scaleGroup(h / gh, h / gh, false);
3753
setBH((h / gh) * gw, h);
3757
// m_ScMW->view->frameResizeHandle = 5;
3758
doc->scaleGroup(1.0, h / gh, false);
3759
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3764
m_ScMW->view->endGroupTransaction();
3769
bool oldS = CurItem->Sizing;
3770
CurItem->Sizing = false;
3771
CurItem->OldB2 = CurItem->width();
3772
CurItem->OldH2 = CurItem->height();
3773
if (CurItem->asLine())
3777
double r = atan2(h-y,w-x)*(180.0/M_PI);
3778
CurItem->setRotation(r, true);
3779
w = sqrt(pow(w-x,2)+pow(h-y,2));
3781
doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3785
double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
3786
if (CurItem->isTableItem)
3788
int rmo = doc->RotMode;
3790
double dist = h - CurItem->height();
3792
PageItem* bb = CurItem;
3793
while (bb->LeftLink != 0)
3797
while (bb->RightLink != 0)
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);
3809
while (bb2->BottomLink != 0)
3811
doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
3812
bb2 = bb2->BottomLink;
3814
doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
3816
if (keepFrameWHRatioButton->isChecked())
3818
keepFrameWHRatioButton->setChecked(false);
3819
setBH((h / oldH) * CurItem->width(), h);
3821
keepFrameWHRatioButton->setChecked(true);
3826
if (keepFrameWHRatioButton->isChecked())
3828
setBH((h / oldH) * CurItem->width(), h);
3829
doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
3832
doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
3835
CurItem->Sizing = oldS;
3838
doc->regionsChanged()->update(QRect());
3842
void PropertiesPalette::setRotation()
3844
if (!m_ScMW || m_ScMW->scriptIsRunning())
3846
double gx, gy, gh, gw;
3847
if ((HaveDoc) && (HaveItem))
3850
m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
3851
if (doc->m_Selection->isMultipleSelection())
3853
doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
3854
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3858
doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
3861
for (int i = 0; i < doc->m_Selection->count(); ++i)
3862
doc->m_Selection->itemAt(i)->checkChanges(true);
3863
m_ScMW->view->endGroupTransaction();
3866
doc->regionsChanged()->update(QRect());
3867
RoVal = Rotation->value();
3871
void PropertiesPalette::NewCornerRadius()
3873
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3875
CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
3876
m_ScMW->view->SetFrameRounded();
3878
doc->regionsChanged()->update(QRect());
3881
void PropertiesPalette::NewLineSpacing()
3883
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3885
if (CurItem->asTextFrame())
3886
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
3887
doc->itemSelection_SetLineSpacing(LineSp->value());
3888
if (CurItem->asTextFrame())
3889
CurItem->asTextFrame()->updateUndo();
3892
void PropertiesPalette::HandleGapSwitch()
3894
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3896
setCols(CurItem->Cols, CurItem->ColGap);
3897
dGap->setToolTip("");
3898
// if (colgapLabel->getState())
3899
if (colgapLabel->currentIndex() == 0)
3900
dGap->setToolTip( tr( "Distance between columns" ) );
3902
dGap->setToolTip( tr( "Column width" ) );
3905
void PropertiesPalette::NewCols()
3907
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3909
CurItem->Cols = DCol->value();
3910
setCols(CurItem->Cols, CurItem->ColGap);
3915
void PropertiesPalette::NewPage()
3917
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3919
bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
3920
CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
3922
CurItem->loadImage(CurItem->externalFile(), true);
3926
void PropertiesPalette::NewGap()
3928
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3930
if (colgapLabel->currentIndex() == 0)
3931
CurItem->ColGap = dGap->value() / m_unitRatio;
3932
else if (CurItem->Cols > 1)
3935
if (CurItem->lineColor() != CommonStrings::None)
3936
lineCorr = CurItem->lineWidth();
3939
double newWidth = dGap->value() / m_unitRatio;
3940
double newGap = qMax(((CurItem->width() - CurItem->textToFrameDistLeft() - CurItem->textToFrameDistRight() - lineCorr) - (newWidth * CurItem->Cols)) / (CurItem->Cols - 1), 0.0);
3941
CurItem->ColGap = newGap;
3947
void PropertiesPalette::NewSize()
3949
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3951
if (CurItem->asTextFrame())
3952
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3953
doc->itemSelection_SetFontSize(qRound(Size->value()*10.0));
3954
if (CurItem->asTextFrame())
3955
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3958
void PropertiesPalette::NewTracking()
3960
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3962
if (CurItem->asTextFrame())
3963
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3964
doc->itemSelection_SetTracking(qRound(Extra->value() * 10.0));
3965
if (CurItem->asTextFrame())
3966
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3969
void PropertiesPalette::NewLocalXY()
3971
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3973
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3976
void PropertiesPalette::NewLocalSC()
3978
if (!m_ScMW || m_ScMW->scriptIsRunning())
3980
if ((HaveDoc) && (HaveItem))
3982
/*doc->itemSelection_SetImageScale(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0);
3983
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3985
//CB Dont pass in the scale to the offset change as its taken from the new scale
3986
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);
3987
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3988
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3989
imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3990
imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3991
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3992
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3996
void PropertiesPalette::NewLocalDpi()
3998
if (!m_ScMW || m_ScMW->scriptIsRunning())
4000
if ((HaveDoc) && (HaveItem))
4003
doc->itemSelection_SetImageScale(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value());
4004
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
4006
//CB Dont pass in the scale to the offset change as its taken from the new scale
4007
doc->itemSelection_SetImageScaleAndOffset(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value(), imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
4008
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4009
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4010
imageXScaleSpinBox->setValue(CurItem->imageXScale() * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
4011
imageYScaleSpinBox->setValue(CurItem->imageYScale() * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
4012
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4013
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4017
void PropertiesPalette::handleImageEffects()
4019
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4021
m_ScMW->ImageEffects();
4024
void PropertiesPalette::handleExtImgProperties()
4026
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4028
m_ScMW->view->editExtendedImageProperties();
4032
void PropertiesPalette::NewLineWidth()
4034
if (!m_ScMW || m_ScMW->scriptIsRunning())
4036
if ((HaveDoc) && (HaveItem))
4038
double oldL = CurItem->lineWidth();
4039
doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
4040
if (CurItem->dashes().count() != 0)
4042
if ((oldL != 0.0) && (CurItem->lineWidth() != 0.0))
4044
for (int a = 0; a < CurItem->DashValues.count(); a++)
4046
CurItem->DashValues[a] = CurItem->DashValues[a] / oldL * CurItem->lineWidth();
4048
CurItem->setDashOffset(CurItem->dashOffset() / oldL * CurItem->lineWidth());
4050
if (CurItem->lineWidth() != 0.0)
4052
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4053
dashEditor->setEnabled(true);
4056
dashEditor->setEnabled(false);
4058
// emit DocChanged();
4062
void PropertiesPalette::setStartArrow(int id)
4064
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4066
doc->itemSelection_ApplyArrowHead(id,-1);
4069
void PropertiesPalette::setEndArrow(int id)
4071
if (!m_ScMW || m_ScMW->scriptIsRunning())
4073
if ((HaveDoc) && (HaveItem))
4074
doc->itemSelection_ApplyArrowHead(-1, id);
4077
void PropertiesPalette::NewLineStyle()
4079
if (!m_ScMW || m_ScMW->scriptIsRunning())
4081
if ((HaveDoc) && (HaveItem))
4083
if (LStyle->currentIndex() == 37)
4085
if (CurItem->dashes().count() == 0)
4087
if ((CurItem->lineStyle() == 0) || (CurItem->lineStyle() == 1))
4089
CurItem->DashValues.append(4.0 * qMax(CurItem->lineWidth(), 1.0));
4090
CurItem->DashValues.append(2.0 * qMax(CurItem->lineWidth(), 1.0));
4093
getDashArray(CurItem->lineStyle(), qMax(CurItem->lineWidth(), 1.0), CurItem->DashValues);
4095
if (CurItem->lineWidth() != 0.0)
4096
dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4099
dashEditor->setEnabled(false);
4100
dashEditor->setDashValues(CurItem->dashes(), 1.0, CurItem->dashOffset());
4107
CurItem->DashValues.clear();
4109
doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
4114
void PropertiesPalette::dashChange()
4116
if (!m_ScMW || m_ScMW->scriptIsRunning())
4118
if ((HaveDoc) && (HaveItem))
4120
if (CurItem->lineWidth() != 0.0)
4122
CurItem->setDashes(dashEditor->getDashValues(CurItem->lineWidth()));
4123
CurItem->setDashOffset(dashEditor->Offset->value() * CurItem->lineWidth());
4130
void PropertiesPalette::NewLineMode()
4132
if (!m_ScMW || m_ScMW->scriptIsRunning())
4134
if (LineMode->currentIndex() == 0)
4136
xposLabel->setText( tr( "&X-Pos:" ) );
4137
widthLabel->setText( tr( "&Width:" ) );
4138
yposLabel->setText( tr( "&Y-Pos:" ) );
4139
heightLabel->setText( tr( "&Height:" ) );
4140
Rotation->setEnabled(true);
4141
Height->setEnabled(false);
4146
xposLabel->setText( tr( "&X1:" ) );
4147
widthLabel->setText( tr( "X&2:" ) );
4148
yposLabel->setText( tr( "Y&1:" ) );
4149
heightLabel->setText( tr( "&Y2:" ) );
4150
Rotation->setEnabled(false);
4151
Height->setEnabled(true);
4154
setBH(CurItem->width(), CurItem->height());
4160
void PropertiesPalette::NewLineJoin()
4162
if (!m_ScMW || m_ScMW->scriptIsRunning())
4164
Qt::PenJoinStyle c = Qt::MiterJoin;
4165
switch (LJoinStyle->currentIndex())
4177
if ((HaveDoc) && (HaveItem))
4178
doc->itemSelection_SetLineJoin(c);
4181
void PropertiesPalette::NewLineEnd()
4183
if (!m_ScMW || m_ScMW->scriptIsRunning())
4185
Qt::PenCapStyle c = Qt::FlatCap;
4186
switch (LEndStyle->currentIndex())
4198
if ((HaveDoc) && (HaveItem))
4199
doc->itemSelection_SetLineEnd(c);
4202
void PropertiesPalette::ToggleKette()
4204
if (!m_ScMW || m_ScMW->scriptIsRunning())
4206
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4207
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4208
if (keepImageWHRatioButton->isChecked())
4210
imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4212
keepImageDPIRatioButton->setChecked(true);
4215
keepImageDPIRatioButton->setChecked(false);
4216
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4217
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4220
void PropertiesPalette::HChange()
4222
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4223
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4224
if (keepImageWHRatioButton->isChecked())
4225
imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4227
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4228
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4231
void PropertiesPalette::VChange()
4233
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4234
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4235
if (keepImageWHRatioButton->isChecked())
4236
imageXScaleSpinBox->setValue(imageYScaleSpinBox->value());
4238
connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4239
connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4242
void PropertiesPalette::ToggleKetteD()
4244
if (!m_ScMW || m_ScMW->scriptIsRunning())
4246
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4247
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4248
if (keepImageDPIRatioButton->isChecked())
4250
imgDpiY->setValue(imgDpiX->value());
4252
keepImageWHRatioButton->setChecked(true);
4255
keepImageWHRatioButton->setChecked(false);
4256
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4257
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4260
void PropertiesPalette::HChangeD()
4262
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4263
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4264
if (keepImageDPIRatioButton->isChecked())
4265
imgDpiY->setValue(imgDpiX->value());
4267
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4268
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4271
void PropertiesPalette::VChangeD()
4273
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4274
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4275
if (keepImageDPIRatioButton->isChecked())
4276
imgDpiX->setValue(imgDpiY->value());
4278
connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4279
connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4282
void PropertiesPalette::NewAlignement(int a)
4284
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4286
if (CurItem->asTextFrame())
4287
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
4288
doc->itemSelection_SetAlignment(a);
4289
if (CurItem->asTextFrame())
4290
CurItem->asTextFrame()->updateUndo();
4293
void PropertiesPalette::setTypeStyle(int s)
4295
if (!m_ScMW || m_ScMW->scriptIsRunning())
4297
if (CurItem->asTextFrame())
4298
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4300
if (CurItem->asTextFrame())
4301
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4304
void PropertiesPalette::newShadowOffs()
4306
if ((HaveDoc) && (HaveItem))
4308
if (CurItem->asTextFrame())
4309
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4310
int x = qRound(SeStyle->ShadowVal->Xoffset->value() * 10.0);
4311
int y = qRound(SeStyle->ShadowVal->Yoffset->value() * 10.0);
4312
doc->itemSelection_SetShadowOffsets(x, y);
4313
if (CurItem->asTextFrame())
4314
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4318
void PropertiesPalette::setShadowOffs(double x, double y)
4320
if (!m_ScMW || m_ScMW->scriptIsRunning())
4322
disconnect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4323
disconnect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4324
SeStyle->ShadowVal->Xoffset->setValue(x / 10.0);
4325
SeStyle->ShadowVal->Yoffset->setValue(y / 10.0);
4326
connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4327
connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4330
void PropertiesPalette::newUnderline()
4332
if ((HaveDoc) && (HaveItem))
4334
if (CurItem->asTextFrame())
4335
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4336
int x = qRound(SeStyle->UnderlineVal->LPos->value() * 10.0);
4337
int y = qRound(SeStyle->UnderlineVal->LWidth->value() * 10.0);
4338
doc->itemSelection_SetUnderline(x, y);
4339
if (CurItem->asTextFrame())
4340
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4344
void PropertiesPalette::setUnderline(double p, double w)
4346
if (!m_ScMW || m_ScMW->scriptIsRunning())
4348
disconnect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4349
disconnect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4350
SeStyle->UnderlineVal->LPos->setValue(p / 10.0);
4351
SeStyle->UnderlineVal->LWidth->setValue(w / 10.0);
4352
connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4353
connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4356
void PropertiesPalette::newStrike()
4358
if ((HaveDoc) && (HaveItem))
4360
if (CurItem->asTextFrame())
4361
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4362
int x = qRound(SeStyle->StrikeVal->LPos->value() * 10.0);
4363
int y = qRound(SeStyle->StrikeVal->LWidth->value() * 10.0);
4364
doc->itemSelection_SetStrikethru(x, y);
4365
if (CurItem->asTextFrame())
4366
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4370
void PropertiesPalette::setStrike(double p, double w)
4372
if (!m_ScMW || m_ScMW->scriptIsRunning())
4374
disconnect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4375
disconnect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4376
SeStyle->StrikeVal->LPos->setValue(p / 10.0);
4377
SeStyle->StrikeVal->LWidth->setValue(w / 10.0);
4378
connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4379
connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4382
void PropertiesPalette::setOutlineW(double x)
4384
if (!m_ScMW || m_ScMW->scriptIsRunning())
4386
disconnect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4387
SeStyle->OutlineVal->LWidth->setValue(x / 10.0);
4388
connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4391
void PropertiesPalette::newOutlineW()
4393
int x = qRound(SeStyle->OutlineVal->LWidth->value() * 10.0);
4394
if ((HaveDoc) && (HaveItem))
4396
if (CurItem->asTextFrame())
4397
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4398
doc->itemSelection_SetOutlineWidth(x);
4399
if (CurItem->asTextFrame())
4400
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4404
void PropertiesPalette::DoLower()
4406
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4408
m_ScMW->view->LowerItem();
4411
void PropertiesPalette::DoRaise()
4413
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4415
m_ScMW->view->RaiseItem();
4418
void PropertiesPalette::DoFront()
4420
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4422
m_ScMW->view->ToFront();
4425
void PropertiesPalette::DoBack()
4427
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4429
m_ScMW->view->ToBack();
4432
void PropertiesPalette::NewRotMode(int m)
4434
if (!m_ScMW || m_ScMW->scriptIsRunning())
4436
double inX, inY, gx, gy, gh, gw;
4439
if ((HaveDoc) && (HaveItem))
4443
if (doc->m_Selection->isMultipleSelection())
4445
doc->m_Selection->setGroupRect();
4446
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
4449
m_ScMW->view->RCenter = FPoint(gx, gy);
4455
m_ScMW->view->RCenter = FPoint(gx+gw, gy);
4461
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
4462
inX = gx + gw / 2.0;
4463
inY = gy + gh / 2.0;
4467
m_ScMW->view->RCenter = FPoint(gx, gy+gh);
4473
m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
4477
inX -= doc->rulerXoffset;
4478
inY -= doc->rulerYoffset;
4479
if (doc->guidesSettings.rulerMode)
4481
inX -= doc->currentPage()->xOffset();
4482
inY -= doc->currentPage()->yOffset();
4484
Xpos->setValue(inX*m_unitRatio);
4485
Ypos->setValue(inY*m_unitRatio);
4492
b = CurItem->width();
4493
h = CurItem->height();
4494
r = CurItem->rotation();
4495
// ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getYOffsetForPage(CurItem->OwnPage));
4496
ma.translate(CurItem->xPos(), CurItem->yPos());
4498
int bp = RotationGroup->checkedId();
4500
n = FPoint(0.0, 0.0);
4504
n = FPoint(b / 2.0, h / 2.0);
4509
inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
4510
inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
4511
inX -= doc->rulerXoffset;
4512
inY -= doc->rulerYoffset;
4513
if (doc->guidesSettings.rulerMode)
4515
inX -= doc->currentPage()->xOffset();
4516
inY -= doc->currentPage()->yOffset();
4518
Xpos->setValue(inX*m_unitRatio);
4519
Ypos->setValue(inY*m_unitRatio);
4521
if (CurItem->itemType() == PageItem::ImageFrame)
4523
if (!FreeScale->isChecked())
4525
CurItem->AdjustPictScale();
4527
disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4528
disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4529
imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
4530
imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
4531
connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4532
connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4540
void PropertiesPalette::DoFlow()
4542
PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
4543
if (!m_ScMW || m_ScMW->scriptIsRunning())
4545
if ((HaveDoc) && (HaveItem))
4547
if (CurItem->isGroupControl)
4549
if (textFlowDisabled2->isChecked())
4550
mode = PageItem::TextFlowDisabled;
4551
if (textFlowUsesFrameShape2->isChecked())
4552
mode = PageItem::TextFlowUsesFrameShape;
4553
if (textFlowUsesBoundingBox2->isChecked())
4554
mode = PageItem::TextFlowUsesBoundingBox;
4555
if (textFlowUsesContourLine2->isChecked())
4556
mode = PageItem::TextFlowUsesContourLine;
4557
if (textFlowUsesImageClipping2->isChecked())
4558
mode = PageItem::TextFlowUsesImageClipping;
4562
if (textFlowDisabled->isChecked())
4563
mode = PageItem::TextFlowDisabled;
4564
if (textFlowUsesFrameShape->isChecked())
4565
mode = PageItem::TextFlowUsesFrameShape;
4566
if (textFlowUsesBoundingBox->isChecked())
4567
mode = PageItem::TextFlowUsesBoundingBox;
4568
if (textFlowUsesContourLine->isChecked())
4569
mode = PageItem::TextFlowUsesContourLine;
4570
if (textFlowUsesImageClipping->isChecked())
4571
mode = PageItem::TextFlowUsesImageClipping;
4573
CurItem->setTextFlowMode(mode);
4574
m_ScMW->view->DrawNew();
4579
void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
4581
if (!m_ScMW || m_ScMW->scriptIsRunning())
4583
if ((HaveDoc) && (HaveItem))
4585
if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
4588
if (UndoManager::undoEnabled())
4590
// Store shape info in this form:
4591
// CHANGE_SHAPE_TYPE - ID of the undo operation
4592
// OLD_FRAME_TYPE - original frame type
4593
// NEW_FRAME_TYPE - change of frame type
4594
// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
4595
ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
4596
is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
4597
is->set("OLD_FRAME_TYPE", CurItem->FrameType);
4598
is->set("NEW_FRAME_TYPE", f);
4599
// HACK: this is propably Evil Code (TM). I have to find better way...
4600
FPointArray newShape;
4602
for (int i = 0; i < c/2; ++i)
4604
double x = CurItem->width() * vals[ix] / 100.0;
4605
double y = CurItem->height() * vals[ix+1] / 100.0;
4606
newShape.addPoint(x, y);
4609
// HACK: end of hack
4610
is->setItem(qMakePair(CurItem->shape(), newShape));
4611
UndoManager::instance()->action(CurItem, is);
4617
CurItem->SetRectFrame();
4618
doc->setRedrawBounding(CurItem);
4621
CurItem->SetOvalFrame();
4622
doc->setRedrawBounding(CurItem);
4625
CurItem->SetFrameShape(c, (double*)vals);
4626
doc->setRedrawBounding(CurItem);
4627
CurItem->FrameType = f+2;
4630
//qt4 m_ScMW->SCustom->setPixmap(m_ScMW->SCustom->getIconPixmap(f));
4633
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
4635
RoundRect->setEnabled(f == 0);
4638
CurItem->convertTo(PageItem::Polygon);
4640
RoundRect->setEnabled(f == 0);
4641
// TabStack->setCurrentIndex(1);
4645
void PropertiesPalette::handleShapeEdit()
4647
if (!m_ScMW || m_ScMW->scriptIsRunning())
4649
if ((HaveDoc) && (HaveItem))
4651
tmpSelection->clear();
4652
m_ScMW->view->requestMode(modeEditClip);
4653
RoundRect->setEnabled(false);
4657
void PropertiesPalette::NewTDist()
4659
if (!m_ScMW || m_ScMW->scriptIsRunning())
4661
if ((HaveDoc) && (HaveItem))
4663
CurItem->setTextToFrameDist(DLeft->value() / m_unitRatio, DRight->value() / m_unitRatio, DTop->value() / m_unitRatio, DBottom->value() / m_unitRatio);
4664
setCols(CurItem->Cols, CurItem->ColGap);
4670
void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2)
4672
if (!m_ScMW || m_ScMW->scriptIsRunning())
4674
if ((HaveDoc) && (HaveItem))
4676
CurItem->GrStartX = x1 / m_unitRatio;
4677
CurItem->GrStartY = y1 / m_unitRatio;
4678
CurItem->GrEndX = x2 / m_unitRatio;
4679
CurItem->GrEndY = y2 / m_unitRatio;
4681
QRectF upRect(QPointF(CurItem->GrStartX, CurItem->GrStartY), QPointF(CurItem->GrEndX, CurItem->GrEndY));
4682
upRect.translate(CurItem->xPos(), CurItem->yPos());
4683
doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
4688
void PropertiesPalette::toggleGradientEdit()
4690
if (!m_ScMW || m_ScMW->scriptIsRunning())
4692
if ((HaveDoc) && (HaveItem))
4694
if (Cpal->gradEditButton->isChecked())
4695
m_ScMW->view->requestMode(modeEditGradientVectors);
4697
m_ScMW->view->requestMode(modeNormal);
4698
m_ScMW->view->RefreshGradient(CurItem);
4702
void PropertiesPalette::NewTFont(QString c)
4704
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4709
void PropertiesPalette::DoRevert()
4711
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4713
doc->itemSelection_SetItemTextReversed(Revert->isChecked());
4717
void PropertiesPalette::doClearCStyle()
4719
if (!m_ScMW || m_ScMW->scriptIsRunning())
4723
if (CurItem->asTextFrame())
4724
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4725
doc->itemSelection_EraseCharStyle();
4726
if (CurItem->asTextFrame())
4727
CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit? PageItem::PARAMSEL : PageItem::PARAMFULL);
4732
void PropertiesPalette::doClearPStyle()
4734
if (!m_ScMW || m_ScMW->scriptIsRunning())
4738
if (CurItem->asTextFrame())
4740
// CurItem->asTextFrame()->ExpandParSel();
4741
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
4742
// CurItem->asTextFrame()->lastAction4Paragraph = true;
4744
doc->itemSelection_EraseParagraphStyle();
4745
CharStyle emptyCStyle;
4746
doc->itemSelection_SetCharStyle(emptyCStyle);
4747
if (CurItem->asTextFrame())
4748
CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit ? PageItem::PARAMSEL : PageItem::PARAMFULL);
4753
void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
4755
if (!m_ScMW || m_ScMW->scriptIsRunning())
4757
disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4758
StyledLine->clear();
4761
QMap<QString,multiLine>::Iterator it;
4762
for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
4763
StyledLine->addItem( new LineFormatItem(dd, it.value(), it.key()) );
4764
StyledLine->sortItems();
4765
StyledLine->insertItem( 0, tr("No Style"));
4766
if (StyledLine->currentItem())
4767
StyledLine->currentItem()->setSelected(false);
4769
connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4772
void PropertiesPalette::SetSTline(QListWidgetItem *c)
4774
if (!m_ScMW || m_ScMW->scriptIsRunning())
4778
bool setter = (c->listWidget()->currentRow() == 0);
4779
doc->itemSelection_SetNamedLineStyle(setter ? QString("") : c->text());
4780
LStyle->setEnabled(setter);
4781
LSize->setEnabled(setter);
4782
LJoinStyle->setEnabled(setter);
4783
LEndStyle->setEnabled(setter);
4786
void PropertiesPalette::updateColorList()
4788
if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
4790
Cpal->SetColors(doc->PageColors);
4791
Cpal->SetPatterns(&doc->docPatterns);
4792
assert (doc->PageColors.document());
4793
TxFill->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
4794
TxStroke->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, false);
4795
TxFill->view()->setMinimumWidth(TxFill->view()->maximumViewportSize().width() + 24);
4796
TxStroke->view()->setMinimumWidth(TxStroke->view()->maximumViewportSize().width() + 24);
4799
void PropertiesPalette::updateCmsList()
4801
if (!m_ScMW || m_ScMW->scriptIsRunning())
4805
if (ScCore->haveCMS() && doc->CMSSettings.CMSinUse)
4812
disconnect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4813
disconnect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4817
if (CurItem->pixm.imgInfo.colorspace == ColorSpaceCMYK)
4819
ProfilesL::Iterator itP;
4820
ProfilesL::Iterator itPend=ScCore->InputProfilesCMYK.end();
4821
for (itP = ScCore->InputProfilesCMYK.begin(); itP != itPend; ++itP)
4823
InputP->addItem(itP.key());
4824
if (itP.key() == CurItem->IProfile)
4825
InputP->setCurrentIndex(InputP->count()-1);
4827
if (!ScCore->InputProfilesCMYK.contains(CurItem->IProfile))
4829
InputP->addItem(CurItem->IProfile);
4830
InputP->setCurrentIndex(InputP->count()-1);
4834
if (!CurItem->EmProfile.isEmpty())
4835
InputP->addItem(CurItem->EmProfile);
4840
ProfilesL::Iterator itP;
4841
ProfilesL::Iterator itPend=ScCore->InputProfiles.end();
4842
for (itP = ScCore->InputProfiles.begin(); itP != itPend; ++itP)
4844
InputP->addItem(itP.key());
4845
if (itP.key() == CurItem->IProfile)
4846
InputP->setCurrentIndex(InputP->count()-1);
4848
if (!ScCore->InputProfiles.contains(CurItem->IProfile))
4850
InputP->addItem(CurItem->IProfile);
4851
InputP->setCurrentIndex(InputP->count()-1);
4855
if (!CurItem->EmProfile.isEmpty())
4856
InputP->addItem(CurItem->EmProfile);
4859
MonitorI->setCurrentIndex(CurItem->IRender);
4861
connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4862
connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4866
void PropertiesPalette::ChangeProfile(const QString& prn)
4868
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4870
doc->itemSelection_SetColorProfile(InputP->currentText());
4873
void PropertiesPalette::ChangeIntent()
4875
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4877
doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
4880
void PropertiesPalette::ShowCMS()
4882
if (!m_ScMW || m_ScMW->scriptIsRunning())
4887
GroupBoxCM->setVisible(ScCore->haveCMS() && doc->CMSSettings.CMSinUse);
4890
void PropertiesPalette::newTxtFill()
4892
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4894
if (CurItem->asTextFrame())
4895
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4896
doc->itemSelection_SetFillColor(TxFill->currentColor());
4897
if (CurItem->asTextFrame())
4898
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4901
void PropertiesPalette::newTxtStroke()
4903
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4905
if (CurItem->asTextFrame())
4906
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4907
doc->itemSelection_SetStrokeColor(TxStroke->currentColor());
4908
if (CurItem->asTextFrame())
4909
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4913
void PropertiesPalette::setActShade()
4915
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4918
if (CurItem->asTextFrame())
4919
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4920
if (PM1 == sender())
4922
b = PM1->getValue();
4923
doc->itemSelection_SetStrokeShade(b);
4927
b = PM2->getValue();
4928
doc->itemSelection_SetFillShade(b);
4930
if (CurItem->asTextFrame())
4931
CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4934
void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
4936
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4938
ColorList::Iterator it;
4940
PM2->setValue(qRound(shb));
4941
PM1->setValue(qRound(shp));
4942
if ((b != CommonStrings::None) && (!b.isEmpty()))
4945
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4952
TxFill->setCurrentIndex(c);
4954
if ((p != CommonStrings::None) && (!p.isEmpty()))
4957
for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4964
TxStroke->setCurrentIndex(c);
4967
void PropertiesPalette::handleLock()
4969
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4971
m_ScMW->scrActions["itemLock"]->toggle();
4974
void PropertiesPalette::handleLockSize()
4976
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4978
m_ScMW->scrActions["itemLockSize"]->toggle();
4981
void PropertiesPalette::handlePrint()
4983
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4985
m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
4988
void PropertiesPalette::handleFlipH()
4990
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4992
m_ScMW->scrActions["itemFlipH"]->toggle();
4994
if ((HaveDoc) && (HaveItem))
4996
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5005
void PropertiesPalette::handleFlipV()
5007
if (!m_ScMW || m_ScMW->scriptIsRunning())
5009
m_ScMW->scrActions["itemFlipV"]->toggle();
5011
if ((HaveDoc) && (HaveItem))
5013
if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5023
void PropertiesPalette::handlePathType()
5025
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5027
CurItem->textPathType = pathTextType->currentIndex();
5032
void PropertiesPalette::handlePathFlip()
5034
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5036
CurItem->textPathFlipped = flippedPathText->isChecked();
5037
CurItem->updatePolyClip();
5042
void PropertiesPalette::handlePathLine()
5044
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5046
CurItem->PoShow = showcurveCheckBox->isChecked();
5051
void PropertiesPalette::handlePathDist()
5053
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5055
CurItem->setTextToFrameDistLeft(Dist->value());
5056
doc->AdjustItemSize(CurItem);
5057
CurItem->updatePolyClip();
5062
void PropertiesPalette::handlePathOffs()
5064
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5066
CurItem->BaseOffs = -LineW->value();
5067
doc->AdjustItemSize(CurItem);
5068
CurItem->updatePolyClip();
5073
void PropertiesPalette::handleFillRule()
5075
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5077
CurItem->fillRule = EvenOdd->isChecked();
5079
qDebug() << "PropertiesPalette::handleFillRule() updateUNDO";
5080
if (CurItem->asTextFrame())
5081
CurItem->asTextFrame()->updateUndo();
5086
void PropertiesPalette::handleOverprint()
5088
if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5090
doc->itemSelection_SetOverprint(Overprint->isChecked());
5093
void PropertiesPalette::NewName()
5095
if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5097
QString NameOld = CurItem->itemName();
5098
QString NameNew = NameEdit->text();
5099
if (NameNew.isEmpty())
5101
NameEdit->setText(NameOld);
5105
for (int b = 0; b < doc->Items->count(); ++b)
5107
if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
5115
QMessageBox::warning(this, CommonStrings::trWarning, "<qt>"+ tr("Name \"%1\" isn't unique.<br/>Please choose another.").arg(NameNew)+"</qt>", CommonStrings::tr_OK);
5116
NameEdit->setText(NameOld);
5117
NameEdit->setFocus();
5121
if (CurItem->itemName() != NameEdit->text())
5123
CurItem->setItemName(NameEdit->text());
5129
void PropertiesPalette::fillLangCombo(QMap<QString,QString> langMap)
5131
QStringList sortList;
5132
QMap<QString,QString>::Iterator it;
5133
if (!m_ScMW || m_ScMW->scriptIsRunning())
5136
for (it = langMap.begin(); it != langMap.end(); ++it)
5137
sortList.push_back(it.value());
5138
langCombo->addItems(sortQStringList(sortList));
5139
QListView *tmpView = dynamic_cast<QListView*>(langCombo->view()); Q_ASSERT(tmpView);
5140
int tmpWidth = tmpView->sizeHintForColumn(0);
5142
tmpView->setMinimumWidth(tmpWidth + 24);
5145
void PropertiesPalette::NewLanguage()
5147
if ((HaveDoc) && (HaveItem))
5149
CurItem->doc()->Language = (m_ScMW->GetLang(langCombo->currentText()));
5154
void PropertiesPalette::ManageTabs()
5156
if ((HaveDoc) && (HaveItem))
5158
PageItem_TextFrame *i2=CurItem->asTextFrame();
5161
const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
5162
TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
5165
if (CurItem->asTextFrame())
5167
CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
5168
// CurItem->asTextFrame()->lastAction4Paragraph = true;
5170
if (doc->appMode != modeEdit)
5172
ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
5173
newStyle.setTabValues(dia->tmpTab);
5174
CurItem->itemText.setDefaultStyle(newStyle);
5178
ParagraphStyle newStyle;
5179
newStyle.setTabValues(dia->tmpTab);
5180
doc->itemSelection_ApplyParagraphStyle(newStyle);
5183
if (CurItem->asTextFrame())
5184
CurItem->asTextFrame()->updateUndo();
5192
void PropertiesPalette::HandleTLines()
5194
if ((HaveDoc) && (HaveItem))
5196
CurItem->TopLine = TopLine->isChecked();
5197
CurItem->LeftLine = LeftLine->isChecked();
5198
CurItem->RightLine = RightLine->isChecked();
5199
CurItem->BottomLine = BottomLine->isChecked();
5205
void PropertiesPalette::installSniffer(ScrSpinBox *spinBox)
5207
const QList<QObject*> list = spinBox->children();
5208
if (!list.isEmpty())
5210
QListIterator<QObject*> it(list);
5212
while (it.hasNext())
5215
obj->installEventFilter(userActionSniffer);
5220
bool PropertiesPalette::userActionOn()
5222
return _userActionOn;
5225
void PropertiesPalette::spinboxStartUserAction()
5227
// qDebug("%s", "sniffer: spinbox start action");
5228
_userActionOn = true;
5231
void PropertiesPalette::spinboxFinishUserAction()
5233
// qDebug("%s", "sniffer: spinbox finish action");
5234
_userActionOn = false;
5236
for (int i = 0; i < doc->m_Selection->count(); ++i)
5237
doc->m_Selection->itemAt(i)->checkChanges(true);
5238
if (m_ScMW->view->groupTransactionStarted())
5240
m_ScMW->view->endGroupTransaction();
5244
void PropertiesPalette::changeEvent(QEvent *e)
5246
if (e->type() == QEvent::LanguageChange)
5251
QWidget::changeEvent(e);
5254
void PropertiesPalette::languageChange()
5256
setWindowTitle( tr("Properties"));
5258
TabStack->setItemText(idXYZItem, tr("X, Y, &Z"));
5259
TabStack->setItemText(idTextItem, tr("&Text"));
5260
TabStack->setItemText(idImageItem, tr("&Image"));
5261
TabStack->setItemText(idShapeItem, tr("&Shape"));
5262
TabStack->setItemText(idLineItem, tr("&Line"));
5263
TabStack->setItemText(idColorsItem, tr("&Colors"));
5264
TabStack->setItemText(idGroupItem, tr("&Group"));
5266
NameGroup->setTitle( tr("Name"));
5267
GeoGroup->setTitle( tr("Geometry"));
5268
xposLabel->setText( tr("&X-Pos:"));
5269
yposLabel->setText( tr("&Y-Pos:"));
5270
widthLabel->setText( tr("&Width:"));
5271
heightLabel->setText( tr("&Height:"));
5272
rotationLabel->setText( tr("&Rotation:"));
5273
basepointLabel->setText( tr("Basepoint:"));
5274
LayerGroup->setTitle( tr("Level"));
5275
SRect->setText( tr("Shape:"));
5276
// EditShape->setText( tr("&Edit Shape..."));
5277
// EditShape2->setText( tr("&Edit Shape..."));
5278
EditShape->setText( tr("&Edit..."));
5279
EditShape2->setText( tr("&Edit..."));
5280
SRect2->setText( tr("Shape:"));
5281
TransGroup->setTitle( tr( "Transparency Settings" ));
5282
TransTxt->setText( tr( "Opacity:" ) );
5283
TransTxt2->setText( tr( "Blend Mode:" ) );
5284
int oldBlendMode = blendMode->currentIndex();
5286
blendMode->addItem( tr("Normal"));
5287
blendMode->addItem( tr("Darken"));
5288
blendMode->addItem( tr("Lighten"));
5289
blendMode->addItem( tr("Multiply"));
5290
blendMode->addItem( tr("Screen"));
5291
blendMode->addItem( tr("Overlay"));
5292
blendMode->addItem( tr("Hard Light"));
5293
blendMode->addItem( tr("Soft Light"));
5294
blendMode->addItem( tr("Difference"));
5295
blendMode->addItem( tr("Exclusion"));
5296
blendMode->addItem( tr("Color Dodge"));
5297
blendMode->addItem( tr("Color Burn"));
5298
blendMode->addItem( tr("Hue"));
5299
blendMode->addItem( tr("Saturation"));
5300
blendMode->addItem( tr("Color"));
5301
blendMode->setCurrentIndex(oldBlendMode);
5302
rndcornersLabel->setText( tr("R&ound\nCorners:"));
5303
columnsLabel->setText( tr("Colu&mns:"));
5304
int oldcolgapLabel = colgapLabel->currentIndex();
5305
colgapLabel->clear();
5306
colgapLabel->addItem( tr("Gap:"));
5307
colgapLabel->addItem( tr("Width:"));
5308
colgapLabel->setCurrentIndex(oldcolgapLabel);
5309
// colgapLabel->setTexts( tr("&Gap:"), tr("&Width:"));
5310
topLabel->setText( tr("To&p:"));
5311
bottomLabel->setText( tr("&Bottom:"));
5312
leftLabel->setText( tr("&Left:"));
5313
rightLabel->setText( tr("&Right:"));
5314
TabsButton->setText( tr("T&abulators..."));
5315
// Distance2->setTitle( tr("Path Text Properties"));
5316
int oldPathType = pathTextType->currentIndex();
5317
pathTextType->clear();
5318
pathTextType->addItem( tr("Default"));
5319
pathTextType->addItem( tr("Stair Step"));
5320
pathTextType->addItem( tr("Skew"));
5321
pathTextType->setCurrentIndex(oldPathType);
5322
flippedPathText->setText( tr("Flip Text"));
5323
showcurveCheckBox->setText( tr("Show Curve"));
5324
pathTextTypeLabel->setText( tr("Type:"));
5325
startoffsetLabel->setText( tr("Start Offset:"));
5326
distfromcurveLabel->setText( tr("Distance from Curve:"));
5327
Distance3->setTitle( tr("Fill Rule"));
5328
EvenOdd->setText( tr("Even-Odd"));
5329
NonZero->setText( tr("Non Zero"));
5330
textFlowOptions->setTitle( tr("Text &Flow Around Frame"));
5331
textFlowDisabled->setText( tr("Disabled"));
5332
textFlowUsesFrameShape->setText( tr("Use Frame &Shape"));
5333
textFlowUsesBoundingBox->setText( tr("Use &Bounding Box"));
5334
textFlowUsesContourLine->setText( tr("&Use Contour Line"));
5335
textFlowUsesImageClipping->setText( tr("Use Image Clip Path"));
5336
textFlowOptions2->setTitle( tr("Text &Flow Around Frame"));
5337
textFlowDisabled2->setText( tr("Disabled"));
5338
textFlowUsesFrameShape2->setText( tr("Use Frame &Shape"));
5339
textFlowUsesBoundingBox2->setText( tr("Use &Bounding Box"));
5340
textFlowUsesContourLine2->setText( tr("&Use Contour Line"));
5341
textFlowUsesImageClipping2->setText( tr("Use Image Clip Path"));
5342
paraStyleLabel->setText( tr("Paragraph St&yle:"));
5343
charStyleLabel->setText( tr("Character St&yle:"));
5344
// int c=optMarginCombo->currentIndex();
5345
// optMarginCombo->clear();
5346
// optMarginCombo->addItem( CommonStrings::trOpticalMarginsNone );
5348
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftProtruding );
5349
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightProtruding );
5350
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftHangPunct );
5351
//// optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightHangPunct );
5352
// optMarginCombo->addItem( CommonStrings::trOpticalMarginsDefault );
5353
// optMarginCombo->setCurrentIndex(c);
5354
// optMarginCheckLeftProtruding->setText( tr("Left Protruding") );
5355
// optMarginCheckRightProtruding->setText( tr("Right Protruding") );
5356
// optMarginCheckLeftHangPunct->setText( tr("Left Hanging Punctuation") );
5357
// optMarginCheckRightHangPunct->setText( tr("Right Hanging Punctuation") );
5358
optMarginRadioNone->setText( tr("None","optical margins") );
5359
optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
5360
optMarginRadioLeft->setText( tr("Left Only","optical margins") );
5361
optMarginRadioRight->setText( tr("Right Only","optical margins") );
5362
optMarginResetButton->setText( tr("Reset") );
5363
OptMarginsItem->setText(0, tr("Optical Margins"));
5364
wordTrackingLabel->setText( tr("Word Tracking"));
5365
minWordTrackingLabel->setText( tr("Min:"));
5366
normWordTrackingLabel->setText( tr("Norm:"));
5367
glyphExtensionLabel->setText( tr("Glyph Extension"));
5368
minGlyphExtensionLabel->setText( tr("Min:"));
5369
maxGlyphExtensionLabel->setText( tr("Max:"));
5370
colorWidgetsItem->setText(0, tr("Color & Effects"));
5371
advancedWidgetsItem->setText(0, tr("Advanced Settings"));
5372
styleWidgetsItem->setText(0, tr("Style Settings"));
5373
flopItem->setText(0, tr("First Line Offset"));
5374
flopRealHeight->setText( tr("Maximum Ascent"));
5375
flopFontAscent->setText( tr("Font Ascent"));
5376
flopLineSpacing->setText( tr("Line Spacing"));
5377
DistanceItem->setText(0, tr("Columns & Text Distances"));
5378
Distance2Item->setText(0, tr("Path Text Properties"));
5379
imagePageNumberLabel->setText( tr("&Page Number:"));
5380
FreeScale->setText( tr("&Free Scaling"));
5381
imgDPIXLabel->setText( tr("Actual X-DPI:"));
5382
imgDPIYLabel->setText( tr("Actual Y-DPI:"));
5383
xposImgLabel->setText( tr("&X-Pos:"));
5384
yposImgLabel->setText( tr("&Y-Pos:"));
5385
xscaleLabel->setText( tr("X-Sc&ale:"));
5386
yscaleLabel->setText( tr("Y-Scal&e:"));
5387
FrameScale->setText( tr("Scale &To Frame Size"));
5388
Aspect->setText( tr("P&roportional"));
5389
EditEffects->setText( tr("Image Effects"));
5390
EditPSDProps->setText( tr("Extended Image Properties"));
5391
TextCms1->setText( tr("Input Profile:"));
5392
TextCms2->setText( tr("Rendering Intent:"));
5393
// QList<QAction*> actList = lineSpacingPop->actions();
5394
// actList[0]->setText( tr("Fixed Linespacing"));
5395
// actList[1]->setText( tr("Automatic Linespacing"));
5396
// actList[2]->setText( tr("Align to Baseline Grid"));
5397
int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
5398
lineSpacingModeCombo->clear();
5399
lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
5400
lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));
5401
lineSpacingModeCombo->addItem( tr("Align to Baseline Grid"));
5402
lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
5403
int oldMonitorI=MonitorI->currentIndex();
5405
MonitorI->addItem( tr("Perceptual"));
5406
MonitorI->addItem( tr("Relative Colorimetric"));
5407
MonitorI->addItem( tr("Saturation"));
5408
MonitorI->addItem( tr("Absolute Colorimetric"));
5409
MonitorI->setCurrentIndex(oldMonitorI);
5410
int oldLineStyle = LStyle->currentIndex();
5412
LStyle->updateList();
5413
LStyle->addItem( tr("Custom"));
5414
LStyle->setCurrentIndex(oldLineStyle);
5415
int oldLineMode=LineMode->currentIndex();
5417
LineMode->addItem( tr("Left Point"));
5418
LineMode->addItem( tr("End Points"));
5419
LineMode->setCurrentIndex(oldLineMode);
5420
LineModeT->setText( tr("&Basepoint:"));
5421
linetypeLabel->setText( tr("T&ype of Line:"));
5422
startArrowText->setText( tr("Start Arrow:"));
5423
endArrowText->setText( tr("End Arrow:"));
5426
int arrowItem=startArrow->currentIndex();
5427
startArrow->rebuildList(&doc->arrowStyles);
5428
startArrow->setCurrentIndex(arrowItem);
5429
arrowItem=endArrow->currentIndex();
5430
endArrow->rebuildList(&doc->arrowStyles);
5431
endArrow->setCurrentIndex(arrowItem);
5433
linewidthLabel->setText( tr("Line &Width:"));
5434
edgesLabel->setText( tr("Ed&ges:"));
5435
int oldLJoinStyle=LJoinStyle->currentIndex();
5436
LJoinStyle->clear();
5437
LJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
5438
LJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
5439
LJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
5440
LJoinStyle->setCurrentIndex(oldLJoinStyle);
5442
int oldLEndStyle=LEndStyle->currentIndex();
5444
LEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
5445
LEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
5446
LEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
5447
LEndStyle->setCurrentIndex(oldLEndStyle);
5448
endingsLabel->setText( tr("&Endings:"));
5450
TLines->setTitle( tr("Cell Lines"));
5451
TopLine->setText( tr("Line at Top"));
5452
LeftLine->setText( tr("Line at the Left"));
5453
RightLine->setText( tr("Line at the Right "));
5454
BottomLine->setText( tr("Line at Bottom"));
5456
OverP->setTitle( tr("Overprinting"));
5457
KnockOut->setText( tr("Knockout"));
5458
Overprint->setText( tr("Overprint"));
5460
QString pctSuffix=tr(" %");
5461
ChBase->setSuffix(pctSuffix);
5462
ChScale->setSuffix(pctSuffix);
5463
ChScaleV->setSuffix(pctSuffix);
5464
imageXScaleSpinBox->setSuffix(pctSuffix);
5465
imageYScaleSpinBox->setSuffix(pctSuffix);
5466
imgDpiX->setSuffix("");
5467
imgDpiY->setSuffix("");
5468
Extra->setSuffix(pctSuffix);
5469
minWordTrackingSpinBox->setSuffix(pctSuffix);
5470
normWordTrackingSpinBox->setSuffix(pctSuffix);
5471
minGlyphExtSpinBox->setSuffix(pctSuffix);
5472
maxGlyphExtSpinBox->setSuffix(pctSuffix);
5474
QString ptSuffix = tr(" pt");
5475
Dist->setSuffix(ptSuffix);
5476
LineW->setSuffix(ptSuffix);
5477
Size->setSuffix(ptSuffix);
5478
LineSp->setSuffix(ptSuffix);
5480
QString ein = (HaveDoc) ? unitGetSuffixFromIndex(doc->unitIndex()) : ptSuffix;
5482
LSize->setSuffix(ein);
5483
LSize->setSpecialValueText( tr("Hairline"));
5484
Xpos->setSuffix(ein);
5485
Ypos->setSuffix(ein);
5486
Width->setSuffix(ein);
5487
Height->setSuffix(ein);
5488
imageXOffsetSpinBox->setSuffix(ein);
5489
imageYOffsetSpinBox->setSuffix(ein);
5490
dGap->setSuffix(ein);
5491
DLeft->setSuffix(ein);
5492
DTop->setSuffix(ein);
5493
DBottom->setSuffix(ein);
5494
DRight->setSuffix(ein);
5495
RoundRect->setSuffix(ein);
5497
SeStyle->languageChange();
5498
GroupAlign->languageChange();
5500
if(StyledLine->count() > 0)
5501
StyledLine->item(0)->setText( tr("No Style") );
5504
/* CB: doesnt look like we need to do this on languageChange anymore with qt4
5505
NameEdit->setToolTip("");
5506
Xpos->setToolTip("");
5507
Ypos->setToolTip("");
5508
Width->setToolTip("");
5509
Height->setToolTip("");
5510
Rotation->setToolTip("");
5511
basepointLabel->setToolTip("");
5512
// TopLeft->setToolTip("");
5513
// TopRight->setToolTip("");
5514
// BottomLeft->setToolTip("");
5515
// BottomRight->setToolTip("");
5516
// Center->setToolTip("");
5517
FlipH->setToolTip("");
5518
FlipV->setToolTip("");
5519
Zup->setToolTip("");
5520
ZDown->setToolTip("");
5521
ZTop->setToolTip("");
5522
ZBottom->setToolTip("");
5523
LevelTxt->setToolTip("");
5524
Locked->setToolTip("");
5525
NoResize->setToolTip("");
5526
NoPrint->setToolTip("");
5527
textFlowOptions->setToolTip("");
5528
textFlowDisabled->setToolTip("");
5529
textFlowUsesFrameShape->setToolTip("");
5530
textFlowUsesBoundingBox->setToolTip("");
5531
textFlowUsesContourLine->setToolTip("");
5532
textFlowUsesImageClipping->setToolTip("");
5533
textFlowOptions2->setToolTip("");
5534
textFlowDisabled2->setToolTip("");
5535
textFlowUsesFrameShape2->setToolTip("");
5536
textFlowUsesBoundingBox2->setToolTip("");
5537
textFlowUsesContourLine2->setToolTip("");
5538
textFlowUsesImageClipping2->setToolTip("");
5540
//Fonts->setToolTip("");
5541
Size->setToolTip("");
5542
ChBase->setToolTip("");
5543
ChScale->setToolTip("");
5544
ChScaleV->setToolTip("");
5545
TxStroke->setToolTip("");
5546
TxFill->setToolTip("");
5547
PM1->setToolTip("");
5548
PM2->setToolTip("");
5549
Revert->setToolTip("");
5550
Extra->setToolTip("");
5551
LineSp->setToolTip("");
5552
linespacingButton->setToolTip("");
5553
paraStyleCombo->setToolTip("");
5554
charStyleCombo->setToolTip("");
5555
paraStyleClear->setToolTip("");
5556
charStyleClear->setToolTip("");
5557
// langCombo->setToolTip("");
5559
minWordTrackingSpinBox->setToolTip("");
5560
normWordTrackingSpinBox->setToolTip("");
5561
minGlyphExtSpinBox->setToolTip("");
5562
maxGlyphExtSpinBox->setToolTip("");
5563
optMarginCombo->setToolTip("");
5565
LineMode->setToolTip("");
5566
LStyle->setToolTip("");
5567
LSize->setToolTip("");
5568
LJoinStyle->setToolTip("");
5569
LEndStyle->setToolTip("");
5570
StyledLine->setToolTip("");
5572
SCustom->setToolTip("");
5573
EditShape->setToolTip("");
5574
RoundRect->setToolTip("");
5575
DCol->setToolTip("");
5576
colgapLabel->setToolTip("");
5577
dGap->setToolTip("");
5578
DTop->setToolTip("");
5579
DBottom->setToolTip("");
5580
DLeft->setToolTip("");
5581
DRight->setToolTip("");
5582
TabsButton->setToolTip("");
5584
FreeScale->setToolTip("");
5585
imageXOffsetSpinBox->setToolTip("");
5586
imageYOffsetSpinBox->setToolTip("");
5587
imageXScaleSpinBox->setToolTip("");
5588
imageYScaleSpinBox->setToolTip("");
5589
keepImageWHRatioButton->setToolTip("");
5590
keepFrameWHRatioButton->setToolTip("");
5591
FrameScale->setToolTip("");
5592
Aspect->setToolTip("");
5593
InputP->setToolTip("");
5594
MonitorI->setToolTip("");
5596
NameEdit->setToolTip( tr("Name of selected object"));
5597
Xpos->setToolTip( tr("Horizontal position of current basepoint"));
5598
Ypos->setToolTip( tr("Vertical position of current basepoint"));
5599
Width->setToolTip( tr("Width"));
5600
Height->setToolTip( tr("Height"));
5601
Rotation->setToolTip( tr("Rotation of object at current basepoint"));
5602
basepointLabel->setToolTip( tr("Point from which measurements or rotation angles are referenced"));
5603
// TopLeft->setToolTip( tr("Select top left for basepoint"));
5604
// TopRight->setToolTip( tr("Select top right for basepoint"));
5605
// BottomLeft->setToolTip( tr("Select bottom left for basepoint"));
5606
// BottomRight->setToolTip( tr("Select bottom right for basepoint"));
5607
// Center->setToolTip( tr("Select center for basepoint"));
5608
DoGroup->setToolTip( tr("Group the selected objects"));
5609
DoUnGroup->setToolTip( tr("Ungroup the selected group"));
5610
FlipH->setToolTip( tr("Flip Horizontal"));
5611
FlipV->setToolTip( tr("Flip Vertical"));
5612
Zup->setToolTip( tr("Move one level up"));
5613
ZDown->setToolTip( tr("Move one level down"));
5614
ZTop->setToolTip( tr("Move to front"));
5615
ZBottom->setToolTip( tr("Move to back"));
5616
LevelTxt->setToolTip( tr("Indicates the level the object is on, 0 means the object is at the bottom"));
5617
Locked->setToolTip( tr("Lock or unlock the object"));
5618
NoResize->setToolTip( tr("Lock or unlock the size of the object"));
5619
NoPrint->setToolTip( tr("Enable or disable exporting of the object"));
5620
EvenOdd->setToolTip( "<qt>" + tr("This rule determines the "insideness" of a point on the canvas by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside, if even, the point is outside.") + "</qt>");
5621
NonZero->setToolTip( "<qt>" + tr("This rule determines the "insideness" of a point on the canvas by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. If the result is zero then the point is outside the path. Otherwise, it is inside.") + "</qt>");
5622
/*textFlowOptions->setToolTip( tr("Make text in lower frames flow around the object shape")); */
5623
textFlowDisabled->setToolTip( tr("Disable text flow from lower frames around object"));
5624
textFlowUsesFrameShape->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5625
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>" );
5626
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>" );
5627
textFlowUsesImageClipping->setToolTip( "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5628
textFlowDisabled2->setToolTip( tr("Disable text flow from lower frames around object"));
5629
textFlowUsesFrameShape2->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5630
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>" );
5631
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>" );
5632
textFlowUsesImageClipping2->setToolTip( "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5634
//Fonts->setToolTip( tr("Font of selected text or object"));
5635
Size->setToolTip( tr("Font Size"));
5636
ChBase->setToolTip( tr("Offset to baseline of characters"));
5637
ChScale->setToolTip( tr("Scaling width of characters"));
5638
ChScaleV->setToolTip( tr("Scaling height of characters"));
5639
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>" );
5640
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>" );
5641
PM1->setToolTip( tr("Saturation of color of text stroke"));
5642
PM2->setToolTip( tr("Saturation of color of text fill"));
5643
Revert->setToolTip( tr("Right to Left Writing"));
5644
Extra->setToolTip( tr("Manual Tracking"));
5645
LineSp->setToolTip( tr("Line Spacing"));
5646
// linespacingButton->setToolTip( "<qt>" + tr("Click and hold down to select the line spacing mode.") + "</qt>" );
5647
lineSpacingModeCombo->setToolTip( tr("Select the line spacing mode.") );
5648
paraStyleCombo->setToolTip( tr("Paragraph style of currently selected text or paragraph"));
5649
charStyleCombo->setToolTip( tr("Character style of currently selected text or paragraph"));
5650
paraStyleClear->setToolTip( tr("Remove Direct Paragraph Formatting"));
5651
charStyleClear->setToolTip( tr("Remove Direct Character Formatting"));
5652
// langCombo->setToolTip( tr("Hyphenation language of frame"));
5654
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>" );
5655
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>" );
5656
flopLineSpacing->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to the specified line height") + "</qt>" );
5658
minWordTrackingSpinBox->setToolTip( tr("Minimal width of spaces between words"));
5659
normWordTrackingSpinBox->setToolTip( tr("Normal width of spaces between words"));
5660
minGlyphExtSpinBox->setToolTip( tr("Minimal shrinkage of glyphs for justification"));
5661
maxGlyphExtSpinBox->setToolTip( tr("Maximal extension of glyphs for justification"));
5662
// optMarginCombo->setToolTip( tr("Uses hanging punctuation and margin kerning to achieve nicer looking columns"));
5664
LineMode->setToolTip( tr("Change settings for left or end points"));
5665
LStyle->setToolTip( tr("Pattern of line"));
5666
LSize->setToolTip( tr("Thickness of line"));
5667
LJoinStyle->setToolTip( tr("Type of line joins"));
5668
LEndStyle->setToolTip( tr("Type of line end"));
5669
StyledLine->setToolTip( tr("Line style of current object"));
5670
startArrow->setToolTip( tr("Arrow head style for start of line"));
5671
endArrow->setToolTip( tr("Arrow head style for end of line"));
5673
SCustom->setToolTip( tr("Choose the shape of frame..."));
5674
EditShape->setToolTip( tr("Edit shape of the frame..."));
5675
RoundRect->setToolTip( tr("Set radius of corner rounding"));
5676
DCol->setToolTip( tr("Number of columns in text frame"));
5677
colgapLabel->setToolTip( tr("Switches between Gap or Column width"));
5678
dGap->setToolTip( tr("Distance between columns"));
5679
DTop->setToolTip( tr("Distance of text from top of frame"));
5680
DBottom->setToolTip( tr("Distance of text from bottom of frame"));
5681
DLeft->setToolTip( tr("Distance of text from left of frame"));
5682
DRight->setToolTip( tr("Distance of text from right of frame"));
5683
TabsButton->setToolTip( tr("Edit tab settings of text frame..."));
5685
FreeScale->setToolTip( tr("Allow the image to be a different size to the frame"));
5686
imageXOffsetSpinBox->setToolTip( tr("Horizontal offset of image within frame"));
5687
imageYOffsetSpinBox->setToolTip( tr("Vertical offset of image within frame"));
5688
imageXScaleSpinBox->setToolTip( tr("Resize the image horizontally"));
5689
imageYScaleSpinBox->setToolTip( tr("Resize the image vertically"));
5690
keepImageWHRatioButton->setToolTip( tr("Keep the X and Y scaling the same"));
5691
keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
5692
FrameScale->setToolTip( tr("Make the image fit within the size of the frame"));
5693
imgDpiX->setToolTip( tr("Effective horizontal DPI of the image after scaling"));
5694
imgDpiY->setToolTip( tr("Effective vertical DPI of the image after scaling"));
5695
Aspect->setToolTip( tr("Use image proportions rather than those of the frame"));
5696
InputP->setToolTip( tr("Source profile of the image"));
5697
MonitorI->setToolTip( tr("Rendering intent for the image"));
5701
const VGradient PropertiesPalette::getFillGradient()
5703
return Cpal->gradEdit->Preview->fill_gradient;
5706
void PropertiesPalette::setGradientEditMode(bool on)
5708
Cpal->gradEditButton->setChecked(on);
5711
void PropertiesPalette::updateColorSpecialGradient()
5715
if(doc->m_Selection->isEmpty())
5717
double dur=doc->unitRatio();
5718
PageItem *currItem=doc->m_Selection->itemAt(0);
5720
Cpal->setSpecialGradient(currItem->GrStartX * dur, currItem->GrStartY * dur, currItem->GrEndX * dur, currItem->GrEndY * dur);
5723
void PropertiesPalette::updateSpinBoxConstants()
5727
if(doc->m_Selection->count()==0)
5729
Width->setConstants(&doc->constants());
5730
Height->setConstants(&doc->constants());
5731
Xpos->setConstants(&doc->constants());
5732
Ypos->setConstants(&doc->constants());
5736
UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
5741
bool UserActionSniffer::eventFilter(QObject*, QEvent *e)
5743
if (e->type() == QEvent::MouseButtonPress)
5745
else if (e->type() == QEvent::MouseButtonRelease)
5747
else if (e->type() == QEvent::KeyPress)
5749
QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5750
if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5753
else if (e->type() == QEvent::KeyRelease)
5755
QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5756
if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5762
void PropertiesPalette::setLocked(bool isLocked)
5764
Xpos->setReadOnly(isLocked);
5765
Ypos->setReadOnly(isLocked);
5766
Width->setReadOnly(isLocked);
5767
Height->setReadOnly(isLocked);
5768
Rotation->setReadOnly(isLocked);
5769
QPalette pal(qApp->palette());
5771
pal.setCurrentColorGroup(QPalette::Disabled);
5773
Xpos->setPalette(pal);
5774
Ypos->setPalette(pal);
5775
Width->setPalette(pal);
5776
Height->setPalette(pal);
5777
Rotation->setPalette(pal);
5779
bool shapeEditLocked = isLocked;
5781
shapeEditLocked |= CurItem->sizeLocked();
5782
EditShape->setEnabled(!shapeEditLocked);
5784
LayerGroup->setEnabled(!isLocked);
5785
Locked->setChecked(isLocked);
5786
if ((HaveDoc) && (HaveItem))
5788
SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
5789
if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) && (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
5790
RoundRect->setEnabled(!isLocked);
5792
RoundRect->setEnabled(false);
5796
void PropertiesPalette::setSizeLocked(bool isSizeLocked)
5798
bool b = isSizeLocked;
5799
if (HaveItem && CurItem->locked())
5801
Width->setReadOnly(b);
5802
Height->setReadOnly(b);
5803
QPalette pal(qApp->palette());
5806
pal.setCurrentColorGroup(QPalette::Disabled);
5808
Width->setPalette(pal);
5809
Height->setPalette(pal);
5810
NoResize->setChecked(isSizeLocked);
5812
bool shapeEditLocked = isSizeLocked;
5814
shapeEditLocked |= CurItem->locked();
5815
EditShape->setEnabled(!shapeEditLocked);
5818
void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
5820
NoPrint->setChecked(!isPrintingEnabled);
5823
void PropertiesPalette::setFlippedH(bool isFlippedH)
5825
FlipH->setChecked(isFlippedH);
5828
void PropertiesPalette::setFlippedV(bool isFlippedV)
5830
FlipV->setChecked(isFlippedV);
5833
void PropertiesPalette::setGroupTransparency(int trans)
5835
if ((HaveDoc) && (HaveItem))
5837
CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
5843
void PropertiesPalette::setGroupBlending(int blend)
5845
CurItem->setFillBlendmode(blend);
5850
void PropertiesPalette::doGrouping()
5853
DoGroup->setEnabled(false);
5854
DoUnGroup->setEnabled(true);
5855
setMultipleSelection(true);
5856
double gx, gy, gh, gw;
5857
doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
5858
int bp = RotationGroup->checkedId();
5860
m_ScMW->view->RCenter = FPoint(gx, gy);
5862
m_ScMW->view->RCenter = FPoint(gx + gw, gy);
5864
m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
5866
m_ScMW->view->RCenter = FPoint(gx, gy + gh);
5868
m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
5869
TabStack->setItemEnabled(idShapeItem, false);
5872
void PropertiesPalette::handleShapeEdit2()
5874
if (!m_ScMW || m_ScMW->scriptIsRunning())
5876
if ((HaveDoc) && (HaveItem))
5878
tmpSelection->clear();
5879
tmpSelection->copy(*doc->m_Selection, true);
5880
doc->m_Selection->clear();
5881
doc->m_Selection->addItem(CurItem);
5882
CurItem->isSingleSel = true;
5884
m_ScMW->view->requestMode(modeEditClip);
5885
RoundRect->setEnabled(false);
5889
void PropertiesPalette::endEdit2()
5891
if ((HaveDoc) && (HaveItem))
5893
if (tmpSelection->count() > 0)
5895
doc->m_Selection->copy(*tmpSelection, false);
5896
doc->m_Selection->connectItemToGUI();
5898
tmpSelection->clear();
5902
void PropertiesPalette::flop(int radioFlop)
5904
if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5906
// qDebug("%s", QString("rF %1").arg(radioFlop).toAscii());
5908
CurItem->setFirstLineOffset(FLOPRealGlyphHeight);
5909
else if( radioFlop == 1)
5910
CurItem->setFirstLineOffset(FLOPFontAscent);
5911
else if( radioFlop == 2)
5912
CurItem->setFirstLineOffset(FLOPLineSpacing);