~ubuntu-branches/ubuntu/trusty/scribus/trusty

« back to all changes in this revision

Viewing changes to .pc/qreal_double.patch/scribus/propertiespalette.cpp

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2013-05-16 20:34:07 UTC
  • mfrom: (1.1.13) (32.1.2 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130516203407-ztj7ebsivoo41dih
Tags: 1.4.2.dfsg+r18267-1ubuntu2
Avoid qreal/double type clashes on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
 
3
to the COPYING file provided with the program. Following this notice may exist
 
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
 
5
for which a new license (GPL+exception) is in place.
 
6
*/
 
7
 
 
8
 
 
9
#include "propertiespalette.h"
 
10
 
 
11
#include <QButtonGroup>
 
12
#include <QCheckBox>
 
13
#include <QCloseEvent>
 
14
#include <QComboBox>
 
15
#include <QEvent>
 
16
#include <QFocusEvent>
 
17
#include <QFrame>
 
18
#include <QGridLayout>
 
19
#include <QGroupBox>
 
20
#include <QHBoxLayout>
 
21
#include <QImage>
 
22
#include <QKeyEvent>
 
23
#include <QLabel>
 
24
#include <QListView>
 
25
#include <QMatrix>
 
26
#include <QMenu>
 
27
#include <QMessageBox>
 
28
#include <QObject>
 
29
#include <QPixmap>
 
30
#include <QPoint>
 
31
#include <QPushButton>
 
32
#include <QRadioButton>
 
33
#include <QRegExp>
 
34
#include <QSpacerItem>
 
35
#include <QSpinBox>
 
36
#include <QStackedWidget>
 
37
#include <QTimer>
 
38
#include <QToolBox>
 
39
#include <QToolTip>
 
40
#include <QVBoxLayout>
 
41
#include <QValidator>
 
42
#include <QWidget>
 
43
 
 
44
#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
 
45
#define _USE_MATH_DEFINES
 
46
#endif
 
47
#include <cmath>
 
48
#include "arrowchooser.h"
 
49
#include "autoform.h"
 
50
#include "basepointwidget.h"
 
51
#include "commonstrings.h"
 
52
#include "colorlistbox.h"
 
53
#include "sccolorengine.h"
 
54
#include "cpalette.h"
 
55
#include "pageitem.h"
 
56
#include "pageitem_textframe.h"
 
57
#include "styles/paragraphstyle.h"
 
58
#include "sccombobox.h"
 
59
#include "scfonts.h"
 
60
#include "scribus.h"
 
61
#include "scribuscore.h"
 
62
#include "scraction.h"
 
63
#include "scribusview.h"
 
64
#include "selection.h"
 
65
#include "spalette.h"
 
66
#include "styleselect.h"
 
67
#include "tabmanager.h"
 
68
#include "units.h"
 
69
#include "undomanager.h"
 
70
#include "util.h"
 
71
#include "util_icon.h"
 
72
#include "text/nlsconfig.h"
 
73
#include "dasheditor.h"
 
74
 
 
75
using namespace std;
 
76
 
 
77
 
 
78
LineFormatValue::LineFormatValue() : m_Line(), m_doc(NULL), m_name() {};
 
79
 
 
80
LineFormatValue::LineFormatValue( const multiLine& line, ScribusDoc* doc, const QString name ) : m_Line(line), m_doc(doc), m_name(name) {};
 
81
 
 
82
LineFormatValue::LineFormatValue(const LineFormatValue& other)
 
83
{
 
84
        m_name = other.m_name;
 
85
        m_Line = other.m_Line;
 
86
        m_doc = other.m_doc;
 
87
}
 
88
 
 
89
LineFormatValue& LineFormatValue::operator= (const LineFormatValue& other)
 
90
{
 
91
        m_name = other.m_name;
 
92
        m_Line = other.m_Line;
 
93
        m_doc = other.m_doc;
 
94
        return *this;
 
95
}
 
96
 
 
97
 
 
98
void LineFormatItemDelegate::redraw(const QVariant& data) const  
 
99
{
 
100
        const LineFormatValue& item(data.value<LineFormatValue>());
 
101
        QColor tmpf;
 
102
        pmap->fill(Qt::white);
 
103
        QPainter p;
 
104
        p.begin(pmap.get());
 
105
        for (int its = item.m_Line.size()-1; its > -1; its--)
 
106
        {
 
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);
 
109
                QPen pen;
 
110
                QVector<qreal> m_array;
 
111
                if (item.m_Line[its].Dash == 1)
 
112
                        pen.setStyle(Qt::SolidLine);
 
113
                else
 
114
                {
 
115
                        getDashArray(item.m_Line[its].Dash, 1, m_array);
 
116
                        pen.setDashPattern(m_array);
 
117
                }
 
118
                pen.setColor(tmpf);
 
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));
 
122
                p.setPen(pen);
 
123
                p.drawLine(0, 18, 37, 18);
 
124
        }
 
125
        p.end();
 
126
}
 
127
 
 
128
QString LineFormatItemDelegate::text(const QVariant& data) const
 
129
{
 
130
        return data.toString();
 
131
}
 
132
 
 
133
NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
 
134
{
 
135
        setObjectName("namewidget");
 
136
        QRegExp rx( "[\\w()]+" );
 
137
        QValidator* validator = new QRegExpValidator( rx, this );
 
138
        setValidator( validator );
 
139
}
 
140
 
 
141
void NameWidget::focusOutEvent(QFocusEvent *e)
 
142
{
 
143
        emit Leaved();
 
144
        QLineEdit::focusOutEvent(e);
 
145
}
 
146
 
 
147
PropertiesPalette::PropertiesPalette( QWidget* parent) : ScrPaletteBase( parent, "PropertiesPalette", false, 0)
 
148
{
 
149
        m_ScMW=0;
 
150
        doc=0;
 
151
        HaveDoc = false;
 
152
        HaveItem = false;
 
153
        RoVal = 0;
 
154
        m_unitRatio = 1.0;
 
155
        tmpSelection = new Selection(this, false);
 
156
        tmpSelection->clear();
 
157
        setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
 
158
 
 
159
        _userActionOn = false;
 
160
        userActionSniffer = new UserActionSniffer(this);
 
161
        connect(userActionSniffer, SIGNAL(actionStart()), this, SLOT(spinboxStartUserAction()));
 
162
        connect(userActionSniffer, SIGNAL(actionEnd()), this, SLOT(spinboxFinishUserAction()));
 
163
 
 
164
        MpalLayout = new QVBoxLayout( this );
 
165
        MpalLayout->setMargin(5);
 
166
        MpalLayout->setSpacing(1);
 
167
        setOrientation(Qt::Vertical);
 
168
        QFont f(font());
 
169
        f.setPointSize(f.pointSize()-1);
 
170
        setFont(f);
 
171
 
 
172
        TabStack = new QToolBox( this );
 
173
 
 
174
        page = new QWidget( TabStack );
 
175
        pageLayout = new QVBoxLayout( page );
 
176
        pageLayout->setMargin(0);
 
177
        pageLayout->setSpacing(5);
 
178
 
 
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 );
 
188
 
 
189
        GeoGroup = new QGroupBox(page);
 
190
        GeoGroupLayout = new QGridLayout( GeoGroup );
 
191
        GeoGroupLayout->setMargin(5);
 
192
        GeoGroupLayout->setSpacing(4);
 
193
        GeoGroupLayout->setAlignment( Qt::AlignTop );
 
194
 
 
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 );
 
207
 
 
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 );
 
220
 
 
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 );
 
303
 
 
304
        layout60 = new QHBoxLayout;
 
305
        layout60->setMargin(0);
 
306
        layout60->setSpacing(5);
 
307
 
 
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 );
 
332
 
 
333
        layout60->addWidget( LayerGroup );
 
334
        QSpacerItem* spacer2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
 
335
        layout60->addItem( spacer2 );
 
336
 
 
337
        Layout44 = new QGridLayout;
 
338
        Layout44->setSpacing( 4 );
 
339
        Layout44->setMargin( 5 );
 
340
 
 
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 );
 
347
 
 
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 );
 
358
        QIcon a = QIcon();
 
359
        a.addPixmap(loadIcon("16/lock.png"), QIcon::Normal, QIcon::On);
 
360
        a.addPixmap(loadIcon("16/lock-unlocked.png"), QIcon::Normal, QIcon::Off);
 
361
        Locked->setIcon(a);
 
362
        Layout44->addWidget( Locked, 0, 2 );
 
363
        NoPrint = new QToolButton( page );
 
364
        NoPrint->setCheckable( true );
 
365
        QIcon a2 = QIcon();
 
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 );
 
372
        QIcon a3 = QIcon();
 
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 );
 
378
 
 
379
        pageLayout->addLayout( layout60 );
 
380
 
 
381
        QSpacerItem* spacer13 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 
382
        pageLayout->addItem( spacer13 );
 
383
        idXYZItem = TabStack->addItem( page, "X, Y, &Z" );
 
384
 
 
385
        page_2 = new QWidget( TabStack );
 
386
        pageLayout_2 = new QVBoxLayout( page_2 );
 
387
        pageLayout_2->setSpacing( 5 );
 
388
        pageLayout_2->setMargin( 0 );
 
389
 
 
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 );
 
399
 
 
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 );
 
404
 
 
405
        Layout13 = new QHBoxLayout;
 
406
        Layout13->setSpacing( 2 );
 
407
        Layout13->setMargin( 0 );
 
408
 
 
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 );
 
415
 
 
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);
 
468
 
 
469
        TabStack2 = new QStackedWidget( page_2 );
 
470
 
 
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 );
 
480
 
 
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 );
 
488
 
 
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 );
 
493
 
 
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 );
 
499
 
 
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 );
 
505
 
 
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 );
 
511
 
 
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 );
 
517
 
 
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);
 
522
 
 
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 );
 
538
 
 
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 );
 
548
 
 
549
        pathTextType = new ScComboBox( Distance2 );
 
550
        DistanceLayout2->addWidget( pathTextType, 0, 1);
 
551
        pathTextTypeLabel = new QLabel( "Type:", Distance2 );
 
552
        DistanceLayout2->addWidget( pathTextTypeLabel, 0, 0);
 
553
        
 
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);
 
559
 
 
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);
 
565
 
 
566
        flippedPathText = new QCheckBox( Distance2 );
 
567
        flippedPathText->setText( "Flip Text" );
 
568
        DistanceLayout2->addWidget( flippedPathText, 3, 0, 1, 2 );
 
569
 
 
570
        showcurveCheckBox = new QCheckBox( Distance2 );
 
571
        showcurveCheckBox->setText( "Show Curve" );
 
572
        DistanceLayout2->addWidget( showcurveCheckBox, 4, 0, 1, 2 );
 
573
 
 
574
        pageLayout_2b->addWidget(Distance2);
 
575
        TabStack2->addWidget( page_2b );
 
576
*/
 
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 );
 
594
 
 
595
        pageLayout_2->addWidget( TabStack2 );
 
596
 
 
597
        QSpacerItem* spacer6 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 
598
        pageLayout_2->addItem( spacer6 );
 
599
        idShapeItem = TabStack->addItem( page_2, "&Shape" );
 
600
 
 
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 );
 
605
 
 
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 );
 
619
 
 
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);
 
672
 
 
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");
 
694
 
 
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 );
 
700
 
 
701
        TextTree = new ScTreeWidget(page_3);
 
702
 
 
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 );
 
740
 
 
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 ) );
 
791
        Revert->setText("");
 
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);
 
799
 
 
800
 
 
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 );
 
828
        
 
829
        styleWidgetsItem = TextTree->addWidget( tr("Style Settings"), styleWidgets);
 
830
 
 
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);
 
847
 
 
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 );
 
855
 
 
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 );
 
863
 
 
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 );
 
868
 
 
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 );
 
874
 
 
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 );
 
880
 
 
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 );
 
886
 
 
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 );
 
892
 
 
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 );
 
898
 
 
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);
 
903
 
 
904
 
 
905
        //<< Optical Margins
 
906
 
 
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 );
 
914
 
 
915
//      optMarginCombo = new QComboBox(OptMargins);
 
916
//      OptMarginsLayout->addWidget( optMarginCombo);
 
917
 
 
918
//      optMarginCheckLeftProtruding = new QCheckBox(OptMargins);
 
919
//      optMarginCheckLeftProtruding->setObjectName(QString::fromUtf8("optMarginCheckLeftProtruding"));
 
920
        optMarginRadioNone = new QRadioButton(OptMargins);
 
921
        optMarginRadioNone->setObjectName(QString::fromUtf8("optMarginRadioNone"));
 
922
        
 
923
        optMarginRadioBoth = new QRadioButton(OptMargins);
 
924
        optMarginRadioBoth->setObjectName(QString::fromUtf8("optMarginRadioBoth"));
 
925
        
 
926
        optMarginRadioLeft = new QRadioButton(OptMargins);
 
927
        optMarginRadioLeft->setObjectName(QString::fromUtf8("optMarginRadioLeft"));
 
928
        
 
929
        optMarginRadioRight = new QRadioButton(OptMargins);
 
930
        optMarginRadioRight->setObjectName(QString::fromUtf8("optMarginRadioRight"));
 
931
        
 
932
        optMarginResetButton = new QPushButton(OptMargins);
 
933
        optMarginResetButton->setObjectName(QString::fromUtf8("optMarginResetButton"));
 
934
 
 
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") );
 
941
 
 
942
//      OptMarginsLayout->addWidget(optMarginCheckLeftProtruding);
 
943
        OptMarginsLayout->addWidget(optMarginRadioNone);
 
944
        OptMarginsLayout->addWidget(optMarginRadioBoth);
 
945
        OptMarginsLayout->addWidget(optMarginRadioLeft);
 
946
        OptMarginsLayout->addWidget(optMarginRadioRight);
 
947
        OptMarginsLayout->addWidget(optMarginResetButton);
 
948
 
 
949
        OptMarginsItem = TextTree->addWidget( tr("Optical Margins"), OptMargins);
 
950
 
 
951
        //>> Optical Margins
 
952
 
 
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 );
 
985
 
 
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);
 
1003
 
 
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);
 
1021
 
 
1022
        advancedWidgetsItem = TextTree->addWidget( tr("Advanced Settings"), advancedWidgets);
 
1023
 
 
1024
        //>>Advanced Settings
 
1025
 
 
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 );
 
1033
 
 
1034
        pathTextType = new ScComboBox( Distance2 );
 
1035
        DistanceLayout2->addWidget( pathTextType, 0, 1);
 
1036
        pathTextTypeLabel = new QLabel( "Type:", Distance2 );
 
1037
        DistanceLayout2->addWidget( pathTextTypeLabel, 0, 0);
 
1038
        
 
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);
 
1044
 
 
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);
 
1050
 
 
1051
        flippedPathText = new QCheckBox( Distance2 );
 
1052
        flippedPathText->setText( "Flip Text" );
 
1053
        DistanceLayout2->addWidget( flippedPathText, 3, 0, 1, 2 );
 
1054
 
 
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);
 
1059
 
 
1060
        pageLayout_3->addWidget(TextTree);
 
1061
/*
 
1062
        layout47 = new QHBoxLayout;
 
1063
        layout47->setSpacing( 5 );
 
1064
        layout47->setMargin( 0 );
 
1065
 
 
1066
        layout46 = new QVBoxLayout;
 
1067
        layout46->setSpacing( 5 );
 
1068
        layout46->setMargin( 0 );
 
1069
 
 
1070
        layout41 = new QGridLayout;
 
1071
        layout41->setSpacing( 5 );
 
1072
        layout41->setMargin( 0 );
 
1073
        layout41->setAlignment( Qt::AlignLeft );
 
1074
 
 
1075
        Fonts = new FontComboH(page_3);
 
1076
        layout41->addWidget( Fonts, 0, 0, 1, 4 );
 
1077
 
 
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 );
 
1121
 
 
1122
        layout46->addLayout( layout41 );
 
1123
 
 
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 );
 
1155
 
 
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 );
 
1173
 
 
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 );
 
1183
 
 
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 );
 
1212
        
 
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);
 
1230
        
 
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);
 
1248
        */
 
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);
 
1254
 
 
1255
//      QSpacerItem* spacer8 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 
1256
//      pageLayout_3->addItem( spacer8 );
 
1257
        idTextItem=TabStack->addItem( page_3, "&Text" );
 
1258
 
 
1259
        page_4 = new QWidget( TabStack );
 
1260
        pageLayout_4 = new QVBoxLayout( page_4 );
 
1261
        pageLayout_4->setSpacing( 5 );
 
1262
        pageLayout_4->setMargin( 0 );
 
1263
 
 
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 );
 
1275
        
 
1276
        FreeScale = new QRadioButton( "&Free Scaling", page_4 );
 
1277
        FreeScale->setChecked( true );
 
1278
        pageLayout_4->addWidget( FreeScale );
 
1279
 
 
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 );
 
1330
 
 
1331
        Layout24 = new QVBoxLayout;
 
1332
        Layout24->setSpacing( 3 );
 
1333
        Layout24->setMargin( 0 );
 
1334
 
 
1335
        FrameScale = new QRadioButton( page_4 );
 
1336
        FrameScale->setText( "Scale &To Frame Size" );
 
1337
        Layout24->addWidget( FrameScale );
 
1338
 
 
1339
        Layout18 = new QHBoxLayout;
 
1340
        Layout18->setSpacing( 5 );
 
1341
        Layout18->setMargin( 0 );
 
1342
 
 
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 );
 
1349
 
 
1350
        Aspect = new QCheckBox( page_4 );
 
1351
        Aspect->setEnabled( false );
 
1352
        Aspect->setText( "P&roportional" );
 
1353
        Aspect->setChecked( true );
 
1354
 
 
1355
        Layout18->addWidget( Aspect );
 
1356
        Layout24->addLayout( Layout18 );
 
1357
        pageLayout_4->addLayout( Layout24 );
 
1358
 
 
1359
        EditEffects = new QToolButton( page_4);
 
1360
        pageLayout_4->addWidget( EditEffects );
 
1361
 
 
1362
        EditPSDProps = new QToolButton( page_4);
 
1363
        pageLayout_4->addWidget( EditPSDProps );
 
1364
 
 
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);
 
1381
 
 
1382
        QSpacerItem* spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
 
1383
        pageLayout_4->addItem( spacer9 );
 
1384
        idImageItem=TabStack->addItem( page_4, "&Image" );
 
1385
 
 
1386
        page_5 = new QWidget( TabStack );
 
1387
        pageLayout_5 = new QVBoxLayout( page_5 );
 
1388
        pageLayout_5->setSpacing( 5 );
 
1389
        pageLayout_5->setMargin( 0 );
 
1390
 
 
1391
        LMode = false;
 
1392
 
 
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 );
 
1407
 
 
1408
        dashEditor = new DashEditor(page_5);
 
1409
        Layout12_2->addWidget(dashEditor, 2, 0, 1, 2);
 
1410
 
 
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 );
 
1437
 
 
1438
        TabStack3 = new QStackedWidget( page_5 );
 
1439
        TabStack3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
 
1440
 
 
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 );
 
1450
 
 
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" );
 
1476
        
 
1477
        page_6 = new QWidget( TabStack );
 
1478
        pageLayout_6 = new QVBoxLayout( page_6 );
 
1479
        pageLayout_6->setSpacing( 5 );
 
1480
        pageLayout_6->setMargin( 0 );
 
1481
 
 
1482
        Cpal = new Cpalette(page_6);
 
1483
        pageLayout_6->addWidget( Cpal );
 
1484
 
 
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);
 
1496
 
 
1497
        idColorsItem = TabStack->addItem(page_6, "&Colors" );
 
1498
        MpalLayout->addWidget( TabStack );
 
1499
 
 
1500
        languageChange();
 
1501
 
 
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()));
 
1552
 
 
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()) );
 
1613
 
 
1614
 
 
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()) );
 
1619
 
 
1620
        HaveItem = false;
 
1621
        Xpos->setValue(0);
 
1622
        Ypos->setValue(0);
 
1623
        Width->setValue(0);
 
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);
 
1638
}
 
1639
 
 
1640
void PropertiesPalette::closeEvent(QCloseEvent *closeEvent)
 
1641
{
 
1642
        if (m_ScMW && !m_ScMW->scriptIsRunning())
 
1643
        {
 
1644
                if ((HaveDoc) && (HaveItem))
 
1645
                {
 
1646
                        if (Cpal->gradEditButton->isChecked())
 
1647
                        {
 
1648
                                m_ScMW->view->requestMode(modeNormal);
 
1649
                                m_ScMW->view->RefreshGradient(CurItem);
 
1650
                        }
 
1651
                }
 
1652
        }
 
1653
        ScrPaletteBase::closeEvent(closeEvent);
 
1654
}
 
1655
 
 
1656
void PropertiesPalette::setMainWindow(ScribusMainWindow* mw)
 
1657
{
 
1658
        m_ScMW=mw;
 
1659
        QPoint p1 = mapToGlobal(pos());
 
1660
        QPoint p2 = m_ScMW->mapFromGlobal(p1);
 
1661
        //Qt4 reparent(m_ScMW, this->getWFlags(), p2);
 
1662
        setParent(m_ScMW);
 
1663
        move(p2);
 
1664
 
 
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()) );
 
1676
        
 
1677
}
 
1678
 
 
1679
void PropertiesPalette::SelTab(int t)
 
1680
{
 
1681
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
1682
                return;
 
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
 
1685
#ifndef HAVE_CARBON
 
1686
        foreach (QObject *o, TabStack->widget(t)->children())
 
1687
        {
 
1688
                // Layouts, boxes etc aren't widgets at all
 
1689
                // so let's skip them silently...
 
1690
                QWidget *w = qobject_cast<QWidget*>(o);
 
1691
                if (w)
 
1692
                {
 
1693
                        QWidget *i = TabStack->widget(t);
 
1694
                        while ((i = i->nextInFocusChain()) != TabStack->widget(t))
 
1695
                        {
 
1696
                                if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) && !i->focusProxy() && i->isEnabled())
 
1697
                                {
 
1698
                                        i->setFocus();
 
1699
                                        break;
 
1700
                                }
 
1701
                        }
 
1702
                }
 
1703
        }
 
1704
#else
 
1705
        bool enable;
 
1706
        for (int i = 0; i < TabStack->count(); ++i)
 
1707
        {
 
1708
                enable = (i == t);
 
1709
                foreach (QObject * o, TabStack->widget(i)->children())
 
1710
                {
 
1711
                        // Layouts, boxes etc aren't widgets at all
 
1712
                        // so let's skip them silently...
 
1713
                        QWidget * w = qobject_cast<QWidget*>(o);
 
1714
                        if (w)
 
1715
                                w->setEnabled(enable);
 
1716
                }
 
1717
        }
 
1718
        // now restore the dis-/enabled settings of the current tab
 
1719
        if ((HaveDoc) && (HaveItem))
 
1720
        {
 
1721
                bool setter;
 
1722
                if (t == idXYZItem)
 
1723
                {
 
1724
                        if ((CurItem->isTableItem) && (CurItem->isSingleSel))
 
1725
                        {
 
1726
                                setter = true;
 
1727
                                Xpos->setEnabled(false);
 
1728
                                Ypos->setEnabled(false);
 
1729
                                Rotation->setEnabled(false);
 
1730
                        }
 
1731
                        else
 
1732
                                setter = false;
 
1733
                        LayerGroup->setEnabled(!setter);
 
1734
                        if ((CurItem->itemType() == PageItem::Line) && LMode)
 
1735
                                Rotation->setEnabled(false);
 
1736
                        else
 
1737
                                Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
 
1738
                        if (CurItem->asLine())
 
1739
                        {
 
1740
                                keepFrameWHRatioButton->setEnabled(false);
 
1741
                                Height->setEnabled(LMode && !CurItem->locked());
 
1742
                        }
 
1743
                        else
 
1744
                        {
 
1745
                                Height->setEnabled(true);
 
1746
                                keepFrameWHRatioButton->setEnabled(true);
 
1747
                        }
 
1748
                        DoGroup->setEnabled(false);
 
1749
                        DoUnGroup->setEnabled(false);
 
1750
                        if (doc->m_Selection->count() > 1)
 
1751
                        {
 
1752
                                bool isGroup = true;
 
1753
                                int firstElem = -1;
 
1754
                                if (CurItem->Groups.count() != 0)
 
1755
                                        firstElem = CurItem->Groups.top();
 
1756
                                for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
 
1757
                                {
 
1758
                                        if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
 
1759
                                        {
 
1760
                                                if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
 
1761
                                                        isGroup = false;
 
1762
                                        }
 
1763
                                        else
 
1764
                                                isGroup = false;
 
1765
                                }
 
1766
                                if (!isGroup)
 
1767
                                        DoGroup->setEnabled(true);
 
1768
                                else
 
1769
                                {
 
1770
                                        if (CurItem->isGroupControl)
 
1771
                                                NameEdit->setEnabled(true);
 
1772
                                }
 
1773
                                if ((CurItem->Groups.count() != 0) && (isGroup))
 
1774
                                        DoUnGroup->setEnabled(true);
 
1775
                        }
 
1776
                }
 
1777
                else if (t == idShapeItem)
 
1778
                {
 
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);
 
1782
                        else
 
1783
                                RoundRect->setEnabled ((CurItem->asPolygon()) &&  (!CurItem->ClipEdited)  && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
 
1784
                }
 
1785
                else if (t == idImageItem)
 
1786
                {
 
1787
                        imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
 
1788
                        setter = CurItem->ScaleType;
 
1789
                        if (CurItem->asLatexFrame())
 
1790
                        {
 
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);
 
1798
                        }
 
1799
                        else
 
1800
                        {
 
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);
 
1808
                        }
 
1809
                        imageXOffsetSpinBox->setEnabled(setter);
 
1810
                        imageYOffsetSpinBox->setEnabled(setter);
 
1811
                }
 
1812
                else if (t == idLineItem)
 
1813
                {
 
1814
                        if ((CurItem->asLine()) || (CurItem->asPolyLine()))
 
1815
                        {
 
1816
                                startArrow->setEnabled(true);
 
1817
                                endArrow->setEnabled(true);
 
1818
                        }
 
1819
                        else
 
1820
                        {
 
1821
                                startArrow->setEnabled(false);
 
1822
                                endArrow->setEnabled(false);
 
1823
                        }
 
1824
                        if (CurItem->NamedLStyle.isEmpty())
 
1825
                                setter = true;
 
1826
                        else
 
1827
                                setter = false;
 
1828
                        LStyle->setEnabled(setter);
 
1829
                        LSize->setEnabled(setter);
 
1830
                        LJoinStyle->setEnabled(setter);
 
1831
                        LEndStyle->setEnabled(setter);
 
1832
                }
 
1833
                else if (t == idColorsItem)
 
1834
                {
 
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);
 
1841
                }
 
1842
        }
 
1843
#endif
 
1844
}
 
1845
 
 
1846
void PropertiesPalette::setDoc(ScribusDoc *d)
 
1847
{
 
1848
        if(doc == d || (m_ScMW && m_ScMW->scriptIsRunning()))
 
1849
                return;
 
1850
 
 
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);
 
1862
 
 
1863
        doc = d;
 
1864
        CurItem = NULL;
 
1865
        Cpal->setDocument(doc);
 
1866
        Cpal->setCurrentItem(NULL);
 
1867
        m_unitRatio=doc->unitRatio();
 
1868
        m_unitIndex=doc->unitIndex();
 
1869
        int precision = unitGetPrecisionFromIndex(m_unitIndex);
 
1870
//qt4 FIXME here
 
1871
        double maxXYWHVal= 16777215 * m_unitRatio;
 
1872
        double minXYVal= -16777215 * m_unitRatio;
 
1873
        HaveDoc = true;
 
1874
        HaveItem = false;
 
1875
 
 
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);
 
1887
 
 
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);
 
1901
 
 
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);
 
1915
 
 
1916
        updateColorList();
 
1917
 
 
1918
        updateSpinBoxConstants();
 
1919
        paraStyleCombo->setDoc(doc);
 
1920
        charStyleCombo->setDoc(doc);
 
1921
        SetLineFormats(doc);
 
1922
        startArrow->rebuildList(&doc->arrowStyles);
 
1923
        endArrow->rebuildList(&doc->arrowStyles);
 
1924
 
 
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)));
 
1936
}
 
1937
 
 
1938
void PropertiesPalette::unsetDoc()
 
1939
{
 
1940
        HaveDoc = false;
 
1941
        HaveItem = false;
 
1942
        doc=NULL;
 
1943
        CurItem = NULL;
 
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);
 
1952
        SetLineFormats(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);
 
1964
        HaveItem = false;
 
1965
        Xpos->setValue(0);
 
1966
        Ypos->setValue(0);
 
1967
        Width->setValue(0);
 
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);
 
1976
}
 
1977
 
 
1978
void PropertiesPalette::unsetItem()
 
1979
{
 
1980
        HaveItem=false;
 
1981
        CurItem = NULL;
 
1982
        Cpal->setCurrentItem(NULL);
 
1983
        dashEditor->hide();
 
1984
        NewSel(-1);
 
1985
}
 
1986
 
 
1987
void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode)
 
1988
{
 
1989
        if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveItem)
 
1990
                return;
 
1991
        if (CurItem->isGroupControl)
 
1992
        {
 
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);
 
2005
                else
 
2006
                        textFlowUsesImageClipping2->setEnabled(false);
 
2007
        }
 
2008
        else
 
2009
        {
 
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);
 
2022
                else
 
2023
                        textFlowUsesImageClipping->setEnabled(false);
 
2024
        }
 
2025
}
 
2026
 
 
2027
void PropertiesPalette::SetCurItem(PageItem *i)
 
2028
{
 
2029
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2030
                return;
 
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.
 
2035
        //if (CurItem == i)
 
2036
        //      return;
 
2037
 
 
2038
        if (!doc)
 
2039
                setDoc(i->doc());
 
2040
 
 
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)));
 
2046
 
 
2047
        SelTab(TabStack->currentIndex());
 
2048
 
 
2049
        HaveItem = false;
 
2050
        CurItem = i;
 
2051
 
 
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()))
 
2066
        {
 
2067
                startArrow->setEnabled(true);
 
2068
                endArrow->setEnabled(true);
 
2069
                startArrow->setCurrentIndex(CurItem->startArrowIndex());
 
2070
                endArrow->setCurrentIndex(CurItem->endArrowIndex());
 
2071
        }
 
2072
        else
 
2073
        {
 
2074
                startArrow->setEnabled(false);
 
2075
                endArrow->setEnabled(false);
 
2076
        }
 
2077
        NameEdit->setText(CurItem->itemName());
 
2078
        RoundRect->setValue(CurItem->cornerRadius()*m_unitRatio);
 
2079
        QString tm;
 
2080
        LevelTxt->setText(tm.setNum(CurItem->ItemNr + 1));
 
2081
        PageItem_TextFrame *i2=CurItem->asTextFrame();
 
2082
        if (i2!=0)
 
2083
        {
 
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)
 
2091
                {
 
2092
                        dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
 
2093
                        dGap->setValue(i2->ColGap * m_unitRatio);
 
2094
                }
 
2095
                else
 
2096
                {
 
2097
                        dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
 
2098
                        dGap->setValue(i2->columnWidth() * m_unitRatio);
 
2099
                }
 
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
 
2108
                // the frame type.
 
2109
                setFlop(CurItem->firstLineOffset());
 
2110
                
 
2111
                // Style
 
2112
                updateStyle(i2->currentStyle());
 
2113
                
 
2114
                connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
 
2115
                connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
 
2116
        }
 
2117
        if (CurItem->asImageFrame())
 
2118
        {
 
2119
                if (CurItem->PictureIsAvailable)
 
2120
                {
 
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);
 
2126
                }
 
2127
                else
 
2128
                {
 
2129
                        imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
 
2130
                        imagePageNumber->setEnabled(false);
 
2131
                }
 
2132
        }
 
2133
        Revert->setChecked(CurItem->reversed());
 
2134
        setTextFlowMode(CurItem->textFlowMode());
 
2135
        /*
 
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()));
 
2142
        */
 
2143
//      langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
 
2144
        if (StyledLine->currentItem())
 
2145
                StyledLine->currentItem()->setSelected(false);
 
2146
        bool setter;
 
2147
        if (CurItem->NamedLStyle.isEmpty())
 
2148
        {
 
2149
                setter = true;
 
2150
                QListWidgetItem *itemStl = NULL;
 
2151
                itemStl = StyledLine->item(0);
 
2152
                if (itemStl != NULL)
 
2153
                        itemStl->setSelected(true);
 
2154
        }
 
2155
        else
 
2156
        {
 
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));
 
2160
                setter = false;
 
2161
        }
 
2162
        LStyle->setEnabled(setter);
 
2163
        LSize->setEnabled(setter);
 
2164
        LJoinStyle->setEnabled(setter);
 
2165
        LEndStyle->setEnabled(setter);
 
2166
        if (CurItem->dashes().count() == 0)
 
2167
                dashEditor->hide();
 
2168
        else
 
2169
        {
 
2170
                LStyle->setCurrentIndex(37);
 
2171
                dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
 
2172
                dashEditor->show();
 
2173
        }
 
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 )));
 
2178
 
 
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)
 
2210
                rr = 360 - rr;
 
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);
 
2217
 
 
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()));
 
2237
 
 
2238
        if ((CurItem->isTableItem) && (CurItem->isSingleSel))
 
2239
        {
 
2240
                setter = true;
 
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);
 
2247
        }
 
2248
        else
 
2249
        {
 
2250
                setter = false;
 
2251
                TabStack3->setCurrentIndex(0);
 
2252
        }
 
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)))
 
2259
        {
 
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());
 
2277
        }
 
2278
        else
 
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)));
 
2282
        /*
 
2283
        Xpos->setReadOnly(setter);
 
2284
        Ypos->setReadOnly(setter);
 
2285
        Rotation->setReadOnly(setter);
 
2286
        */
 
2287
        if (CurItem->asPathText())
 
2288
        {
 
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);
 
2298
        }
 
2299
        else if (CurItem->asTextFrame())
 
2300
        {
 
2301
                TabStack2->setCurrentIndex(0);
 
2302
                flopItem->setHidden(false);
 
2303
                DistanceItem->setHidden(false);
 
2304
                Distance2Item->setHidden(true);
 
2305
        }
 
2306
        else
 
2307
        {
 
2308
                TabStack2->setCurrentIndex(1);
 
2309
                Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
 
2310
                flopItem->setHidden(false);
 
2311
                DistanceItem->setHidden(false);
 
2312
                Distance2Item->setHidden(true);
 
2313
        }
 
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);
 
2320
        else
 
2321
        {
 
2322
                RoundRect->setEnabled ((CurItem->asPolygon()) &&  (!CurItem->ClipEdited)  && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
 
2323
        }
 
2324
        KnockOut->setChecked(!CurItem->doOverprint);
 
2325
        Overprint->setChecked(CurItem->doOverprint);
 
2326
        if ((CurItem->itemType() == PageItem::Line) && LMode)
 
2327
        {
 
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);
 
2333
        }
 
2334
        else
 
2335
        {
 
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)));
 
2341
        }
 
2342
        HaveItem = true;
 
2343
        if (CurItem->asLine())
 
2344
        {
 
2345
                keepFrameWHRatioButton->setEnabled(false);
 
2346
                Height->setEnabled(LMode && !CurItem->locked());
 
2347
        }
 
2348
        else
 
2349
        {
 
2350
                Height->setEnabled(true);
 
2351
                keepFrameWHRatioButton->setEnabled(true);
 
2352
                if (CurItem->asImageFrame())
 
2353
                {
 
2354
                        updateCmsList();
 
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())
 
2361
                        {
 
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);
 
2369
                        }
 
2370
                        else
 
2371
                        {
 
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);
 
2380
                        }
 
2381
//CB Why do we need this? Setting it too much here
 
2382
//                      if (setter == true)
 
2383
//                      {
 
2384
//                              keepImageWHRatioButton->setChecked(setter);
 
2385
//                              keepImageDPIRatioButton->setChecked(setter);
 
2386
//                      }
 
2387
                        imageXOffsetSpinBox->setEnabled(setter);
 
2388
                        imageYOffsetSpinBox->setEnabled(setter);
 
2389
                }
 
2390
        }
 
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()));
 
2401
 
 
2402
        DoGroup->setEnabled(false);
 
2403
        DoUnGroup->setEnabled(false);
 
2404
        if (doc->m_Selection->count() > 1)
 
2405
        {
 
2406
                bool isGroup = true;
 
2407
                int firstElem = -1;
 
2408
                if (CurItem->Groups.count() != 0)
 
2409
                        firstElem = CurItem->Groups.top();
 
2410
                for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
 
2411
                {
 
2412
                        if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
 
2413
                        {
 
2414
                                if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
 
2415
                                        isGroup = false;
 
2416
                        }
 
2417
                        else
 
2418
                                isGroup = false;
 
2419
                }
 
2420
                if (!isGroup)
 
2421
                        DoGroup->setEnabled(true);
 
2422
                else
 
2423
                {
 
2424
                        if (CurItem->isGroupControl)
 
2425
                                NameEdit->setEnabled(true);
 
2426
                }
 
2427
                if ((CurItem->Groups.count() != 0) && (isGroup))
 
2428
                        DoUnGroup->setEnabled(true);
 
2429
        }
 
2430
        updateSpinBoxConstants();
 
2431
}
 
2432
 
 
2433
void PropertiesPalette::NewSel(int nr)
 
2434
{
 
2435
        if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
 
2436
                return;
 
2437
        int visID;
 
2438
        PageItem *i=0;
 
2439
        int currentTab = TabStack->currentIndex();
 
2440
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 
2441
        if (doc->m_Selection->count()>1)
 
2442
        {
 
2443
                RoVal = 0;
 
2444
                double gx, gy, gh, gw;
 
2445
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
2446
                int bp = RotationGroup->checkedId();
 
2447
                if (bp == 0)
 
2448
                        m_ScMW->view->RCenter = FPoint(gx, gy);
 
2449
                else if (bp == 1)
 
2450
                        m_ScMW->view->RCenter = FPoint(gx + gw, gy);
 
2451
                else if (bp == 2)
 
2452
                        m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
 
2453
                else if (bp == 3)
 
2454
                        m_ScMW->view->RCenter = FPoint(gx, gy + gh);
 
2455
                else if (bp == 0)
 
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:" ) );
 
2461
                HaveItem = false;
 
2462
                Xpos->setValue(0);
 
2463
                Ypos->setValue(0);
 
2464
                Width->setValue(0);
 
2465
                Height->setValue(0);
 
2466
                Rotation->setValue(0);
 
2467
                RoundRect->setValue(0);
 
2468
                HaveItem = true;
 
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)
 
2483
                {
 
2484
                        if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
 
2485
                                TabStack->setItemEnabled(idGroupItem, true);
 
2486
                }
 
2487
                FlipH->setCheckable( false );
 
2488
                FlipV->setCheckable( false );
 
2489
                FlipH->setChecked(false);
 
2490
                FlipV->setChecked(false);
 
2491
                flopRealHeight->setChecked(true);
 
2492
        }
 
2493
        else
 
2494
        {
 
2495
                if (nr!=-1)
 
2496
                {
 
2497
                        i=doc->m_Selection->itemAt(0);
 
2498
                        HaveItem=true;
 
2499
                        EditShape->setEnabled(!i->locked() && !i->sizeLocked());
 
2500
                        SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
 
2501
                }
 
2502
                else
 
2503
                {
 
2504
                        DoGroup->setEnabled(false);
 
2505
                        DoUnGroup->setEnabled(false);
 
2506
                        EditShape->setEnabled(false);
 
2507
                        SCustom->setEnabled(false);
 
2508
                }
 
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);
 
2524
                /*
 
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()));
 
2531
                */
 
2532
                
 
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))
 
2536
                {
 
2537
                        FlipH->setCheckable(true);
 
2538
                        FlipV->setCheckable(true);
 
2539
                        FlipH->setChecked(false);
 
2540
                        FlipV->setChecked(false);
 
2541
                }
 
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);
 
2549
                switch (nr)
 
2550
                {
 
2551
                case -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);
 
2559
                        HaveItem = false;
 
2560
                        Xpos->setValue(0);
 
2561
                        Ypos->setValue(0);
 
2562
                        Width->setValue(0);
 
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("  ");
 
2573
                        break;
 
2574
                case 2:
 
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());
 
2581
                        else
 
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());
 
2585
//                      if (visID == 2)
 
2586
//                              TabStack->setCurrentIndex(0);
 
2587
                        break;
 
2588
                case 4:
 
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());
 
2595
                        else
 
2596
                                RoundRect->setEnabled(false);
 
2597
//                      Distance->setEnabled(true);
 
2598
//                      if (visID == 3)
 
2599
//                              TabStack->setCurrentIndex(0);
 
2600
                        break;
 
2601
                case 5:
 
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);
 
2616
                        break;
 
2617
                case 1:
 
2618
                case 3:
 
2619
                case 6:
 
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());
 
2626
                        else
 
2627
                                RoundRect->setEnabled(false);
 
2628
//                      if ((visID == 2) || (visID == 3))
 
2629
//                              TabStack->setCurrentIndex(0);
 
2630
                        break;
 
2631
                case 7:
 
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);
 
2639
                        break;
 
2640
                case 8:
 
2641
                        TabStack->setItemEnabled(idShapeItem, true);
 
2642
                        TabStack->setItemEnabled(idTextItem, true);
 
2643
                        TabStack->setItemEnabled(idImageItem, false);
 
2644
                        TabStack->setItemEnabled(idLineItem, true);
 
2645
                        RoundRect->setEnabled(false);
 
2646
//                      if (visID == 3)
 
2647
//                              TabStack->setCurrentIndex(0);
 
2648
                        break;
 
2649
                }
 
2650
        }
 
2651
        if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
 
2652
                TabStack->setCurrentIndex(currentTab);
 
2653
        updateGeometry();
 
2654
//      setFocus();
 
2655
        repaint();
 
2656
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 
2657
}
 
2658
 
 
2659
void PropertiesPalette::setMultipleSelection(bool isMultiple)
 
2660
{
 
2661
        if (!HaveDoc)
 
2662
                return;
 
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)
 
2669
        {
 
2670
                FlipH->setCheckable( false );
 
2671
                FlipV->setCheckable( false );
 
2672
                PageItem *i;
 
2673
                uint lowestItem = 999999;
 
2674
                for (int a=0; a<doc->m_Selection->count(); ++a)
 
2675
                {
 
2676
                        i = doc->m_Selection->itemAt(a);
 
2677
                        lowestItem = qMin(lowestItem, i->ItemNr);
 
2678
                }
 
2679
                i = doc->Items->at(lowestItem);
 
2680
                SetCurItem(i);
 
2681
        }
 
2682
}
 
2683
 
 
2684
void PropertiesPalette::unitChange()
 
2685
{
 
2686
        if (!HaveDoc)
 
2687
                return;
 
2688
        bool tmp = HaveItem;
 
2689
        HaveItem = false;
 
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 );
 
2706
/*
 
2707
        double maxXYWHVal=30000 * m_unitRatio;
 
2708
        double minXYVal=-30000 * m_unitRatio;
 
2709
 
 
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;
 
2726
 
 
2727
        if (doc->unitIndex() > unitGetMaxIndex())
 
2728
                doc->setUnitIndex(0);
 
2729
        QString ein = unitGetSuffixFromIndex(doc->unitIndex());
 
2730
 
 
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);
 
2745
 
 
2746
        int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
 
2747
 
 
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 );
 
2752
 
 
2753
        imageXOffsetSpinBox->setDecimals(decimals);
 
2754
        imageXOffsetSpinBox->setMaximum( maxXYWHVal );
 
2755
        imageXOffsetSpinBox->setValue(newLX);
 
2756
 
 
2757
        imageYOffsetSpinBox->setDecimals(decimals);
 
2758
        imageYOffsetSpinBox->setMaximum( maxXYWHVal );
 
2759
        imageYOffsetSpinBox->setValue(newLY);
 
2760
 
 
2761
        dGap->setDecimals(decimals);
 
2762
        dGap->setMaximum(newGM);
 
2763
        dGap->setValue(newG);
 
2764
 
 
2765
        DLeft->setDecimals(decimals);
 
2766
        DLeft->setMaximum( 300 );
 
2767
        DLeft->setValue(newDL);
 
2768
 
 
2769
        DTop->setDecimals(decimals);
 
2770
        DTop->setMaximum( 300 );
 
2771
        DTop->setValue(newDT);
 
2772
 
 
2773
        DBottom->setDecimals(decimals);
 
2774
        DBottom->setMaximum( 300 );
 
2775
        DBottom->setValue(newDB);
 
2776
 
 
2777
        DRight->setDecimals(decimals);
 
2778
        DRight->setMaximum( 300 );
 
2779
        DRight->setValue(newDR);
 
2780
 
 
2781
        RoundRect->setValues(-newRM, newRM, decimals, newRR);
 
2782
*/
 
2783
        Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
 
2784
        HaveItem = tmp;
 
2785
}
 
2786
 
 
2787
void PropertiesPalette::setLevel(uint l)
 
2788
{
 
2789
        QString tm;
 
2790
        LevelTxt->setText(tm.setNum(l + 1));
 
2791
}
 
2792
 
 
2793
void PropertiesPalette::setXY(double x, double y)
 
2794
{
 
2795
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2796
                return;
 
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;
 
2802
        QMatrix ma;
 
2803
        FPoint n;
 
2804
        if (HaveItem)
 
2805
        {
 
2806
                if (doc->m_Selection->isMultipleSelection())
 
2807
                {
 
2808
                        doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
 
2809
                        r = 0.0;
 
2810
                        ma.translate(dummy1, dummy2);
 
2811
                }
 
2812
                else
 
2813
                {
 
2814
                        b = CurItem->width();
 
2815
                        h = CurItem->height();
 
2816
                        r = CurItem->rotation();
 
2817
                        ma.translate(x, y);
 
2818
                        useLineMode = (LMode && CurItem->isLine());
 
2819
                }
 
2820
        }
 
2821
        else
 
2822
        {
 
2823
                b = 0.0;
 
2824
                h = 0.0;
 
2825
                r = 0.0;
 
2826
                ma.translate(x, y);
 
2827
        }
 
2828
        HaveItem = false;
 
2829
//      ma.translate(x, y);
 
2830
        ma.rotate(r);
 
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);
 
2835
        else if (bp == 1)
 
2836
                n = FPoint(b, 0.0);
 
2837
        else if (bp == 2)
 
2838
                n = FPoint(b / 2.0, h / 2.0);
 
2839
        else if (bp == 3)
 
2840
                n = FPoint(0.0, h);
 
2841
        else if (bp == 4)
 
2842
                n = FPoint(b, h);
 
2843
        inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
 
2844
        inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
 
2845
        if (tmp)
 
2846
        {
 
2847
                inX -= doc->rulerXoffset;
 
2848
                inY -= doc->rulerYoffset;
 
2849
                if (doc->guidesSettings.rulerMode)
 
2850
                {
 
2851
                        inX -= doc->currentPage()->xOffset();
 
2852
                        inY -= doc->currentPage()->yOffset();
 
2853
                }
 
2854
        }
 
2855
        Xpos->setValue(inX*m_unitRatio);
 
2856
        Ypos->setValue(inY*m_unitRatio);
 
2857
        if (useLineMode)
 
2858
                setBH(CurItem->width(), CurItem->height());
 
2859
        HaveItem = tmp;
 
2860
        connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
 
2861
        connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
 
2862
}
 
2863
 
 
2864
void PropertiesPalette::setBH(double x, double y)
 
2865
{
 
2866
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2867
                return;
 
2868
        bool tmp = HaveItem;
 
2869
        HaveItem = false;
 
2870
        QMatrix ma;
 
2871
        QPoint dp;
 
2872
        if ((LMode) && (CurItem->asLine()))
 
2873
        {
 
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);
 
2880
        }
 
2881
        else
 
2882
        {
 
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);
 
2887
        }
 
2888
        HaveItem = tmp;
 
2889
}
 
2890
 
 
2891
void PropertiesPalette::setR(double r)
 
2892
{
 
2893
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2894
                return;
 
2895
        bool tmp = HaveItem;
 
2896
        double rr = r;
 
2897
        if (r > 0)
 
2898
                rr = 360 - rr;
 
2899
        HaveItem = false;
 
2900
        Rotation->setValue(fabs(rr));
 
2901
        HaveItem = tmp;
 
2902
}
 
2903
 
 
2904
void PropertiesPalette::setRR(double r)
 
2905
{
 
2906
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2907
                return;
 
2908
        bool tmp = HaveItem;
 
2909
        HaveItem = false;
 
2910
        RoundRect->setValue(r*m_unitRatio);
 
2911
        HaveItem = tmp;
 
2912
}
 
2913
 
 
2914
void PropertiesPalette::setCols(int r, double g)
 
2915
{
 
2916
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2917
                return;
 
2918
        bool tmp = HaveItem;
 
2919
        HaveItem = false;
 
2920
        DCol->setValue(r);
 
2921
        dGap->setValue(g*m_unitRatio);
 
2922
        if (tmp)
 
2923
        {
 
2924
                PageItem_TextFrame *i2=CurItem->asTextFrame();
 
2925
                if (i2!=0)
 
2926
                {
 
2927
                        DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
 
2928
                        if (colgapLabel->currentIndex() == 0)
 
2929
                        {
 
2930
                                dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
 
2931
                                dGap->setValue(i2->ColGap * m_unitRatio);
 
2932
                        }
 
2933
                        else
 
2934
                        {
 
2935
                                dGap->setMaximum(qMax((i2->width() / i2->Cols) *m_unitRatio, 0.0));
 
2936
                                dGap->setValue(i2->columnWidth() * m_unitRatio);
 
2937
                        }
 
2938
                }
 
2939
        }
 
2940
        DCol->setMinimum(1);
 
2941
        dGap->setMinimum(0);
 
2942
        colgapLabel->setEnabled(DCol->value() > 1);
 
2943
        dGap->setEnabled(DCol->value() > 1);
 
2944
        HaveItem = tmp;
 
2945
}
 
2946
 
 
2947
// NewLspMode?
 
2948
// void PropertiesPalette::setLspMode(QAction *id)
 
2949
// {
 
2950
//      if ((HaveDoc) && (HaveItem))
 
2951
//      {
 
2952
//              doc->itemSelection_SetLineSpacingMode(lineSpacingPop->actions().indexOf(id));
 
2953
//              updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
 
2954
//      }
 
2955
// }
 
2956
 
 
2957
// NewLspMode?
 
2958
void PropertiesPalette::setLineSpacingMode(int id)
 
2959
{
 
2960
        if ((HaveDoc) && (HaveItem))
 
2961
        {
 
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();
 
2968
        }
 
2969
}
 
2970
 
 
2971
void PropertiesPalette::setLsp(double r)
 
2972
{
 
2973
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2974
                return;
 
2975
        bool tmp = HaveItem;
 
2976
        HaveItem = false;
 
2977
        LineSp->setValue(r);
 
2978
        const ParagraphStyle& curStyle(tmp && doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
 
2979
        if (tmp)
 
2980
        {
 
2981
                setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r);
 
2982
                lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode());
 
2983
/*
 
2984
                QList<QAction*> actList = lineSpacingPop->actions();
 
2985
                for (int al = 0; al < actList.count(); ++al)
 
2986
                {
 
2987
                        actList[al]->setChecked(false);
 
2988
                }
 
2989
                actList[curStyle.lineSpacingMode()]->setChecked(true);
 
2990
*/
 
2991
        }
 
2992
        HaveItem = tmp;
 
2993
}
 
2994
 
 
2995
void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
 
2996
{
 
2997
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
2998
                return;
 
2999
        bool tmp = HaveItem;
 
3000
        HaveItem = false;
 
3001
        DLeft->setValue(left*m_unitRatio);
 
3002
        DTop->setValue(top*m_unitRatio);
 
3003
        DBottom->setValue(bottom*m_unitRatio);
 
3004
        DRight->setValue(right*m_unitRatio);
 
3005
        HaveItem = tmp;
 
3006
}
 
3007
 
 
3008
void PropertiesPalette::setFontFace(const QString& newFont)
 
3009
{
 
3010
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3011
                return;
 
3012
        bool tmp = HaveItem;
 
3013
        HaveItem = false;
 
3014
        if (CurItem != NULL)
 
3015
                Fonts->RebuildList(doc, CurItem->isAnnotation());
 
3016
        Fonts->setCurrentFont(newFont);
 
3017
        HaveItem = tmp;
 
3018
}
 
3019
 
 
3020
 
 
3021
void PropertiesPalette::setSize(double s)
 
3022
{
 
3023
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3024
                return;
 
3025
        bool tmp = HaveItem;
 
3026
        HaveItem = false;
 
3027
        Size->setValue(s / 10.0);
 
3028
        HaveItem = tmp;
 
3029
}
 
3030
 
 
3031
void PropertiesPalette::setExtra(double e)
 
3032
{
 
3033
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3034
                return;
 
3035
        bool tmp = HaveItem;
 
3036
        HaveItem = false;
 
3037
        Extra->setValue(e / 10.0);
 
3038
        HaveItem = tmp;
 
3039
}
 
3040
 
 
3041
void PropertiesPalette::ChangeScaling()
 
3042
{
 
3043
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3044
                return;
 
3045
        if (FreeScale == sender())
 
3046
        {
 
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);
 
3056
        }
 
3057
        if (FrameScale == sender())
 
3058
        {
 
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);
 
3068
        }
 
3069
        if ((HaveDoc) && (HaveItem))
 
3070
        {
 
3071
                CurItem->setImageScalingMode(FreeScale->isChecked(), Aspect->isChecked());
 
3072
                emit UpdtGui(PageItem::ImageFrame);
 
3073
                emit DocChanged();
 
3074
//              setFocus();
 
3075
        }
 
3076
}
 
3077
 
 
3078
void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
 
3079
{
 
3080
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3081
                return;
 
3082
        bool tmp = HaveItem;
 
3083
        HaveItem = false;
 
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)
 
3091
        {
 
3092
                keepImageWHRatioButton->setChecked(false);
 
3093
                keepImageDPIRatioButton->setChecked(false);
 
3094
        }
 
3095
        if (tmp)
 
3096
        {
 
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);
 
3103
        }
 
3104
        else
 
3105
        {
 
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);
 
3112
        }
 
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()));
 
3119
        HaveItem = tmp;
 
3120
}
 
3121
 
 
3122
void PropertiesPalette::setLineWidth(double s)
 
3123
{
 
3124
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3125
                return;
 
3126
        bool tmp = HaveItem;
 
3127
        HaveItem = false;
 
3128
        LSize->setValue(s*m_unitRatio);
 
3129
        if (tmp)
 
3130
        {
 
3131
                if (CurItem->dashes().count() != 0)
 
3132
                {
 
3133
                        if (CurItem->lineWidth() != 0.0)
 
3134
                        {
 
3135
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
 
3136
                                dashEditor->setEnabled(true);
 
3137
                        }
 
3138
                        else
 
3139
                                dashEditor->setEnabled(false);
 
3140
                }
 
3141
        }
 
3142
        HaveItem = tmp;
 
3143
}
 
3144
 
 
3145
void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
 
3146
{
 
3147
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3148
                return;
 
3149
        bool tmp = HaveItem;
 
3150
        HaveItem = false;
 
3151
        if (tmp)
 
3152
        {
 
3153
                if (CurItem->dashes().count() != 0)
 
3154
                {
 
3155
                        LStyle->setCurrentIndex(37);
 
3156
                        dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
 
3157
                }
 
3158
                else
 
3159
                        LStyle->setCurrentIndex(static_cast<int>(p) - 1);
 
3160
        }
 
3161
        else
 
3162
                LStyle->setCurrentIndex(static_cast<int>(p) - 1);
 
3163
        switch (pc)
 
3164
        {
 
3165
        case Qt::FlatCap:
 
3166
                LEndStyle->setCurrentIndex(0);
 
3167
                break;
 
3168
        case Qt::SquareCap:
 
3169
                LEndStyle->setCurrentIndex(1);
 
3170
                break;
 
3171
        case Qt::RoundCap:
 
3172
                LEndStyle->setCurrentIndex(2);
 
3173
                break;
 
3174
        default:
 
3175
                LEndStyle->setCurrentIndex(0);
 
3176
                break;
 
3177
        }
 
3178
        switch (pj)
 
3179
        {
 
3180
        case Qt::MiterJoin:
 
3181
                LJoinStyle->setCurrentIndex(0);
 
3182
                break;
 
3183
        case Qt::BevelJoin:
 
3184
                LJoinStyle->setCurrentIndex(1);
 
3185
                break;
 
3186
        case Qt::RoundJoin:
 
3187
                LJoinStyle->setCurrentIndex(2);
 
3188
                break;
 
3189
        default:
 
3190
                LJoinStyle->setCurrentIndex(0);
 
3191
                break;
 
3192
        }
 
3193
        HaveItem = tmp;
 
3194
}
 
3195
 
 
3196
void PropertiesPalette::setFlop( FirstLineOffsetPolicy f )
 
3197
{
 
3198
        if(f == FLOPFontAscent)
 
3199
                flopFontAscent->setChecked(true);
 
3200
        else if(f == FLOPLineSpacing)
 
3201
                flopLineSpacing->setChecked(true);
 
3202
        else
 
3203
                flopRealHeight->setChecked(true); //It’s historical behaviour.
 
3204
}
 
3205
 
 
3206
void PropertiesPalette::setupLineSpacingSpinbox(int mode, double value)
 
3207
{
 
3208
        if (mode > 0)
 
3209
        {
 
3210
                if (mode==1)
 
3211
                        LineSp->setSpecialValueText( tr( "Auto" ) );
 
3212
                if (mode==2)
 
3213
                        LineSp->setSpecialValueText( tr( "Baseline" ) );
 
3214
                LineSp->setMinimum(0);
 
3215
                LineSp->setValue(0);
 
3216
                LineSp->setEnabled(false);
 
3217
        }
 
3218
        else
 
3219
        {
 
3220
                LineSp->setSpecialValueText("");
 
3221
                LineSp->setMinimum(1);
 
3222
                LineSp->setValue(value);
 
3223
                LineSp->setEnabled(true);
 
3224
        }
 
3225
}
 
3226
 
 
3227
void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
 
3228
{
 
3229
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3230
                return;
 
3231
        bool tmp = HaveItem;
 
3232
        HaveItem = false;
 
3233
        setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
 
3234
        lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
 
3235
        /*
 
3236
        QList<QAction*> actList = lineSpacingPop->actions();
 
3237
        for (int al = 0; al < actList.count(); ++al)
 
3238
        {
 
3239
                actList[al]->setChecked(false);
 
3240
        }
 
3241
        actList[newCurrent.lineSpacingMode()]->setChecked(true);
 
3242
        */
 
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);
 
3248
        
 
3249
        updateOpticalMargins(newCurrent);
 
3250
        
 
3251
        HaveItem = tmp;
 
3252
        
 
3253
        
 
3254
}
 
3255
 
 
3256
void PropertiesPalette::setStil(int s)
 
3257
{
 
3258
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3259
                return;
 
3260
        StrokeIcon->setEnabled(false);
 
3261
        TxStroke->setEnabled(false);
 
3262
        PM1->setEnabled(false);
 
3263
        SeStyle->setStyle(s);
 
3264
        if ((s & 4) || (s & 256))
 
3265
        {
 
3266
                StrokeIcon->setEnabled(true);
 
3267
                TxStroke->setEnabled(true);
 
3268
                PM1->setEnabled(true);
 
3269
        }
 
3270
}
 
3271
 
 
3272
void PropertiesPalette::setAli(int e)
 
3273
{
 
3274
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3275
                return;
 
3276
        bool tmp = HaveItem;
 
3277
        HaveItem = false;
 
3278
        GroupAlign->setEnabled(true);
 
3279
        GroupAlign->setStyle(e);
 
3280
        HaveItem = tmp;
 
3281
}
 
3282
 
 
3283
 
 
3284
void PropertiesPalette::setParStyle(const QString& name)
 
3285
{
 
3286
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3287
                return;
 
3288
        bool tmp = HaveItem;
 
3289
        HaveItem = false;
 
3290
        paraStyleCombo->setFormat(name);
 
3291
        HaveItem = tmp;
 
3292
}
 
3293
 
 
3294
 
 
3295
void PropertiesPalette::setCharStyle(const QString& name)
 
3296
{
 
3297
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3298
                return;
 
3299
        bool tmp = HaveItem;
 
3300
        HaveItem = false;
 
3301
        charStyleCombo->setFormat(name);
 
3302
        HaveItem = tmp;
 
3303
}
 
3304
 
 
3305
void PropertiesPalette::setOpticalMargins()
 
3306
{
 
3307
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3308
                return;
 
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;
 
3319
 
 
3320
        doc->itemSelection_SetOpticalMargins(omt);
 
3321
        if (CurItem->asTextFrame())
 
3322
                CurItem->asTextFrame()->updateUndo();
 
3323
}
 
3324
 
 
3325
void PropertiesPalette::resetOpticalMargins()
 
3326
{
 
3327
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3328
                return;
 
3329
        doc->itemSelection_resetOpticalMargins();
 
3330
}
 
3331
 
 
3332
void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
 
3333
{
 
3334
        
 
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);
 
3342
        else
 
3343
                optMarginRadioNone->setChecked(true);
 
3344
}
 
3345
 
 
3346
void PropertiesPalette::setMinWordTracking()
 
3347
{
 
3348
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3349
                return;
 
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);
 
3357
}
 
3358
 
 
3359
 
 
3360
void PropertiesPalette::setNormWordTracking()
 
3361
{
 
3362
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3363
                return;
 
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);
 
3372
}
 
3373
 
 
3374
void PropertiesPalette::setMinGlyphExtension()
 
3375
{
 
3376
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3377
                return;
 
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);
 
3385
}
 
3386
 
 
3387
void PropertiesPalette::setMaxGlyphExtension()
 
3388
{
 
3389
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3390
                return;
 
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);
 
3398
}
 
3399
 
 
3400
 
 
3401
void PropertiesPalette::setTScaleV(double e)
 
3402
{
 
3403
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3404
                return;
 
3405
        bool tmp = HaveItem;
 
3406
        HaveItem = false;
 
3407
        ChScaleV->setValue(e / 10.0);
 
3408
        HaveItem = tmp;
 
3409
}
 
3410
 
 
3411
void PropertiesPalette::NewTScaleV()
 
3412
{
 
3413
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3414
                return;
 
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);
 
3420
}
 
3421
 
 
3422
void PropertiesPalette::NewTBase()
 
3423
{
 
3424
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3425
                return;
 
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);
 
3431
}
 
3432
 
 
3433
void PropertiesPalette::setTScale(double e)
 
3434
{
 
3435
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3436
                return;
 
3437
        bool tmp = HaveItem;
 
3438
        HaveItem = false;
 
3439
        ChScale->setValue(e / 10.0);
 
3440
        HaveItem = tmp;
 
3441
}
 
3442
 
 
3443
void PropertiesPalette::setTBase(double e)
 
3444
{
 
3445
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3446
                return;
 
3447
        bool tmp = HaveItem;
 
3448
        HaveItem = false;
 
3449
        ChBase->setValue(e / 10.0);
 
3450
        HaveItem = tmp;
 
3451
}
 
3452
 
 
3453
void PropertiesPalette::NewTScale()
 
3454
{
 
3455
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3456
                return;
 
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);
 
3462
}
 
3463
 
 
3464
void PropertiesPalette::NewX()
 
3465
{
 
3466
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3467
                return;
 
3468
        if ((HaveDoc) && (HaveItem))
 
3469
        {
 
3470
                double x,y,w,h, gx, gy, gh, gw, base;
 
3471
                QMatrix ma;
 
3472
                x = Xpos->value() / m_unitRatio;
 
3473
                y = Ypos->value() / m_unitRatio;
 
3474
                w = Width->value() / m_unitRatio;
 
3475
                h = Height->value() / m_unitRatio;
 
3476
                base = 0;
 
3477
                x += doc->rulerXoffset;
 
3478
                y += doc->rulerYoffset;
 
3479
                if (doc->guidesSettings.rulerMode)
 
3480
                {
 
3481
                        x += doc->currentPage()->xOffset();
 
3482
                        y += doc->currentPage()->yOffset();
 
3483
                }
 
3484
                if (doc->m_Selection->isMultipleSelection())
 
3485
                {
 
3486
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3487
                        int bp = RotationGroup->checkedId();
 
3488
                        if ((bp == 0) || (bp == 3))
 
3489
                                base = gx;
 
3490
                        else if (bp == 2)
 
3491
                                base = gx + gw / 2.0;
 
3492
                        else if ((bp == 1) || (bp == 4))
 
3493
                                base = gx + gw;
 
3494
                        if (!_userActionOn)
 
3495
                                m_ScMW->view->startGroupTransaction();
 
3496
                        doc->moveGroup(x - base, 0, true);
 
3497
                        if (!_userActionOn)
 
3498
                        {
 
3499
                                m_ScMW->view->endGroupTransaction();
 
3500
                        }
 
3501
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3502
                        setXY(gx, gy);
 
3503
                }
 
3504
                else
 
3505
                {
 
3506
                        if ((CurItem->asLine()) && (LMode))
 
3507
                        {
 
3508
                                w += doc->rulerXoffset;
 
3509
                                h += doc->rulerYoffset;
 
3510
                                if (doc->guidesSettings.rulerMode)
 
3511
                                {
 
3512
                                        w += doc->currentPage()->xOffset();
 
3513
                                        h += doc->currentPage()->yOffset();
 
3514
                                }
 
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);
 
3522
                        }
 
3523
                        else
 
3524
                        {
 
3525
                                ma.translate(CurItem->xPos(), CurItem->yPos());
 
3526
                                ma.rotate(CurItem->rotation());
 
3527
                                int bp = RotationGroup->checkedId();
 
3528
                                if (bp == 0)
 
3529
                                        base = CurItem->xPos();
 
3530
                                else if (bp == 2)
 
3531
                                        base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
 
3532
                                else if (bp == 1)
 
3533
                                        base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
 
3534
                                else if (bp == 4)
 
3535
                                        base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
 
3536
                                else if (bp == 3)
 
3537
                                        base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
 
3538
                                doc->MoveItem(x - base, 0, CurItem, true);
 
3539
                        }
 
3540
                }
 
3541
                doc->regionsChanged()->update(QRect());
 
3542
                emit DocChanged();
 
3543
        }
 
3544
}
 
3545
 
 
3546
void PropertiesPalette::NewY()
 
3547
{
 
3548
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3549
                return;
 
3550
 
 
3551
        double x,y,w,h, gx, gy, gh, gw, base;
 
3552
        QMatrix ma;
 
3553
        x = Xpos->value() / m_unitRatio;
 
3554
        y = Ypos->value() / m_unitRatio;
 
3555
        w = Width->value() / m_unitRatio;
 
3556
        h = Height->value() / m_unitRatio;
 
3557
        base = 0;
 
3558
        x += doc->rulerXoffset;
 
3559
        y += doc->rulerYoffset;
 
3560
        if (doc->guidesSettings.rulerMode)
 
3561
        {
 
3562
                x += doc->currentPage()->xOffset();
 
3563
                y += doc->currentPage()->yOffset();
 
3564
        }
 
3565
        if (doc->m_Selection->isMultipleSelection())
 
3566
        {
 
3567
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3568
                int bp = RotationGroup->checkedId();
 
3569
                if ((bp == 0) || (bp == 1))
 
3570
                        base = gy;
 
3571
                else if (bp == 2)
 
3572
                        base = gy + gh / 2.0;
 
3573
                else if ((bp == 3) || (bp == 4))
 
3574
                        base = gy + gh;
 
3575
                if (!_userActionOn)
 
3576
                        m_ScMW->view->startGroupTransaction();
 
3577
                doc->moveGroup(0, y - base, true);
 
3578
                if (!_userActionOn)
 
3579
                {
 
3580
                        m_ScMW->view->endGroupTransaction();
 
3581
                }
 
3582
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3583
                setXY(gx, gy);
 
3584
        }
 
3585
        else
 
3586
        {
 
3587
                if ((CurItem->asLine()) && (LMode))
 
3588
                {
 
3589
                        w += doc->rulerXoffset;
 
3590
                        h += doc->rulerYoffset;
 
3591
                        if (doc->guidesSettings.rulerMode)
 
3592
                        {
 
3593
                                w += doc->currentPage()->xOffset();
 
3594
                                h += doc->currentPage()->yOffset();
 
3595
                        }
 
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);
 
3603
                }
 
3604
                else
 
3605
                {
 
3606
                        ma.translate(CurItem->xPos(), CurItem->yPos());
 
3607
                        ma.rotate(CurItem->rotation());
 
3608
                        int bp = RotationGroup->checkedId();
 
3609
                        if (bp == 0)
 
3610
                                base = CurItem->yPos();
 
3611
                        else if (bp == 2)
 
3612
                                base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
 
3613
                        else if (bp == 1)
 
3614
                                base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
 
3615
                        else if (bp == 4)
 
3616
                                base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
 
3617
                        else if (bp == 3)
 
3618
                                base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
 
3619
                        doc->MoveItem(0, y - base, CurItem, true);
 
3620
                }
 
3621
        }
 
3622
        doc->regionsChanged()->update(QRect());
 
3623
        emit DocChanged();
 
3624
}
 
3625
 
 
3626
void PropertiesPalette::NewW()
 
3627
{
 
3628
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3629
                return;
 
3630
        
 
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())
 
3637
        {
 
3638
                if (!_userActionOn)
 
3639
                        m_ScMW->view->startGroupTransaction();
 
3640
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3641
                if (keepFrameWHRatioButton->isChecked())
 
3642
                {
 
3643
//                      m_ScMW->view->frameResizeHandle = 1;
 
3644
                        doc->scaleGroup(w / gw, w / gw, false);
 
3645
                        setBH(w, (w / gw) * gh);
 
3646
                }
 
3647
                else
 
3648
                {
 
3649
//                      m_ScMW->view->frameResizeHandle = 6;
 
3650
                        doc->scaleGroup(w / gw, 1.0, false);
 
3651
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3652
                        setBH(gw, gh);
 
3653
                }
 
3654
                if (!_userActionOn)
 
3655
                {
 
3656
                        m_ScMW->view->endGroupTransaction();
 
3657
                }
 
3658
        }
 
3659
        else
 
3660
        {
 
3661
                bool oldS = CurItem->Sizing;
 
3662
                CurItem->Sizing = false;
 
3663
                CurItem->OldB2 = CurItem->width();
 
3664
                CurItem->OldH2 = CurItem->height();
 
3665
                if (CurItem->asLine())
 
3666
                {
 
3667
                        if (LMode)
 
3668
                        {
 
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));
 
3672
                        }
 
3673
                        doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
 
3674
                }
 
3675
                else
 
3676
                {
 
3677
                        double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
 
3678
                        if (CurItem->isTableItem)
 
3679
                        {
 
3680
                                int rmo = doc->RotMode;
 
3681
                                doc->RotMode = 0;
 
3682
                                double dist = w - CurItem->width();
 
3683
                                PageItem* bb2;
 
3684
                                PageItem* bb = CurItem;
 
3685
                                while (bb->TopLink != 0)
 
3686
                                {
 
3687
                                        bb = bb->TopLink;
 
3688
                                }
 
3689
                                while (bb->BottomLink != 0)
 
3690
                                {
 
3691
                                        bb2 = bb;
 
3692
                                        while (bb2->RightLink != 0)
 
3693
                                        {
 
3694
                                                doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
 
3695
                                                bb2 = bb2->RightLink;
 
3696
                                        }
 
3697
                                        doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
 
3698
                                        bb = bb->BottomLink;
 
3699
                                }
 
3700
                                bb2 = bb;
 
3701
                                while (bb2->RightLink != 0)
 
3702
                                {
 
3703
                                        doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
 
3704
                                        bb2 = bb2->RightLink;
 
3705
                                }
 
3706
                                doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
 
3707
                                doc->RotMode = rmo;
 
3708
                                if (keepFrameWHRatioButton->isChecked())
 
3709
                                {
 
3710
                                        keepFrameWHRatioButton->setChecked(false);
 
3711
                                        setBH(w, (w / oldW) * CurItem->height());
 
3712
                                        NewH();
 
3713
                                        keepFrameWHRatioButton->setChecked(true);
 
3714
                                }
 
3715
                        }
 
3716
                        else
 
3717
                        {
 
3718
                                if (keepFrameWHRatioButton->isChecked())
 
3719
                                {
 
3720
                                        setBH(w, (w / oldW) * CurItem->height());
 
3721
                                        doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
 
3722
                                }
 
3723
                                else
 
3724
                                        doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
 
3725
                        }
 
3726
                }
 
3727
                CurItem->Sizing = oldS;
 
3728
        }
 
3729
        emit DocChanged();
 
3730
        doc->regionsChanged()->update(QRect());
 
3731
}
 
3732
 
 
3733
void PropertiesPalette::NewH()
 
3734
{
 
3735
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3736
                return;
 
3737
        if ((HaveDoc) && (HaveItem))
 
3738
        {
 
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())
 
3745
                {
 
3746
                        if (!_userActionOn)
 
3747
                                m_ScMW->view->startGroupTransaction();
 
3748
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3749
                        if (keepFrameWHRatioButton->isChecked())
 
3750
                        {
 
3751
//                              m_ScMW->view->frameResizeHandle = 1;
 
3752
                                doc->scaleGroup(h / gh, h / gh, false);
 
3753
                                setBH((h / gh) * gw, h);
 
3754
                        }
 
3755
                        else
 
3756
                        {
 
3757
//                              m_ScMW->view->frameResizeHandle = 5;
 
3758
                                doc->scaleGroup(1.0, h / gh, false);
 
3759
                                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3760
                                setBH(gw, gh);
 
3761
                        }
 
3762
                        if (!_userActionOn)
 
3763
                        {
 
3764
                                m_ScMW->view->endGroupTransaction();
 
3765
                        }
 
3766
                }
 
3767
                else
 
3768
                {
 
3769
                        bool oldS = CurItem->Sizing;
 
3770
                        CurItem->Sizing = false;
 
3771
                        CurItem->OldB2 = CurItem->width();
 
3772
                        CurItem->OldH2 = CurItem->height();
 
3773
                        if (CurItem->asLine())
 
3774
                        {
 
3775
                                if (LMode)
 
3776
                                {
 
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));
 
3780
                                }
 
3781
                                doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
 
3782
                        }
 
3783
                        else
 
3784
                        {
 
3785
                                double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
 
3786
                                if (CurItem->isTableItem)
 
3787
                                {
 
3788
                                        int rmo = doc->RotMode;
 
3789
                                        doc->RotMode = 0;
 
3790
                                        double dist = h - CurItem->height();
 
3791
                                        PageItem* bb2;
 
3792
                                        PageItem* bb = CurItem;
 
3793
                                        while (bb->LeftLink != 0)
 
3794
                                        {
 
3795
                                                bb = bb->LeftLink;
 
3796
                                        }
 
3797
                                        while (bb->RightLink != 0)
 
3798
                                        {
 
3799
                                                bb2 = bb;
 
3800
                                                while (bb2->BottomLink != 0)
 
3801
                                                {
 
3802
                                                        doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
 
3803
                                                        bb2 = bb2->BottomLink;
 
3804
                                                }
 
3805
                                                doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
 
3806
                                                bb = bb->RightLink;
 
3807
                                        }
 
3808
                                        bb2 = bb;
 
3809
                                        while (bb2->BottomLink != 0)
 
3810
                                        {
 
3811
                                                doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
 
3812
                                                bb2 = bb2->BottomLink;
 
3813
                                        }
 
3814
                                        doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
 
3815
                                        doc->RotMode = rmo;
 
3816
                                        if (keepFrameWHRatioButton->isChecked())
 
3817
                                        {
 
3818
                                                keepFrameWHRatioButton->setChecked(false);
 
3819
                                                setBH((h / oldH) * CurItem->width(), h);
 
3820
                                                NewW();
 
3821
                                                keepFrameWHRatioButton->setChecked(true);
 
3822
                                        }
 
3823
                                }
 
3824
                                else
 
3825
                                {
 
3826
                                        if (keepFrameWHRatioButton->isChecked())
 
3827
                                        {
 
3828
                                                setBH((h / oldH) * CurItem->width(), h);
 
3829
                                                doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
 
3830
                                        }
 
3831
                                        else
 
3832
                                                doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
 
3833
                                }
 
3834
                        }
 
3835
                        CurItem->Sizing = oldS;
 
3836
                }
 
3837
                emit DocChanged();
 
3838
                doc->regionsChanged()->update(QRect());
 
3839
        }
 
3840
}
 
3841
 
 
3842
void PropertiesPalette::setRotation()
 
3843
{
 
3844
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3845
                return;
 
3846
        double gx, gy, gh, gw;
 
3847
        if ((HaveDoc) && (HaveItem))
 
3848
        {
 
3849
                if (!_userActionOn)
 
3850
                        m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
 
3851
                if (doc->m_Selection->isMultipleSelection())
 
3852
                {
 
3853
                        doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
 
3854
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
3855
                        setXY(gx, gy);
 
3856
                }
 
3857
                else
 
3858
                        doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
 
3859
                if (!_userActionOn)
 
3860
                {
 
3861
                        for (int i = 0; i < doc->m_Selection->count(); ++i)
 
3862
                                doc->m_Selection->itemAt(i)->checkChanges(true);
 
3863
                        m_ScMW->view->endGroupTransaction();
 
3864
                }
 
3865
                emit DocChanged();
 
3866
                doc->regionsChanged()->update(QRect());
 
3867
                RoVal = Rotation->value();
 
3868
        }
 
3869
}
 
3870
 
 
3871
void PropertiesPalette::NewCornerRadius()
 
3872
{
 
3873
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3874
                return;
 
3875
        CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
 
3876
        m_ScMW->view->SetFrameRounded();
 
3877
        emit DocChanged();
 
3878
        doc->regionsChanged()->update(QRect());
 
3879
}
 
3880
 
 
3881
void PropertiesPalette::NewLineSpacing()
 
3882
{
 
3883
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3884
                return;
 
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();
 
3890
}
 
3891
 
 
3892
void PropertiesPalette::HandleGapSwitch()
 
3893
{
 
3894
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3895
                return;
 
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" ) );
 
3901
        else
 
3902
                dGap->setToolTip( tr( "Column width" ) );
 
3903
}
 
3904
 
 
3905
void PropertiesPalette::NewCols()
 
3906
{
 
3907
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3908
                return;
 
3909
        CurItem->Cols = DCol->value();
 
3910
        setCols(CurItem->Cols, CurItem->ColGap);
 
3911
        CurItem->update();
 
3912
        emit DocChanged();
 
3913
}
 
3914
 
 
3915
void PropertiesPalette::NewPage()
 
3916
{
 
3917
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3918
                return;
 
3919
        bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
 
3920
        CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
 
3921
        if (reallynew)
 
3922
                CurItem->loadImage(CurItem->externalFile(), true);
 
3923
        CurItem->update();
 
3924
}
 
3925
 
 
3926
void PropertiesPalette::NewGap()
 
3927
{
 
3928
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3929
                return;
 
3930
        if (colgapLabel->currentIndex() == 0)
 
3931
                CurItem->ColGap = dGap->value() / m_unitRatio;
 
3932
        else if (CurItem->Cols > 1)
 
3933
        {
 
3934
                double lineCorr;
 
3935
                if (CurItem->lineColor() != CommonStrings::None)
 
3936
                        lineCorr = CurItem->lineWidth();
 
3937
                else
 
3938
                        lineCorr = 0;
 
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;
 
3942
        }
 
3943
        CurItem->update();
 
3944
        emit DocChanged();
 
3945
}
 
3946
 
 
3947
void PropertiesPalette::NewSize()
 
3948
{
 
3949
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3950
                return;
 
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);
 
3956
}
 
3957
 
 
3958
void PropertiesPalette::NewTracking()
 
3959
{
 
3960
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3961
                return;
 
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);
 
3967
}
 
3968
 
 
3969
void PropertiesPalette::NewLocalXY()
 
3970
{
 
3971
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
3972
                return;
 
3973
        doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
 
3974
}
 
3975
 
 
3976
void PropertiesPalette::NewLocalSC()
 
3977
{
 
3978
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3979
                return;
 
3980
        if ((HaveDoc) && (HaveItem))
 
3981
        {
 
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());
 
3984
                */
 
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()));
 
3993
        }
 
3994
}
 
3995
 
 
3996
void PropertiesPalette::NewLocalDpi()
 
3997
{
 
3998
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
3999
                return;
 
4000
        if ((HaveDoc) && (HaveItem))
 
4001
        {
 
4002
                /*
 
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());
 
4005
                */
 
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()));
 
4014
        }
 
4015
}
 
4016
 
 
4017
void PropertiesPalette::handleImageEffects()
 
4018
{
 
4019
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4020
                return;
 
4021
        m_ScMW->ImageEffects();
 
4022
}
 
4023
 
 
4024
void PropertiesPalette::handleExtImgProperties()
 
4025
{
 
4026
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4027
                return;
 
4028
        m_ScMW->view->editExtendedImageProperties();
 
4029
        emit DocChanged();
 
4030
}
 
4031
 
 
4032
void PropertiesPalette::NewLineWidth()
 
4033
{
 
4034
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4035
                return;
 
4036
        if ((HaveDoc) && (HaveItem))
 
4037
        {
 
4038
                double oldL = CurItem->lineWidth();
 
4039
                doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
 
4040
                if (CurItem->dashes().count() != 0)
 
4041
                {
 
4042
                        if ((oldL != 0.0) && (CurItem->lineWidth() != 0.0))
 
4043
                        {
 
4044
                                for (int a = 0; a < CurItem->DashValues.count(); a++)
 
4045
                                {
 
4046
                                        CurItem->DashValues[a] = CurItem->DashValues[a] / oldL * CurItem->lineWidth();
 
4047
                                }
 
4048
                                CurItem->setDashOffset(CurItem->dashOffset() / oldL * CurItem->lineWidth());
 
4049
                        }
 
4050
                        if (CurItem->lineWidth() != 0.0)
 
4051
                        {
 
4052
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
 
4053
                                dashEditor->setEnabled(true);
 
4054
                        }
 
4055
                        else
 
4056
                                dashEditor->setEnabled(false);
 
4057
                }
 
4058
//              emit DocChanged();
 
4059
        }
 
4060
}
 
4061
 
 
4062
void PropertiesPalette::setStartArrow(int id)
 
4063
{
 
4064
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4065
                return;
 
4066
        doc->itemSelection_ApplyArrowHead(id,-1);
 
4067
}
 
4068
 
 
4069
void PropertiesPalette::setEndArrow(int id)
 
4070
{
 
4071
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4072
                return;
 
4073
        if ((HaveDoc) && (HaveItem))
 
4074
                doc->itemSelection_ApplyArrowHead(-1, id);
 
4075
}
 
4076
 
 
4077
void PropertiesPalette::NewLineStyle()
 
4078
{
 
4079
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4080
                return;
 
4081
        if ((HaveDoc) && (HaveItem))
 
4082
        {
 
4083
                if (LStyle->currentIndex() == 37)
 
4084
                {
 
4085
                        if (CurItem->dashes().count() == 0)
 
4086
                        {
 
4087
                                if ((CurItem->lineStyle() == 0) || (CurItem->lineStyle() == 1))
 
4088
                                {
 
4089
                                        CurItem->DashValues.append(4.0 * qMax(CurItem->lineWidth(), 1.0));
 
4090
                                        CurItem->DashValues.append(2.0 * qMax(CurItem->lineWidth(), 1.0));
 
4091
                                }
 
4092
                                else
 
4093
                                        getDashArray(CurItem->lineStyle(), qMax(CurItem->lineWidth(), 1.0), CurItem->DashValues);
 
4094
                        }
 
4095
                        if (CurItem->lineWidth() != 0.0)
 
4096
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
 
4097
                        else
 
4098
                        {
 
4099
                                dashEditor->setEnabled(false);
 
4100
                                dashEditor->setDashValues(CurItem->dashes(), 1.0, CurItem->dashOffset());
 
4101
                        }
 
4102
                        dashEditor->show();
 
4103
                        CurItem->update();
 
4104
                }
 
4105
                else
 
4106
                {
 
4107
                        CurItem->DashValues.clear();
 
4108
                        dashEditor->hide();
 
4109
                        doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
 
4110
                }
 
4111
        }
 
4112
}
 
4113
 
 
4114
void PropertiesPalette::dashChange()
 
4115
{
 
4116
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4117
                return;
 
4118
        if ((HaveDoc) && (HaveItem))
 
4119
        {
 
4120
                if (CurItem->lineWidth() != 0.0)
 
4121
                {
 
4122
                        CurItem->setDashes(dashEditor->getDashValues(CurItem->lineWidth()));
 
4123
                        CurItem->setDashOffset(dashEditor->Offset->value() * CurItem->lineWidth());
 
4124
                }
 
4125
                CurItem->update();
 
4126
                emit DocChanged();
 
4127
        }
 
4128
}
 
4129
 
 
4130
void PropertiesPalette::NewLineMode()
 
4131
{
 
4132
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4133
                return;
 
4134
        if (LineMode->currentIndex() == 0)
 
4135
        {
 
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);
 
4142
                LMode = false;
 
4143
        }
 
4144
        else
 
4145
        {
 
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);
 
4152
                LMode = true;
 
4153
        }
 
4154
        setBH(CurItem->width(), CurItem->height());
 
4155
        updateGeometry();
 
4156
//      setFocus();
 
4157
        repaint();
 
4158
}
 
4159
 
 
4160
void PropertiesPalette::NewLineJoin()
 
4161
{
 
4162
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4163
                return;
 
4164
        Qt::PenJoinStyle c = Qt::MiterJoin;
 
4165
        switch (LJoinStyle->currentIndex())
 
4166
        {
 
4167
        case 0:
 
4168
                c = Qt::MiterJoin;
 
4169
                break;
 
4170
        case 1:
 
4171
                c = Qt::BevelJoin;
 
4172
                break;
 
4173
        case 2:
 
4174
                c = Qt::RoundJoin;
 
4175
                break;
 
4176
        }
 
4177
        if ((HaveDoc) && (HaveItem))
 
4178
                doc->itemSelection_SetLineJoin(c);
 
4179
}
 
4180
 
 
4181
void PropertiesPalette::NewLineEnd()
 
4182
{
 
4183
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4184
                return;
 
4185
        Qt::PenCapStyle c = Qt::FlatCap;
 
4186
        switch (LEndStyle->currentIndex())
 
4187
        {
 
4188
        case 0:
 
4189
                c = Qt::FlatCap;
 
4190
                break;
 
4191
        case 1:
 
4192
                c = Qt::SquareCap;
 
4193
                break;
 
4194
        case 2:
 
4195
                c = Qt::RoundCap;
 
4196
                break;
 
4197
        }
 
4198
        if ((HaveDoc) && (HaveItem))
 
4199
                doc->itemSelection_SetLineEnd(c);
 
4200
}
 
4201
 
 
4202
void PropertiesPalette::ToggleKette()
 
4203
{
 
4204
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4205
                return;
 
4206
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 
4207
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
 
4208
        if (keepImageWHRatioButton->isChecked())
 
4209
        {
 
4210
                imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
 
4211
                NewLocalSC();
 
4212
                keepImageDPIRatioButton->setChecked(true);
 
4213
        }
 
4214
        else
 
4215
                keepImageDPIRatioButton->setChecked(false);
 
4216
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 
4217
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
 
4218
}
 
4219
 
 
4220
void PropertiesPalette::HChange()
 
4221
{
 
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());
 
4226
        NewLocalSC();
 
4227
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 
4228
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
 
4229
}
 
4230
 
 
4231
void PropertiesPalette::VChange()
 
4232
{
 
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());
 
4237
        NewLocalSC();
 
4238
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 
4239
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
 
4240
}
 
4241
 
 
4242
void PropertiesPalette::ToggleKetteD()
 
4243
{
 
4244
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4245
                return;
 
4246
        disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
 
4247
        disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
 
4248
        if (keepImageDPIRatioButton->isChecked())
 
4249
        {
 
4250
                imgDpiY->setValue(imgDpiX->value());
 
4251
                NewLocalDpi();
 
4252
                keepImageWHRatioButton->setChecked(true);
 
4253
        }
 
4254
        else
 
4255
                keepImageWHRatioButton->setChecked(false);
 
4256
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
 
4257
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
 
4258
}
 
4259
 
 
4260
void PropertiesPalette::HChangeD()
 
4261
{
 
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());
 
4266
        NewLocalDpi();
 
4267
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
 
4268
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
 
4269
}
 
4270
 
 
4271
void PropertiesPalette::VChangeD()
 
4272
{
 
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());
 
4277
        NewLocalDpi();
 
4278
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
 
4279
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
 
4280
}
 
4281
 
 
4282
void PropertiesPalette::NewAlignement(int a)
 
4283
{
 
4284
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4285
                return;
 
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();
 
4291
}
 
4292
 
 
4293
void PropertiesPalette::setTypeStyle(int s)
 
4294
{
 
4295
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4296
                return;
 
4297
        if (CurItem->asTextFrame())
 
4298
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
 
4299
        emit NewEffects(s);
 
4300
        if (CurItem->asTextFrame())
 
4301
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
 
4302
}
 
4303
 
 
4304
void PropertiesPalette::newShadowOffs()
 
4305
{
 
4306
        if ((HaveDoc) && (HaveItem))
 
4307
        {
 
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);
 
4315
        }
 
4316
}
 
4317
 
 
4318
void PropertiesPalette::setShadowOffs(double x, double y)
 
4319
{
 
4320
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4321
                return;
 
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()));
 
4328
}
 
4329
 
 
4330
void PropertiesPalette::newUnderline()
 
4331
{
 
4332
        if ((HaveDoc) && (HaveItem))
 
4333
        {
 
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);
 
4341
        }
 
4342
}
 
4343
 
 
4344
void PropertiesPalette::setUnderline(double p, double w)
 
4345
{
 
4346
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4347
                return;
 
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()));
 
4354
}
 
4355
 
 
4356
void PropertiesPalette::newStrike()
 
4357
{
 
4358
        if ((HaveDoc) && (HaveItem))
 
4359
        {
 
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);
 
4367
        }
 
4368
}
 
4369
 
 
4370
void PropertiesPalette::setStrike(double p, double w)
 
4371
{
 
4372
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4373
                return;
 
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()));
 
4380
}
 
4381
 
 
4382
void PropertiesPalette::setOutlineW(double x)
 
4383
{
 
4384
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4385
                return;
 
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()));
 
4389
}
 
4390
 
 
4391
void PropertiesPalette::newOutlineW()
 
4392
{
 
4393
        int x = qRound(SeStyle->OutlineVal->LWidth->value() * 10.0);
 
4394
        if ((HaveDoc) && (HaveItem))
 
4395
        {
 
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);
 
4401
        }
 
4402
}
 
4403
 
 
4404
void PropertiesPalette::DoLower()
 
4405
{
 
4406
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4407
                return;
 
4408
        m_ScMW->view->LowerItem();
 
4409
}
 
4410
 
 
4411
void PropertiesPalette::DoRaise()
 
4412
{
 
4413
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4414
                return;
 
4415
        m_ScMW->view->RaiseItem();
 
4416
}
 
4417
 
 
4418
void PropertiesPalette::DoFront()
 
4419
{
 
4420
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4421
                return;
 
4422
        m_ScMW->view->ToFront();
 
4423
}
 
4424
 
 
4425
void PropertiesPalette::DoBack()
 
4426
{
 
4427
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4428
                return;
 
4429
        m_ScMW->view->ToBack();
 
4430
}
 
4431
 
 
4432
void PropertiesPalette::NewRotMode(int m)
 
4433
{
 
4434
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4435
                return;
 
4436
        double inX, inY, gx, gy, gh, gw;
 
4437
        inX = 0;
 
4438
        inY = 0;
 
4439
        if ((HaveDoc) && (HaveItem))
 
4440
        {
 
4441
                HaveItem = false;
 
4442
                doc->RotMode = m;
 
4443
                if (doc->m_Selection->isMultipleSelection())
 
4444
                {
 
4445
                        doc->m_Selection->setGroupRect();
 
4446
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
 
4447
                        if (m == 0)
 
4448
                        {
 
4449
                                m_ScMW->view->RCenter = FPoint(gx, gy);
 
4450
                                inX = gx;
 
4451
                                inY = gy;
 
4452
                        }
 
4453
                        if (m == 1)
 
4454
                        {
 
4455
                                m_ScMW->view->RCenter = FPoint(gx+gw, gy);
 
4456
                                inX = gx+gw;
 
4457
                                inY = gy;
 
4458
                        }
 
4459
                        if (m == 2)
 
4460
                        {
 
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;
 
4464
                        }
 
4465
                        if (m == 3)
 
4466
                        {
 
4467
                                m_ScMW->view->RCenter = FPoint(gx, gy+gh);
 
4468
                                inX = gx;
 
4469
                                inY = gy+gh;
 
4470
                        }
 
4471
                        if (m == 4)
 
4472
                        {
 
4473
                                m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
 
4474
                                inX = gx+gw;
 
4475
                                inY = gy+gh;
 
4476
                        }
 
4477
                        inX -= doc->rulerXoffset;
 
4478
                        inY -= doc->rulerYoffset;
 
4479
                        if (doc->guidesSettings.rulerMode)
 
4480
                        {
 
4481
                                inX -= doc->currentPage()->xOffset();
 
4482
                                inY -= doc->currentPage()->yOffset();
 
4483
                        }
 
4484
                        Xpos->setValue(inX*m_unitRatio);
 
4485
                        Ypos->setValue(inY*m_unitRatio);
 
4486
                }
 
4487
                else
 
4488
                {
 
4489
                        double b, h, r;
 
4490
                        QMatrix ma;
 
4491
                        FPoint n;
 
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());
 
4497
                        ma.rotate(r);
 
4498
                        int bp = RotationGroup->checkedId();
 
4499
                        if (bp == 0)
 
4500
                                n = FPoint(0.0, 0.0);
 
4501
                        else if (bp == 1)
 
4502
                                n = FPoint(b, 0.0);
 
4503
                        else if (bp == 2)
 
4504
                                n = FPoint(b / 2.0, h / 2.0);
 
4505
                        else if (bp == 3)
 
4506
                                n = FPoint(0.0, h);
 
4507
                        else if (bp == 4)
 
4508
                                n = FPoint(b, h);
 
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)
 
4514
                        {
 
4515
                                inX -= doc->currentPage()->xOffset();
 
4516
                                inY -= doc->currentPage()->yOffset();
 
4517
                        }
 
4518
                        Xpos->setValue(inX*m_unitRatio);
 
4519
                        Ypos->setValue(inY*m_unitRatio);
 
4520
                }
 
4521
                if (CurItem->itemType() == PageItem::ImageFrame)
 
4522
                {
 
4523
                        if (!FreeScale->isChecked())
 
4524
                        {
 
4525
                                CurItem->AdjustPictScale();
 
4526
                                CurItem->update();
 
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()));
 
4533
                                emit DocChanged();
 
4534
                        }
 
4535
                }
 
4536
                HaveItem = true;
 
4537
        }
 
4538
}
 
4539
 
 
4540
void PropertiesPalette::DoFlow()
 
4541
{
 
4542
        PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
 
4543
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4544
                return;
 
4545
        if ((HaveDoc) && (HaveItem))
 
4546
        {
 
4547
                if (CurItem->isGroupControl)
 
4548
                {
 
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;
 
4559
                }
 
4560
                else
 
4561
                {
 
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;
 
4572
                }
 
4573
                CurItem->setTextFlowMode(mode);
 
4574
                m_ScMW->view->DrawNew();
 
4575
                emit DocChanged();
 
4576
        }
 
4577
}
 
4578
 
 
4579
void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
 
4580
{
 
4581
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4582
                return;
 
4583
        if ((HaveDoc) && (HaveItem))
 
4584
        {
 
4585
                if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
 
4586
                        return;
 
4587
 
 
4588
                if (UndoManager::undoEnabled())
 
4589
                {
 
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;
 
4601
                        int ix = 0;
 
4602
                        for (int i = 0; i < c/2; ++i)
 
4603
                        {
 
4604
                                double x = CurItem->width() * vals[ix] / 100.0;
 
4605
                                double y = CurItem->height() * vals[ix+1] / 100.0;
 
4606
                                newShape.addPoint(x, y);
 
4607
                                ix += 2;
 
4608
                        }
 
4609
                        // HACK: end of hack
 
4610
                        is->setItem(qMakePair(CurItem->shape(), newShape));
 
4611
                        UndoManager::instance()->action(CurItem, is);
 
4612
                }
 
4613
 
 
4614
                switch (f)
 
4615
                {
 
4616
                case 0:
 
4617
                        CurItem->SetRectFrame();
 
4618
                        doc->setRedrawBounding(CurItem);
 
4619
                        break;
 
4620
                case 1:
 
4621
                        CurItem->SetOvalFrame();
 
4622
                        doc->setRedrawBounding(CurItem);
 
4623
                        break;
 
4624
                default:
 
4625
                        CurItem->SetFrameShape(c, (double*)vals);
 
4626
                        doc->setRedrawBounding(CurItem);
 
4627
                        CurItem->FrameType = f+2;
 
4628
                        break;
 
4629
                }
 
4630
//qt4           m_ScMW->SCustom->setPixmap(m_ScMW->SCustom->getIconPixmap(f));
 
4631
                CurItem->update();
 
4632
                emit DocChanged();
 
4633
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
 
4634
                {
 
4635
                        RoundRect->setEnabled(f == 0);
 
4636
                        return;
 
4637
                }
 
4638
                CurItem->convertTo(PageItem::Polygon);
 
4639
                NewSel(6);
 
4640
                RoundRect->setEnabled(f == 0);
 
4641
//              TabStack->setCurrentIndex(1);
 
4642
        }
 
4643
}
 
4644
 
 
4645
void PropertiesPalette::handleShapeEdit()
 
4646
{
 
4647
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4648
                return;
 
4649
        if ((HaveDoc) && (HaveItem))
 
4650
        {
 
4651
                tmpSelection->clear();
 
4652
                m_ScMW->view->requestMode(modeEditClip);
 
4653
                RoundRect->setEnabled(false);
 
4654
        }
 
4655
}
 
4656
 
 
4657
void PropertiesPalette::NewTDist()
 
4658
{
 
4659
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4660
                return;
 
4661
        if ((HaveDoc) && (HaveItem))
 
4662
        {
 
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);
 
4665
                CurItem->update();
 
4666
                emit DocChanged();
 
4667
        }
 
4668
}
 
4669
 
 
4670
void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2)
 
4671
{
 
4672
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4673
                return;
 
4674
        if ((HaveDoc) && (HaveItem))
 
4675
        {
 
4676
                CurItem->GrStartX = x1 / m_unitRatio;
 
4677
                CurItem->GrStartY = y1 / m_unitRatio;
 
4678
                CurItem->GrEndX = x2 / m_unitRatio;
 
4679
                CurItem->GrEndY = y2 / m_unitRatio;
 
4680
                CurItem->update();
 
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));
 
4684
                emit DocChanged();
 
4685
        }
 
4686
}
 
4687
 
 
4688
void PropertiesPalette::toggleGradientEdit()
 
4689
{
 
4690
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4691
                return;
 
4692
        if ((HaveDoc) && (HaveItem))
 
4693
        {
 
4694
                if (Cpal->gradEditButton->isChecked())
 
4695
                        m_ScMW->view->requestMode(modeEditGradientVectors);
 
4696
                else
 
4697
                        m_ScMW->view->requestMode(modeNormal);
 
4698
                m_ScMW->view->RefreshGradient(CurItem);
 
4699
        }
 
4700
}
 
4701
 
 
4702
void PropertiesPalette::NewTFont(QString c)
 
4703
{
 
4704
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4705
                return;
 
4706
        emit NewFont(c);
 
4707
}
 
4708
 
 
4709
void PropertiesPalette::DoRevert()
 
4710
{
 
4711
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4712
                return;
 
4713
        doc->itemSelection_SetItemTextReversed(Revert->isChecked());
 
4714
}
 
4715
 
 
4716
 
 
4717
void PropertiesPalette::doClearCStyle()
 
4718
{
 
4719
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4720
                return;
 
4721
        if (HaveDoc)
 
4722
        {
 
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);
 
4728
        }
 
4729
}
 
4730
 
 
4731
 
 
4732
void PropertiesPalette::doClearPStyle()
 
4733
{
 
4734
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4735
                return;
 
4736
        if (HaveDoc)
 
4737
        {
 
4738
                if (CurItem->asTextFrame())
 
4739
                {
 
4740
//                      CurItem->asTextFrame()->ExpandParSel();
 
4741
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
 
4742
//                      CurItem->asTextFrame()->lastAction4Paragraph = true;
 
4743
                }
 
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);
 
4749
        }
 
4750
}
 
4751
 
 
4752
 
 
4753
void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
 
4754
{
 
4755
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4756
                return;
 
4757
        disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
 
4758
        StyledLine->clear();
 
4759
        if (dd != 0)
 
4760
        {
 
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);
 
4768
        }
 
4769
        connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
 
4770
}
 
4771
 
 
4772
void PropertiesPalette::SetSTline(QListWidgetItem *c)
 
4773
{
 
4774
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4775
                return;
 
4776
        if (c == NULL)
 
4777
                return;
 
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);
 
4784
}
 
4785
 
 
4786
void PropertiesPalette::updateColorList()
 
4787
{
 
4788
        if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
 
4789
                return;
 
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);
 
4797
}
 
4798
 
 
4799
void PropertiesPalette::updateCmsList()
 
4800
{
 
4801
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4802
                return;
 
4803
        if (HaveDoc)
 
4804
        {
 
4805
                if (ScCore->haveCMS() && doc->CMSSettings.CMSinUse)
 
4806
                        GroupBoxCM->show();
 
4807
                else
 
4808
                {
 
4809
                        GroupBoxCM->hide();
 
4810
                        return;
 
4811
                }
 
4812
                disconnect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
 
4813
                disconnect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
 
4814
                InputP->clear();
 
4815
                if (HaveItem)
 
4816
                {
 
4817
                        if (CurItem->pixm.imgInfo.colorspace == ColorSpaceCMYK)
 
4818
                        {
 
4819
                                ProfilesL::Iterator itP;
 
4820
                                ProfilesL::Iterator itPend=ScCore->InputProfilesCMYK.end();
 
4821
                                for (itP = ScCore->InputProfilesCMYK.begin(); itP != itPend; ++itP)
 
4822
                                {
 
4823
                                        InputP->addItem(itP.key());
 
4824
                                        if (itP.key() == CurItem->IProfile)
 
4825
                                                InputP->setCurrentIndex(InputP->count()-1);
 
4826
                                }
 
4827
                                if (!ScCore->InputProfilesCMYK.contains(CurItem->IProfile))
 
4828
                                {
 
4829
                                        InputP->addItem(CurItem->IProfile);
 
4830
                                        InputP->setCurrentIndex(InputP->count()-1);
 
4831
                                }
 
4832
                                else
 
4833
                                {
 
4834
                                        if (!CurItem->EmProfile.isEmpty())
 
4835
                                                InputP->addItem(CurItem->EmProfile);
 
4836
                                }
 
4837
                        }
 
4838
                        else
 
4839
                        {
 
4840
                                ProfilesL::Iterator itP;
 
4841
                                ProfilesL::Iterator itPend=ScCore->InputProfiles.end();
 
4842
                                for (itP = ScCore->InputProfiles.begin(); itP != itPend; ++itP)
 
4843
                                {
 
4844
                                        InputP->addItem(itP.key());
 
4845
                                        if (itP.key() == CurItem->IProfile)
 
4846
                                                InputP->setCurrentIndex(InputP->count()-1);
 
4847
                                }
 
4848
                                if (!ScCore->InputProfiles.contains(CurItem->IProfile))
 
4849
                                {
 
4850
                                        InputP->addItem(CurItem->IProfile);
 
4851
                                        InputP->setCurrentIndex(InputP->count()-1);
 
4852
                                }
 
4853
                                else
 
4854
                                {
 
4855
                                        if (!CurItem->EmProfile.isEmpty())
 
4856
                                                InputP->addItem(CurItem->EmProfile);
 
4857
                                }
 
4858
                        }
 
4859
                        MonitorI->setCurrentIndex(CurItem->IRender);
 
4860
                }
 
4861
                connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
 
4862
                connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
 
4863
        }
 
4864
}
 
4865
 
 
4866
void PropertiesPalette::ChangeProfile(const QString& prn)
 
4867
{
 
4868
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4869
                return;
 
4870
        doc->itemSelection_SetColorProfile(InputP->currentText());
 
4871
}
 
4872
 
 
4873
void PropertiesPalette::ChangeIntent()
 
4874
{
 
4875
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4876
                return;
 
4877
        doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
 
4878
}
 
4879
 
 
4880
void PropertiesPalette::ShowCMS()
 
4881
{
 
4882
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
4883
                return;
 
4884
        if (HaveItem)
 
4885
                updateCmsList();
 
4886
        else
 
4887
                GroupBoxCM->setVisible(ScCore->haveCMS() && doc->CMSSettings.CMSinUse);
 
4888
}
 
4889
 
 
4890
void PropertiesPalette::newTxtFill()
 
4891
{
 
4892
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4893
                return;
 
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);
 
4899
}
 
4900
 
 
4901
void PropertiesPalette::newTxtStroke()
 
4902
{
 
4903
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4904
                return;
 
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);
 
4910
 
 
4911
}
 
4912
 
 
4913
void PropertiesPalette::setActShade()
 
4914
{
 
4915
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4916
                return;
 
4917
        int b;
 
4918
        if (CurItem->asTextFrame())
 
4919
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
 
4920
        if (PM1 == sender())
 
4921
        {
 
4922
                b = PM1->getValue();
 
4923
                doc->itemSelection_SetStrokeShade(b);
 
4924
        }
 
4925
        else
 
4926
        {
 
4927
                b = PM2->getValue();
 
4928
                doc->itemSelection_SetFillShade(b);
 
4929
        }
 
4930
        if (CurItem->asTextFrame())
 
4931
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
 
4932
}
 
4933
 
 
4934
void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
 
4935
{
 
4936
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4937
                return;
 
4938
        ColorList::Iterator it;
 
4939
        int c = 0;
 
4940
        PM2->setValue(qRound(shb));
 
4941
        PM1->setValue(qRound(shp));
 
4942
        if ((b != CommonStrings::None) && (!b.isEmpty()))
 
4943
        {
 
4944
                c++;
 
4945
                for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
 
4946
                {
 
4947
                        if (it.key() == b)
 
4948
                                break;
 
4949
                        c++;
 
4950
                }
 
4951
        }
 
4952
        TxFill->setCurrentIndex(c);
 
4953
        c = 0;
 
4954
        if ((p != CommonStrings::None) && (!p.isEmpty()))
 
4955
        {
 
4956
//              c++;
 
4957
                for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
 
4958
                {
 
4959
                        if (it.key() == p)
 
4960
                                break;
 
4961
                        c++;
 
4962
                }
 
4963
        }
 
4964
        TxStroke->setCurrentIndex(c);
 
4965
}
 
4966
 
 
4967
void PropertiesPalette::handleLock()
 
4968
{
 
4969
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4970
                return;
 
4971
        m_ScMW->scrActions["itemLock"]->toggle();
 
4972
}
 
4973
 
 
4974
void PropertiesPalette::handleLockSize()
 
4975
{
 
4976
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4977
                return;
 
4978
        m_ScMW->scrActions["itemLockSize"]->toggle();
 
4979
}
 
4980
 
 
4981
void PropertiesPalette::handlePrint()
 
4982
{
 
4983
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4984
                return;
 
4985
        m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
 
4986
}
 
4987
 
 
4988
void PropertiesPalette::handleFlipH()
 
4989
{
 
4990
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
4991
                return;
 
4992
        m_ScMW->scrActions["itemFlipH"]->toggle();
 
4993
        /*
 
4994
        if ((HaveDoc) && (HaveItem))
 
4995
        {
 
4996
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
 
4997
                        doc->FlipImageH();
 
4998
                else
 
4999
                        doc->MirrorPolyH();
 
5000
                emit DocChanged();
 
5001
        }
 
5002
        */
 
5003
}
 
5004
 
 
5005
void PropertiesPalette::handleFlipV()
 
5006
{
 
5007
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
5008
                return;
 
5009
        m_ScMW->scrActions["itemFlipV"]->toggle();
 
5010
        /*
 
5011
        if ((HaveDoc) && (HaveItem))
 
5012
        {
 
5013
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
 
5014
                        doc->FlipImageV();
 
5015
                else
 
5016
                        doc->MirrorPolyV();
 
5017
                emit DocChanged();
 
5018
        }
 
5019
        */
 
5020
}
 
5021
 
 
5022
 
 
5023
void PropertiesPalette::handlePathType()
 
5024
{
 
5025
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5026
                return;
 
5027
        CurItem->textPathType = pathTextType->currentIndex();
 
5028
        CurItem->update();
 
5029
        emit DocChanged();
 
5030
}
 
5031
 
 
5032
void PropertiesPalette::handlePathFlip()
 
5033
{
 
5034
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5035
                return;
 
5036
        CurItem->textPathFlipped = flippedPathText->isChecked();
 
5037
        CurItem->updatePolyClip();
 
5038
        CurItem->update();
 
5039
        emit DocChanged();
 
5040
}
 
5041
 
 
5042
void PropertiesPalette::handlePathLine()
 
5043
{
 
5044
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5045
                return;
 
5046
        CurItem->PoShow = showcurveCheckBox->isChecked();
 
5047
        CurItem->update();
 
5048
        emit DocChanged();
 
5049
}
 
5050
 
 
5051
void PropertiesPalette::handlePathDist()
 
5052
{
 
5053
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5054
                return;
 
5055
        CurItem->setTextToFrameDistLeft(Dist->value());
 
5056
        doc->AdjustItemSize(CurItem);
 
5057
        CurItem->updatePolyClip();
 
5058
        CurItem->update();
 
5059
        emit DocChanged();
 
5060
}
 
5061
 
 
5062
void PropertiesPalette::handlePathOffs()
 
5063
{
 
5064
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5065
                return;
 
5066
        CurItem->BaseOffs = -LineW->value();
 
5067
        doc->AdjustItemSize(CurItem);
 
5068
        CurItem->updatePolyClip();
 
5069
        CurItem->update();
 
5070
        emit DocChanged();
 
5071
}
 
5072
 
 
5073
void PropertiesPalette::handleFillRule()
 
5074
{
 
5075
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5076
                return;
 
5077
        CurItem->fillRule = EvenOdd->isChecked();
 
5078
        CurItem->update();
 
5079
        qDebug() << "PropertiesPalette::handleFillRule() updateUNDO";
 
5080
        if (CurItem->asTextFrame())
 
5081
                CurItem->asTextFrame()->updateUndo();
 
5082
 
 
5083
        emit DocChanged();
 
5084
}
 
5085
 
 
5086
void PropertiesPalette::handleOverprint()
 
5087
{
 
5088
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 
5089
                return;
 
5090
        doc->itemSelection_SetOverprint(Overprint->isChecked());
 
5091
}
 
5092
 
 
5093
void PropertiesPalette::NewName()
 
5094
{
 
5095
        if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
 
5096
                return;
 
5097
        QString NameOld = CurItem->itemName();
 
5098
        QString NameNew = NameEdit->text();
 
5099
        if (NameNew.isEmpty())
 
5100
        {
 
5101
                NameEdit->setText(NameOld);
 
5102
                return;
 
5103
        }
 
5104
        bool found = false;
 
5105
        for (int b = 0; b < doc->Items->count(); ++b)
 
5106
        {
 
5107
                if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
 
5108
                {
 
5109
                        found = true;
 
5110
                        break;
 
5111
                }
 
5112
        }
 
5113
        if (found)
 
5114
        {
 
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();
 
5118
        }
 
5119
        else
 
5120
        {
 
5121
                if (CurItem->itemName() != NameEdit->text())
 
5122
                {
 
5123
                        CurItem->setItemName(NameEdit->text());
 
5124
                        emit DocChanged();
 
5125
                }
 
5126
        }
 
5127
}
 
5128
 
 
5129
void PropertiesPalette::fillLangCombo(QMap<QString,QString> langMap)
 
5130
{
 
5131
        QStringList sortList;
 
5132
        QMap<QString,QString>::Iterator it;
 
5133
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
5134
                return;
 
5135
        langCombo->clear();
 
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);
 
5141
        if (tmpWidth > 0)
 
5142
                tmpView->setMinimumWidth(tmpWidth + 24);
 
5143
}
 
5144
 
 
5145
void PropertiesPalette::NewLanguage()
 
5146
{
 
5147
        if ((HaveDoc) && (HaveItem))
 
5148
        {
 
5149
                CurItem->doc()->Language = (m_ScMW->GetLang(langCombo->currentText()));
 
5150
                emit DocChanged();
 
5151
        }
 
5152
}
 
5153
 
 
5154
void PropertiesPalette::ManageTabs()
 
5155
{
 
5156
        if ((HaveDoc) && (HaveItem))
 
5157
        {
 
5158
                PageItem_TextFrame *i2=CurItem->asTextFrame();
 
5159
                if (i2==0)
 
5160
                        return;
 
5161
                const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
 
5162
                TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
 
5163
                if (dia->exec())
 
5164
                {
 
5165
                        if (CurItem->asTextFrame())
 
5166
                        {
 
5167
                                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
 
5168
//                              CurItem->asTextFrame()->lastAction4Paragraph = true;
 
5169
                        }
 
5170
                        if (doc->appMode != modeEdit)
 
5171
                        {
 
5172
                                ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
 
5173
                                newStyle.setTabValues(dia->tmpTab);
 
5174
                                CurItem->itemText.setDefaultStyle(newStyle);
 
5175
                        }
 
5176
                        else
 
5177
                        {
 
5178
                                ParagraphStyle newStyle;
 
5179
                                newStyle.setTabValues(dia->tmpTab);
 
5180
                                doc->itemSelection_ApplyParagraphStyle(newStyle);
 
5181
                        }
 
5182
                        CurItem->update();
 
5183
                        if (CurItem->asTextFrame())
 
5184
                                CurItem->asTextFrame()->updateUndo();
 
5185
 
 
5186
                        emit DocChanged();
 
5187
                }
 
5188
                delete dia;
 
5189
        }
 
5190
}
 
5191
 
 
5192
void PropertiesPalette::HandleTLines()
 
5193
{
 
5194
        if ((HaveDoc) && (HaveItem))
 
5195
        {
 
5196
                CurItem->TopLine = TopLine->isChecked();
 
5197
                CurItem->LeftLine = LeftLine->isChecked();
 
5198
                CurItem->RightLine = RightLine->isChecked();
 
5199
                CurItem->BottomLine = BottomLine->isChecked();
 
5200
                CurItem->update();
 
5201
                emit DocChanged();
 
5202
        }
 
5203
}
 
5204
 
 
5205
void PropertiesPalette::installSniffer(ScrSpinBox *spinBox)
 
5206
{
 
5207
        const QList<QObject*> list = spinBox->children();
 
5208
        if (!list.isEmpty())
 
5209
        {
 
5210
                QListIterator<QObject*> it(list);
 
5211
                QObject *obj;
 
5212
                while (it.hasNext())
 
5213
                {
 
5214
                        obj = it.next();
 
5215
                        obj->installEventFilter(userActionSniffer);
 
5216
                }
 
5217
        }
 
5218
}
 
5219
 
 
5220
bool PropertiesPalette::userActionOn()
 
5221
{
 
5222
        return _userActionOn;
 
5223
}
 
5224
 
 
5225
void PropertiesPalette::spinboxStartUserAction()
 
5226
{
 
5227
//      qDebug("%s", "sniffer: spinbox start action");
 
5228
        _userActionOn = true;
 
5229
}
 
5230
 
 
5231
void PropertiesPalette::spinboxFinishUserAction()
 
5232
{
 
5233
//      qDebug("%s", "sniffer: spinbox finish action");
 
5234
        _userActionOn = false;
 
5235
 
 
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())
 
5239
        {
 
5240
                m_ScMW->view->endGroupTransaction();
 
5241
        }
 
5242
}
 
5243
 
 
5244
void PropertiesPalette::changeEvent(QEvent *e)
 
5245
{
 
5246
        if (e->type() == QEvent::LanguageChange)
 
5247
        {
 
5248
                languageChange();
 
5249
        }
 
5250
        else
 
5251
                QWidget::changeEvent(e);
 
5252
}
 
5253
 
 
5254
void PropertiesPalette::languageChange()
 
5255
{
 
5256
        setWindowTitle( tr("Properties"));
 
5257
 
 
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"));
 
5265
 
 
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();
 
5285
        blendMode->clear();
 
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 );
 
5347
////    Out for 1.3.4
 
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();
 
5404
        MonitorI->clear();
 
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();
 
5411
        LStyle->clear();
 
5412
        LStyle->updateList();
 
5413
        LStyle->addItem( tr("Custom"));
 
5414
        LStyle->setCurrentIndex(oldLineStyle);
 
5415
        int oldLineMode=LineMode->currentIndex();
 
5416
        LineMode->clear();
 
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:"));
 
5424
        if (HaveDoc)
 
5425
        {
 
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);
 
5432
        }
 
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);
 
5441
 
 
5442
        int oldLEndStyle=LEndStyle->currentIndex();
 
5443
        LEndStyle->clear();
 
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:"));
 
5449
 
 
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"));
 
5455
        
 
5456
        OverP->setTitle( tr("Overprinting"));
 
5457
        KnockOut->setText( tr("Knockout"));
 
5458
        Overprint->setText( tr("Overprint"));
 
5459
 
 
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);
 
5473
        
 
5474
        QString ptSuffix = tr(" pt");
 
5475
        Dist->setSuffix(ptSuffix);
 
5476
        LineW->setSuffix(ptSuffix);
 
5477
        Size->setSuffix(ptSuffix);
 
5478
        LineSp->setSuffix(ptSuffix);
 
5479
 
 
5480
        QString ein = (HaveDoc) ? unitGetSuffixFromIndex(doc->unitIndex()) : ptSuffix;
 
5481
 
 
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);
 
5496
 
 
5497
        SeStyle->languageChange();
 
5498
        GroupAlign->languageChange();
 
5499
 
 
5500
        if(StyledLine->count() > 0)
 
5501
                StyledLine->item(0)->setText( tr("No Style") );
 
5502
//      updateCList();
 
5503
//      updateCmsList();
 
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("");
 
5539
 
 
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("");
 
5558
 
 
5559
        minWordTrackingSpinBox->setToolTip("");
 
5560
        normWordTrackingSpinBox->setToolTip("");
 
5561
        minGlyphExtSpinBox->setToolTip("");
 
5562
        maxGlyphExtSpinBox->setToolTip("");
 
5563
        optMarginCombo->setToolTip("");
 
5564
 
 
5565
        LineMode->setToolTip("");
 
5566
        LStyle->setToolTip("");
 
5567
        LSize->setToolTip("");
 
5568
        LJoinStyle->setToolTip("");
 
5569
        LEndStyle->setToolTip("");
 
5570
        StyledLine->setToolTip("");
 
5571
 
 
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("");
 
5583
 
 
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("");
 
5595
*/
 
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 &quot;insideness&quot; 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 &quot;insideness&quot; 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>" );
 
5633
 
 
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"));
 
5653
 
 
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>" );
 
5657
 
 
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"));
 
5663
 
 
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"));
 
5672
 
 
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..."));
 
5684
 
 
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"));
 
5698
}
 
5699
 
 
5700
 
 
5701
const VGradient PropertiesPalette::getFillGradient()
 
5702
{
 
5703
        return Cpal->gradEdit->Preview->fill_gradient;
 
5704
}
 
5705
 
 
5706
void PropertiesPalette::setGradientEditMode(bool on)
 
5707
{
 
5708
        Cpal->gradEditButton->setChecked(on);
 
5709
}
 
5710
 
 
5711
void PropertiesPalette::updateColorSpecialGradient()
 
5712
{
 
5713
        if (!HaveDoc)
 
5714
                return;
 
5715
        if(doc->m_Selection->isEmpty())
 
5716
                return;
 
5717
        double dur=doc->unitRatio();
 
5718
        PageItem *currItem=doc->m_Selection->itemAt(0);
 
5719
        if (currItem)
 
5720
                Cpal->setSpecialGradient(currItem->GrStartX * dur, currItem->GrStartY * dur, currItem->GrEndX * dur, currItem->GrEndY * dur);
 
5721
}
 
5722
 
 
5723
void PropertiesPalette::updateSpinBoxConstants()
 
5724
{
 
5725
        if (!HaveDoc)
 
5726
                return;
 
5727
        if(doc->m_Selection->count()==0)
 
5728
                return;
 
5729
        Width->setConstants(&doc->constants());
 
5730
        Height->setConstants(&doc->constants());
 
5731
        Xpos->setConstants(&doc->constants());
 
5732
        Ypos->setConstants(&doc->constants());
 
5733
 
 
5734
}
 
5735
 
 
5736
UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
 
5737
{
 
5738
 
 
5739
}
 
5740
 
 
5741
bool UserActionSniffer::eventFilter(QObject*, QEvent *e)
 
5742
{
 
5743
        if (e->type() == QEvent::MouseButtonPress)
 
5744
                emit actionStart();
 
5745
        else if (e->type() == QEvent::MouseButtonRelease)
 
5746
                emit actionEnd();
 
5747
        else if (e->type() == QEvent::KeyPress)
 
5748
        {
 
5749
                QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
 
5750
                if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
 
5751
                        emit actionStart();
 
5752
        }
 
5753
        else if (e->type() == QEvent::KeyRelease)
 
5754
        {
 
5755
                QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
 
5756
                if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
 
5757
                        emit actionEnd();
 
5758
        }
 
5759
        return false;
 
5760
}
 
5761
 
 
5762
void PropertiesPalette::setLocked(bool isLocked)
 
5763
{
 
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());
 
5770
        if (isLocked)
 
5771
                pal.setCurrentColorGroup(QPalette::Disabled);
 
5772
 
 
5773
        Xpos->setPalette(pal);
 
5774
        Ypos->setPalette(pal);
 
5775
        Width->setPalette(pal);
 
5776
        Height->setPalette(pal);
 
5777
        Rotation->setPalette(pal);
 
5778
 
 
5779
        bool shapeEditLocked = isLocked;
 
5780
        if (HaveItem)
 
5781
                shapeEditLocked |=  CurItem->sizeLocked();
 
5782
        EditShape->setEnabled(!shapeEditLocked);
 
5783
 
 
5784
        LayerGroup->setEnabled(!isLocked);
 
5785
        Locked->setChecked(isLocked);
 
5786
        if ((HaveDoc) && (HaveItem))
 
5787
        {
 
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);
 
5791
                else
 
5792
                        RoundRect->setEnabled(false);
 
5793
        }
 
5794
}
 
5795
 
 
5796
void PropertiesPalette::setSizeLocked(bool isSizeLocked)
 
5797
{
 
5798
        bool b = isSizeLocked;
 
5799
        if (HaveItem && CurItem->locked())
 
5800
                b = true;
 
5801
        Width->setReadOnly(b);
 
5802
        Height->setReadOnly(b);
 
5803
        QPalette pal(qApp->palette());
 
5804
        
 
5805
        if (b)
 
5806
                pal.setCurrentColorGroup(QPalette::Disabled);
 
5807
 
 
5808
        Width->setPalette(pal);
 
5809
        Height->setPalette(pal);
 
5810
        NoResize->setChecked(isSizeLocked);
 
5811
 
 
5812
        bool shapeEditLocked = isSizeLocked;
 
5813
        if (HaveItem)
 
5814
                shapeEditLocked |=  CurItem->locked();
 
5815
        EditShape->setEnabled(!shapeEditLocked);
 
5816
}
 
5817
 
 
5818
void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
 
5819
{
 
5820
        NoPrint->setChecked(!isPrintingEnabled);
 
5821
}
 
5822
 
 
5823
void PropertiesPalette::setFlippedH(bool isFlippedH)
 
5824
{
 
5825
        FlipH->setChecked(isFlippedH);
 
5826
}
 
5827
 
 
5828
void PropertiesPalette::setFlippedV(bool isFlippedV)
 
5829
{
 
5830
        FlipV->setChecked(isFlippedV);
 
5831
}
 
5832
 
 
5833
void PropertiesPalette::setGroupTransparency(int trans)
 
5834
{
 
5835
        if ((HaveDoc) && (HaveItem))
 
5836
        {
 
5837
                CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
 
5838
                CurItem->update();
 
5839
                emit DocChanged();
 
5840
        }
 
5841
}
 
5842
 
 
5843
void PropertiesPalette::setGroupBlending(int blend)
 
5844
{
 
5845
                CurItem->setFillBlendmode(blend);
 
5846
                CurItem->update();
 
5847
                emit DocChanged();
 
5848
}
 
5849
 
 
5850
void PropertiesPalette::doGrouping()
 
5851
{
 
5852
        m_ScMW->GroupObj();
 
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();
 
5859
        if (bp == 0)
 
5860
                m_ScMW->view->RCenter = FPoint(gx, gy);
 
5861
        else if (bp == 1)
 
5862
                m_ScMW->view->RCenter = FPoint(gx + gw, gy);
 
5863
        else if (bp == 2)
 
5864
                m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
 
5865
        else if (bp == 3)
 
5866
                m_ScMW->view->RCenter = FPoint(gx, gy + gh);
 
5867
        else if (bp == 4)
 
5868
                m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
 
5869
        TabStack->setItemEnabled(idShapeItem, false);
 
5870
}
 
5871
 
 
5872
void PropertiesPalette::handleShapeEdit2()
 
5873
{
 
5874
        if (!m_ScMW || m_ScMW->scriptIsRunning())
 
5875
                return;
 
5876
        if ((HaveDoc) && (HaveItem))
 
5877
        {
 
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;
 
5883
                CurItem->update();
 
5884
                m_ScMW->view->requestMode(modeEditClip);
 
5885
                RoundRect->setEnabled(false);
 
5886
        }
 
5887
}
 
5888
 
 
5889
void PropertiesPalette::endEdit2()
 
5890
{
 
5891
        if ((HaveDoc) && (HaveItem))
 
5892
        {
 
5893
                if (tmpSelection->count() > 0)
 
5894
                {
 
5895
                        doc->m_Selection->copy(*tmpSelection, false);
 
5896
                        doc->m_Selection->connectItemToGUI();
 
5897
                }
 
5898
                tmpSelection->clear();
 
5899
        }
 
5900
}
 
5901
 
 
5902
void PropertiesPalette::flop(int radioFlop)
 
5903
{
 
5904
        if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
 
5905
                return;
 
5906
//      qDebug("%s", QString("rF %1").arg(radioFlop).toAscii());
 
5907
        if( radioFlop == 0)
 
5908
                CurItem->setFirstLineOffset(FLOPRealGlyphHeight);
 
5909
        else if( radioFlop == 1)
 
5910
                CurItem->setFirstLineOffset(FLOPFontAscent);
 
5911
        else if( radioFlop == 2)
 
5912
                CurItem->setFirstLineOffset(FLOPLineSpacing);
 
5913
        CurItem->update();
 
5914
        emit DocChanged();
 
5915
}
 
5916
 
 
5917
 
 
5918