~ubuntu-branches/ubuntu/wily/scribus/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/0001-qreal-double-fixes.patch/scribus/propertiespalette.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

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)
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<double> 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
 
                DLeft->setValue(i2->textToFrameDistLeft()*m_unitRatio);
2101
 
                DTop->setValue(i2->textToFrameDistTop()*m_unitRatio);
2102
 
                DBottom->setValue(i2->textToFrameDistBottom()*m_unitRatio);
2103
 
                DRight->setValue(i2->textToFrameDistRight()*m_unitRatio);
2104
 
                // I put it here because it’s visually grouped with these elements
2105
 
                // but it’s a PageItem prop. and as such should be set without considering
2106
 
                // the frame type.
2107
 
                setFlop(CurItem->firstLineOffset());
2108
 
                
2109
 
                // Style
2110
 
                updateStyle(i2->currentStyle());
2111
 
                
2112
 
                connect(dGap, SIGNAL(valueChanged(double)), this, SLOT(NewGap()));
2113
 
                connect(DCol, SIGNAL(valueChanged(int)), this, SLOT(NewCols()));
2114
 
        }
2115
 
        if (CurItem->asImageFrame())
2116
 
        {
2117
 
                disconnect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2118
 
                imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
2119
 
                imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
2120
 
                connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
2121
 
        }
2122
 
        Revert->setChecked(CurItem->reversed());
2123
 
        setTextFlowMode(CurItem->textFlowMode());
2124
 
        /*
2125
 
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2126
 
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2127
 
        FlipH->setChecked(i->imageFlippedH());
2128
 
        FlipV->setChecked(i->imageFlippedV());
2129
 
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2130
 
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2131
 
        */
2132
 
//      langCombo->setCurrentText(m_ScMW->LangTransl[i->doc()->Language]);
2133
 
        if (StyledLine->currentItem())
2134
 
                StyledLine->currentItem()->setSelected(false);
2135
 
        bool setter;
2136
 
        if (CurItem->NamedLStyle.isEmpty())
2137
 
        {
2138
 
                setter = true;
2139
 
                QListWidgetItem *itemStl = NULL;
2140
 
                itemStl = StyledLine->item(0);
2141
 
                if (itemStl != NULL)
2142
 
                        itemStl->setSelected(true);
2143
 
        }
2144
 
        else
2145
 
        {
2146
 
                QList<QListWidgetItem*> results (StyledLine->findItems(CurItem->NamedLStyle, Qt::MatchFixedString|Qt::MatchCaseSensitive));
2147
 
                if (results.count() > 0)
2148
 
                        results[0]->setSelected(true); //Qt3-QListBox::ExactMatch));
2149
 
                setter = false;
2150
 
        }
2151
 
        LStyle->setEnabled(setter);
2152
 
        LSize->setEnabled(setter);
2153
 
        LJoinStyle->setEnabled(setter);
2154
 
        LEndStyle->setEnabled(setter);
2155
 
        if (CurItem->dashes().count() == 0)
2156
 
                dashEditor->hide();
2157
 
        else
2158
 
        {
2159
 
                LStyle->setCurrentIndex(37);
2160
 
                dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
2161
 
                dashEditor->show();
2162
 
        }
2163
 
        connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
2164
 
        connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
2165
 
        connect(startArrow, SIGNAL(activated(int)), this, SLOT(setStartArrow(int )));
2166
 
        connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
2167
 
 
2168
 
//CB replaces old emits from PageItem::emitAllToGUI()
2169
 
        disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2170
 
        disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2171
 
        disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2172
 
        disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2173
 
        disconnect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2174
 
        disconnect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2175
 
        disconnect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2176
 
        disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2177
 
        disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2178
 
        disconnect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2179
 
        disconnect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2180
 
        disconnect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2181
 
        disconnect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2182
 
        disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2183
 
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2184
 
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2185
 
        disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2186
 
        disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2187
 
        disconnect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2188
 
        disconnect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2189
 
        disconnect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2190
 
        disconnect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2191
 
        setXY(i->xPos(), i->yPos());
2192
 
        setBH(i->width(), i->height());
2193
 
        NoPrint->setChecked(!i->printEnabled());
2194
 
        setFlippedH(i->imageFlippedH());
2195
 
        setFlippedV(i->imageFlippedV());
2196
 
        RoVal = i->rotation();
2197
 
        double rr = i->rotation();
2198
 
        if (i->rotation() > 0)
2199
 
                rr = 360 - rr;
2200
 
        Rotation->setValue(fabs(rr));
2201
 
//      setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2202
 
        setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
2203
 
        double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
2204
 
        i->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2205
 
        Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
2206
 
 
2207
 
//CB TODO reconnect PP signals from here
2208
 
        connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2209
 
        connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2210
 
        connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
2211
 
        connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
2212
 
        connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
2213
 
        connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
2214
 
        connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
2215
 
        connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2216
 
        connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2217
 
        connect(LSize, SIGNAL(valueChanged(double)), this, SLOT(NewLineWidth()));
2218
 
        connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
2219
 
        connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
2220
 
        connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
2221
 
        connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
2222
 
        connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2223
 
        connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2224
 
        connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2225
 
        connect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
2226
 
 
2227
 
        if ((CurItem->isTableItem) && (CurItem->isSingleSel))
2228
 
        {
2229
 
                setter = true;
2230
 
                TabStack3->setCurrentIndex(1);
2231
 
                TopLine->setChecked(CurItem->TopLine);
2232
 
                LeftLine->setChecked(CurItem->LeftLine);
2233
 
                RightLine->setChecked(CurItem->RightLine);
2234
 
                BottomLine->setChecked(CurItem->BottomLine);
2235
 
                Rotation->setEnabled(false);
2236
 
        }
2237
 
        else
2238
 
        {
2239
 
                setter = false;
2240
 
                TabStack3->setCurrentIndex(0);
2241
 
        }
2242
 
        Xpos->setEnabled(!setter);
2243
 
        Ypos->setEnabled(!setter);
2244
 
        LayerGroup->setEnabled(!setter);
2245
 
        disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2246
 
        disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2247
 
        if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2248
 
        {
2249
 
                TabStack->setItemEnabled(idXYZItem, true);
2250
 
                TabStack->setItemEnabled(idShapeItem, false);
2251
 
                TabStack->setItemEnabled(idGroupItem, true);
2252
 
                TabStack->setItemEnabled(idLineItem, true);
2253
 
                TabStack->setItemEnabled(idColorsItem, true);
2254
 
//              TabStack->setItemEnabled(idLineItem, false);
2255
 
//              TabStack->setItemEnabled(idColorsItem, false);
2256
 
                TabStack->setItemEnabled(idTextItem, false);
2257
 
                TabStack->setItemEnabled(idImageItem, false);
2258
 
                if (CurItem->FrameType == 0)
2259
 
                        SCustom2->setIcon(SCustom2->getIconPixmap(0));
2260
 
                if (CurItem->FrameType == 1)
2261
 
                        SCustom2->setIcon(SCustom2->getIconPixmap(1));
2262
 
                if (CurItem->FrameType > 3)
2263
 
                        SCustom2->setIcon(SCustom2->getIconPixmap(CurItem->FrameType-2));
2264
 
                TransSpin->setValue(qRound(100 - (CurItem->fillTransparency() * 100)));
2265
 
                blendMode->setCurrentIndex(CurItem->fillBlendmode());
2266
 
        }
2267
 
        else
2268
 
                TabStack->setItemEnabled(idGroupItem, false);
2269
 
        connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(setGroupTransparency(int)));
2270
 
        connect(blendMode, SIGNAL(activated(int)), this, SLOT(setGroupBlending(int)));
2271
 
        /*
2272
 
        Xpos->setReadOnly(setter);
2273
 
        Ypos->setReadOnly(setter);
2274
 
        Rotation->setReadOnly(setter);
2275
 
        */
2276
 
        if (CurItem->asPathText())
2277
 
        {
2278
 
                TabStack2->setCurrentIndex(0);
2279
 
                pathTextType->setCurrentIndex(CurItem->textPathType);
2280
 
                flippedPathText->setChecked(CurItem->textPathFlipped);
2281
 
                showcurveCheckBox->setChecked(CurItem->PoShow);
2282
 
                LineW->setValue(CurItem->BaseOffs * -1);
2283
 
                Dist->setValue(CurItem->textToFrameDistLeft());
2284
 
                flopItem->setHidden(true);
2285
 
                DistanceItem->setHidden(true);
2286
 
                Distance2Item->setHidden(false);
2287
 
        }
2288
 
        else if (CurItem->asTextFrame())
2289
 
        {
2290
 
                TabStack2->setCurrentIndex(0);
2291
 
                flopItem->setHidden(false);
2292
 
                DistanceItem->setHidden(false);
2293
 
                Distance2Item->setHidden(true);
2294
 
        }
2295
 
        else
2296
 
        {
2297
 
                TabStack2->setCurrentIndex(1);
2298
 
                Distance3->setVisible(i->itemType() != PageItem::ImageFrame);
2299
 
                flopItem->setHidden(false);
2300
 
                DistanceItem->setHidden(false);
2301
 
                Distance2Item->setHidden(true);
2302
 
        }
2303
 
        NonZero->setChecked(!CurItem->fillRule);
2304
 
        EvenOdd->setChecked(CurItem->fillRule);
2305
 
        // Frame type 3 is obsolete: CR 2005-02-06
2306
 
        //if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
2307
 
        if (((CurItem->asTextFrame()) || (CurItem->asImageFrame())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
2308
 
                RoundRect->setEnabled(true);
2309
 
        else
2310
 
        {
2311
 
                RoundRect->setEnabled ((CurItem->asPolygon()) &&  (!CurItem->ClipEdited)  && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)));
2312
 
        }
2313
 
        KnockOut->setChecked(!CurItem->doOverprint);
2314
 
        Overprint->setChecked(CurItem->doOverprint);
2315
 
        if ((CurItem->itemType() == PageItem::Line) && LMode)
2316
 
        {
2317
 
                xposLabel->setText( tr( "&X1:" ) );
2318
 
                widthLabel->setText( tr( "X&2:" ) );
2319
 
                yposLabel->setText( tr( "Y&1:" ) );
2320
 
                heightLabel->setText( tr( "&Y2:" ) );
2321
 
                Rotation->setEnabled(false);
2322
 
        }
2323
 
        else
2324
 
        {
2325
 
                xposLabel->setText( tr( "&X-Pos:" ) );
2326
 
                widthLabel->setText( tr( "&Width:" ) );
2327
 
                yposLabel->setText( tr( "&Y-Pos:" ) );
2328
 
                heightLabel->setText( tr( "&Height:" ) );
2329
 
                Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
2330
 
        }
2331
 
        HaveItem = true;
2332
 
        if (CurItem->asLine())
2333
 
        {
2334
 
                keepFrameWHRatioButton->setEnabled(false);
2335
 
                Height->setEnabled(LMode && !CurItem->locked());
2336
 
        }
2337
 
        else
2338
 
        {
2339
 
                Height->setEnabled(true);
2340
 
                keepFrameWHRatioButton->setEnabled(true);
2341
 
                if (CurItem->asImageFrame())
2342
 
                {
2343
 
                        updateCmsList();
2344
 
                        EditEffects->setShown(CurItem->PictureIsAvailable && CurItem->isRaster);
2345
 
                        EditPSDProps->setShown(CurItem->PictureIsAvailable && CurItem->pixm.imgInfo.valid);
2346
 
                        setter = CurItem->ScaleType;
2347
 
                        FreeScale->setChecked(setter);
2348
 
                        FrameScale->setChecked(!setter);
2349
 
                        if (CurItem->asLatexFrame())
2350
 
                        {
2351
 
                                FreeScale->setEnabled(false);
2352
 
                                FrameScale->setEnabled(false);
2353
 
                                Aspect->setEnabled(false);
2354
 
                                imageXScaleSpinBox->setEnabled(false);
2355
 
                                imageYScaleSpinBox->setEnabled(false);
2356
 
                                imgDpiX->setEnabled(false);
2357
 
                                imgDpiY->setEnabled(false);
2358
 
                        }
2359
 
                        else
2360
 
                        {
2361
 
                                imageXScaleSpinBox->setEnabled(setter);
2362
 
                                imageYScaleSpinBox->setEnabled(setter);
2363
 
                                imgDpiX->setEnabled(setter);
2364
 
                                imgDpiY->setEnabled(setter);
2365
 
                                Aspect->setEnabled(!setter);
2366
 
                                Aspect->setChecked(CurItem->AspectRatio);
2367
 
                                FreeScale->setEnabled(true);
2368
 
                                FrameScale->setEnabled(true);
2369
 
                        }
2370
 
//CB Why do we need this? Setting it too much here
2371
 
//                      if (setter == true)
2372
 
//                      {
2373
 
//                              keepImageWHRatioButton->setChecked(setter);
2374
 
//                              keepImageDPIRatioButton->setChecked(setter);
2375
 
//                      }
2376
 
                        imageXOffsetSpinBox->setEnabled(setter);
2377
 
                        imageYOffsetSpinBox->setEnabled(setter);
2378
 
                }
2379
 
        }
2380
 
        setXY(CurItem->xPos(), CurItem->yPos());
2381
 
        setLocked(i->locked());
2382
 
        setSizeLocked(i->sizeLocked());
2383
 
        setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
2384
 
        setLineWidth(i->lineWidth());
2385
 
        setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
2386
 
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
2387
 
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
2388
 
        connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2389
 
        connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
2390
 
 
2391
 
        DoGroup->setEnabled(false);
2392
 
        DoUnGroup->setEnabled(false);
2393
 
        if (doc->m_Selection->count() > 1)
2394
 
        {
2395
 
                bool isGroup = true;
2396
 
                int firstElem = -1;
2397
 
                if (CurItem->Groups.count() != 0)
2398
 
                        firstElem = CurItem->Groups.top();
2399
 
                for (int bx = 0; bx < doc->m_Selection->count(); ++bx)
2400
 
                {
2401
 
                        if (doc->m_Selection->itemAt(bx)->Groups.count() != 0)
2402
 
                        {
2403
 
                                if (doc->m_Selection->itemAt(bx)->Groups.top() != firstElem)
2404
 
                                        isGroup = false;
2405
 
                        }
2406
 
                        else
2407
 
                                isGroup = false;
2408
 
                }
2409
 
                if (!isGroup)
2410
 
                        DoGroup->setEnabled(true);
2411
 
                else
2412
 
                {
2413
 
                        if (CurItem->isGroupControl)
2414
 
                                NameEdit->setEnabled(true);
2415
 
                }
2416
 
                if ((CurItem->Groups.count() != 0) && (isGroup))
2417
 
                        DoUnGroup->setEnabled(true);
2418
 
        }
2419
 
        updateSpinBoxConstants();
2420
 
}
2421
 
 
2422
 
void PropertiesPalette::NewSel(int nr)
2423
 
{
2424
 
        if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
2425
 
                return;
2426
 
        int visID;
2427
 
        PageItem *i=0;
2428
 
        int currentTab = TabStack->currentIndex();
2429
 
        disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2430
 
        if (doc->m_Selection->count()>1)
2431
 
        {
2432
 
                RoVal = 0;
2433
 
                double gx, gy, gh, gw;
2434
 
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
2435
 
                int bp = RotationGroup->checkedId();
2436
 
                if (bp == 0)
2437
 
                        m_ScMW->view->RCenter = FPoint(gx, gy);
2438
 
                else if (bp == 1)
2439
 
                        m_ScMW->view->RCenter = FPoint(gx + gw, gy);
2440
 
                else if (bp == 2)
2441
 
                        m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
2442
 
                else if (bp == 3)
2443
 
                        m_ScMW->view->RCenter = FPoint(gx, gy + gh);
2444
 
                else if (bp == 0)
2445
 
                        m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
2446
 
                xposLabel->setText( tr( "&X-Pos:" ) );
2447
 
                widthLabel->setText( tr( "&Width:" ) );
2448
 
                yposLabel->setText( tr( "&Y-Pos:" ) );
2449
 
                heightLabel->setText( tr( "&Height:" ) );
2450
 
                HaveItem = false;
2451
 
                Xpos->setValue(0);
2452
 
                Ypos->setValue(0);
2453
 
                Width->setValue(0);
2454
 
                Height->setValue(0);
2455
 
                Rotation->setValue(0);
2456
 
                RoundRect->setValue(0);
2457
 
                HaveItem = true;
2458
 
                Xpos->setEnabled(true);
2459
 
                Ypos->setEnabled(true);
2460
 
                Width->setEnabled(true);
2461
 
                Height->setEnabled(true);
2462
 
                Rotation->setEnabled(true);
2463
 
//              TabStack->setCurrentIndex(0);
2464
 
                for (int ws = 1; ws < 7; ++ws)
2465
 
                        TabStack->setItemEnabled(ws, false);
2466
 
                TabStack->widget(0)->setEnabled(true);
2467
 
                TabStack->setItemEnabled(idXYZItem, true);
2468
 
                NameEdit->setEnabled(false);
2469
 
                TabStack->setItemEnabled(idLineItem, true);
2470
 
                TabStack->setItemEnabled(idColorsItem, true);
2471
 
                if (HaveItem && CurItem)
2472
 
                {
2473
 
                        if ((CurItem->isGroupControl) || ((CurItem->Groups.count() != 0) && (!CurItem->isSingleSel)))
2474
 
                                TabStack->setItemEnabled(idGroupItem, true);
2475
 
                }
2476
 
                FlipH->setCheckable( false );
2477
 
                FlipV->setCheckable( false );
2478
 
                FlipH->setChecked(false);
2479
 
                FlipV->setChecked(false);
2480
 
                flopRealHeight->setChecked(true);
2481
 
        }
2482
 
        else
2483
 
        {
2484
 
                if (nr!=-1)
2485
 
                {
2486
 
                        i=doc->m_Selection->itemAt(0);
2487
 
                        HaveItem=true;
2488
 
                        EditShape->setEnabled(!i->locked());
2489
 
                        SCustom->setEnabled(nr!=5 && nr!=7 && nr!=8 && !i->locked());
2490
 
                }
2491
 
                else
2492
 
                {
2493
 
                        DoGroup->setEnabled(false);
2494
 
                        DoUnGroup->setEnabled(false);
2495
 
                        EditShape->setEnabled(false);
2496
 
                        SCustom->setEnabled(false);
2497
 
                }
2498
 
                NameEdit->setEnabled(true);
2499
 
//              ShapeGroup->setEnabled(false);
2500
 
//              RoundRect->setEnabled(false);
2501
 
//              Distance->setEnabled(false);
2502
 
                LineMode->setEnabled(false);
2503
 
                RotationGroup->setEnabled(true);
2504
 
/*              TopLeft->setEnabled(true);
2505
 
                TopRight->setEnabled(true);
2506
 
                BottomLeft->setEnabled(true);
2507
 
                BottomRight->setEnabled(true);
2508
 
                Center->setEnabled(true); */
2509
 
                visID = TabStack->currentIndex();
2510
 
                TabStack->widget(0)->setEnabled(true);
2511
 
                TabStack->setItemEnabled(idXYZItem, true);
2512
 
                TabStack->setItemEnabled(idColorsItem, true);
2513
 
                /*
2514
 
                disconnect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2515
 
                disconnect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2516
 
                FlipH->setChecked(false);
2517
 
                FlipV->setChecked(false);
2518
 
                connect(FlipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
2519
 
                connect(FlipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
2520
 
                */
2521
 
                
2522
 
                //CB If Toggle is not possible, then we need to enable it so we can turn it off
2523
 
                //It then gets reset below for items where its valid
2524
 
                if ((nr>4) && (nr<9))
2525
 
                {
2526
 
                        FlipH->setCheckable(true);
2527
 
                        FlipV->setCheckable(true);
2528
 
                        FlipH->setChecked(false);
2529
 
                        FlipV->setChecked(false);
2530
 
                }
2531
 
                FlipH->setCheckable((nr>=0) && (nr<5));
2532
 
                FlipV->setCheckable((nr>=0) && (nr<5));
2533
 
                //CB Why cant we do this for lines?
2534
 
//              FlipH->setEnabled((nr!=-1) && (nr!=5));
2535
 
//              FlipV->setEnabled((nr!=-1) && (nr!=5));
2536
 
                FlipH->setEnabled(nr!=-1);
2537
 
                FlipV->setEnabled(nr!=-1);
2538
 
                switch (nr)
2539
 
                {
2540
 
                case -1:
2541
 
                        xposLabel->setText( tr( "&X-Pos:" ) );
2542
 
                        widthLabel->setText( tr( "&Width:" ) );
2543
 
                        yposLabel->setText( tr( "&Y-Pos:" ) );
2544
 
                        heightLabel->setText( tr( "&Height:" ) );
2545
 
                        //Rotation->setEnabled(true);
2546
 
                        //Height->setEnabled(true);
2547
 
                        RoundRect->setEnabled(false);
2548
 
                        HaveItem = false;
2549
 
                        Xpos->setValue(0);
2550
 
                        Ypos->setValue(0);
2551
 
                        Width->setValue(0);
2552
 
                        Height->setValue(0);
2553
 
                        Rotation->setValue(0);
2554
 
                        RoundRect->setValue(0);
2555
 
                        for (int ws = 1; ws < 7; ++ws)
2556
 
                                TabStack->setItemEnabled(ws, false);
2557
 
//                      TabStack->setCurrentIndex(0);
2558
 
                        TabStack->widget(0)->setEnabled(false);
2559
 
                        TabStack->setItemEnabled(idXYZItem, false);
2560
 
                        Cpal->ChooseGrad(0);
2561
 
                        LevelTxt->setText("  ");
2562
 
                        break;
2563
 
                case 2:
2564
 
                        TabStack->setItemEnabled(idShapeItem, true);
2565
 
                        TabStack->setItemEnabled(idTextItem, false);
2566
 
                        TabStack->setItemEnabled(idImageItem, true);
2567
 
                        TabStack->setItemEnabled(idLineItem, true);
2568
 
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2569
 
                                RoundRect->setEnabled(!i->locked());
2570
 
                        else
2571
 
                                RoundRect->setEnabled(false);
2572
 
                        if ((doc->m_Selection->itemAt(0)->FrameType == 0) || (doc->m_Selection->itemAt(0)->FrameType == 2))
2573
 
                                RoundRect->setEnabled(!i->locked());
2574
 
//                      if (visID == 2)
2575
 
//                              TabStack->setCurrentIndex(0);
2576
 
                        break;
2577
 
                case 4:
2578
 
                        TabStack->setItemEnabled(idShapeItem, true);
2579
 
                        TabStack->setItemEnabled(idTextItem, true);
2580
 
                        TabStack->setItemEnabled(idImageItem, false);
2581
 
                        TabStack->setItemEnabled(idLineItem, true);
2582
 
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2583
 
                                RoundRect->setEnabled(!i->locked());
2584
 
                        else
2585
 
                                RoundRect->setEnabled(false);
2586
 
//                      Distance->setEnabled(true);
2587
 
//                      if (visID == 3)
2588
 
//                              TabStack->setCurrentIndex(0);
2589
 
                        break;
2590
 
                case 5:
2591
 
                        TabStack->setItemEnabled(idShapeItem, false);
2592
 
                        TabStack->setItemEnabled(idTextItem, false);
2593
 
                        TabStack->setItemEnabled(idImageItem, false);
2594
 
                        TabStack->setItemEnabled(idLineItem, true);
2595
 
                        RoundRect->setEnabled(false);
2596
 
                        LineMode->setEnabled(true);
2597
 
                        RotationGroup->setEnabled(false);
2598
 
/*                      TopLeft->setEnabled(false);
2599
 
                        TopRight->setEnabled(false);
2600
 
                        BottomLeft->setEnabled(false);
2601
 
                        BottomRight->setEnabled(false);
2602
 
                        Center->setEnabled(false); */
2603
 
//                      if ((visID == 1) || (visID == 2) || (visID == 3))
2604
 
//                              TabStack->setCurrentIndex(0);
2605
 
                        break;
2606
 
                case 1:
2607
 
                case 3:
2608
 
                case 6:
2609
 
                        TabStack->setItemEnabled(idShapeItem, true);
2610
 
                        TabStack->setItemEnabled(idTextItem, false);
2611
 
                        TabStack->setItemEnabled(idImageItem, false);
2612
 
                        TabStack->setItemEnabled(idLineItem, true);
2613
 
                        if ((!i->ClipEdited) && ((i->FrameType == 0) || (i->FrameType == 2)))
2614
 
                                RoundRect->setEnabled(!i->locked());
2615
 
                        else
2616
 
                                RoundRect->setEnabled(false);
2617
 
//                      if ((visID == 2) || (visID == 3))
2618
 
//                              TabStack->setCurrentIndex(0);
2619
 
                        break;
2620
 
                case 7:
2621
 
                        TabStack->setItemEnabled(idShapeItem, true);
2622
 
                        TabStack->setItemEnabled(idTextItem, false);
2623
 
                        TabStack->setItemEnabled(idImageItem, false);
2624
 
                        TabStack->setItemEnabled(idLineItem, true);
2625
 
                        RoundRect->setEnabled(false);
2626
 
//                      if ((visID == 2) || (visID == 3))
2627
 
//                              TabStack->setCurrentIndex(0);
2628
 
                        break;
2629
 
                case 8:
2630
 
                        TabStack->setItemEnabled(idShapeItem, true);
2631
 
                        TabStack->setItemEnabled(idTextItem, true);
2632
 
                        TabStack->setItemEnabled(idImageItem, false);
2633
 
                        TabStack->setItemEnabled(idLineItem, true);
2634
 
                        RoundRect->setEnabled(false);
2635
 
//                      if (visID == 3)
2636
 
//                              TabStack->setCurrentIndex(0);
2637
 
                        break;
2638
 
                }
2639
 
        }
2640
 
        if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
2641
 
                TabStack->setCurrentIndex(currentTab);
2642
 
        updateGeometry();
2643
 
//      setFocus();
2644
 
        repaint();
2645
 
        connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
2646
 
}
2647
 
 
2648
 
void PropertiesPalette::setMultipleSelection(bool isMultiple)
2649
 
{
2650
 
        if (!HaveDoc)
2651
 
                return;
2652
 
        //CB Having added the selection and undo transaction to mirrorpolyh/v in doc,
2653
 
        //these can be enabled all the time
2654
 
        FlipH->setEnabled(true);
2655
 
        FlipV->setEnabled(true);
2656
 
        NameEdit->setEnabled(!isMultiple);
2657
 
        if (doc->m_Selection->count() > 1)
2658
 
        {
2659
 
                FlipH->setCheckable( false );
2660
 
                FlipV->setCheckable( false );
2661
 
                PageItem *i;
2662
 
                uint lowestItem = 999999;
2663
 
                for (int a=0; a<doc->m_Selection->count(); ++a)
2664
 
                {
2665
 
                        i = doc->m_Selection->itemAt(a);
2666
 
                        lowestItem = qMin(lowestItem, i->ItemNr);
2667
 
                }
2668
 
                i = doc->Items->at(lowestItem);
2669
 
                SetCurItem(i);
2670
 
        }
2671
 
}
2672
 
 
2673
 
void PropertiesPalette::unitChange()
2674
 
{
2675
 
        if (!HaveDoc)
2676
 
                return;
2677
 
        bool tmp = HaveItem;
2678
 
        HaveItem = false;
2679
 
        double oldRatio = m_unitRatio;
2680
 
        m_unitRatio = doc->unitRatio();
2681
 
        m_unitIndex = doc->unitIndex();
2682
 
    Xpos->setNewUnit( m_unitIndex );
2683
 
    Ypos->setNewUnit( m_unitIndex );
2684
 
    Width->setNewUnit( m_unitIndex );
2685
 
    Height->setNewUnit( m_unitIndex );
2686
 
    imageXOffsetSpinBox->setNewUnit( m_unitIndex );
2687
 
    imageYOffsetSpinBox->setNewUnit( m_unitIndex );
2688
 
    dGap->setNewUnit( m_unitIndex );
2689
 
    DLeft->setNewUnit( m_unitIndex );
2690
 
    DTop->setNewUnit( m_unitIndex );
2691
 
    DBottom->setNewUnit( m_unitIndex );
2692
 
    DRight->setNewUnit( m_unitIndex );
2693
 
    RoundRect->setNewUnit( m_unitIndex );
2694
 
    LSize->setNewUnit( m_unitIndex );
2695
 
/*
2696
 
        double maxXYWHVal=30000 * m_unitRatio;
2697
 
        double minXYVal=-30000 * m_unitRatio;
2698
 
 
2699
 
        double ratioDivisor = m_unitRatio / oldRatio;
2700
 
        double newX = Xpos->value() * ratioDivisor;
2701
 
        double newY = Ypos->value() * ratioDivisor;
2702
 
        double newW = Width->value() * ratioDivisor;
2703
 
        double newH = Height->value() * ratioDivisor;
2704
 
        double newLX = imageXOffsetSpinBox->value() * ratioDivisor;
2705
 
        double newLY = imageYOffsetSpinBox->value() * ratioDivisor;
2706
 
        double newG = dGap->value() * ratioDivisor;
2707
 
        double newGM = dGap->maximum() * ratioDivisor;
2708
 
        double newDT = DTop->value() * ratioDivisor;
2709
 
        double newDL = DLeft->value() * ratioDivisor;
2710
 
        double newDB = DBottom->value() * ratioDivisor;
2711
 
        double newDR = DRight->value() * ratioDivisor;
2712
 
        double newRR = RoundRect->value() * ratioDivisor;
2713
 
        double newRM = RoundRect->maximum() * ratioDivisor;
2714
 
        double newLZ = LSize->value() * ratioDivisor;
2715
 
 
2716
 
        if (doc->unitIndex() > unitGetMaxIndex())
2717
 
                doc->setUnitIndex(0);
2718
 
        QString ein = unitGetSuffixFromIndex(doc->unitIndex());
2719
 
 
2720
 
        Xpos->setSuffix( ein );
2721
 
        Ypos->setSuffix( ein );
2722
 
        Width->setSuffix( ein );
2723
 
        Height->setSuffix( ein );
2724
 
        imageXOffsetSpinBox->setSuffix( ein );
2725
 
        imageYOffsetSpinBox->setSuffix( ein );
2726
 
        dGap->setSuffix( ein );
2727
 
        DLeft->setSuffix( ein );
2728
 
        DTop->setSuffix( ein );
2729
 
        DBottom->setSuffix( ein );
2730
 
        DRight->setSuffix( ein );
2731
 
        RoundRect->setSuffix( ein );
2732
 
        LSize->setSuffix( ein );
2733
 
        LSize->setValue(newLZ);
2734
 
 
2735
 
        int decimals = unitGetDecimalsFromIndex(doc->unitIndex());
2736
 
 
2737
 
        Xpos->setValues( minXYVal, maxXYWHVal, decimals, newX );
2738
 
        Ypos->setValues( minXYVal, maxXYWHVal, decimals, newY );
2739
 
        Width->setValues( m_unitRatio, maxXYWHVal, decimals, newW );
2740
 
        Height->setValues( m_unitRatio, maxXYWHVal, decimals, newH );
2741
 
 
2742
 
        imageXOffsetSpinBox->setDecimals(decimals);
2743
 
        imageXOffsetSpinBox->setMaximum( maxXYWHVal );
2744
 
        imageXOffsetSpinBox->setValue(newLX);
2745
 
 
2746
 
        imageYOffsetSpinBox->setDecimals(decimals);
2747
 
        imageYOffsetSpinBox->setMaximum( maxXYWHVal );
2748
 
        imageYOffsetSpinBox->setValue(newLY);
2749
 
 
2750
 
        dGap->setDecimals(decimals);
2751
 
        dGap->setMaximum(newGM);
2752
 
        dGap->setValue(newG);
2753
 
 
2754
 
        DLeft->setDecimals(decimals);
2755
 
        DLeft->setMaximum( 300 );
2756
 
        DLeft->setValue(newDL);
2757
 
 
2758
 
        DTop->setDecimals(decimals);
2759
 
        DTop->setMaximum( 300 );
2760
 
        DTop->setValue(newDT);
2761
 
 
2762
 
        DBottom->setDecimals(decimals);
2763
 
        DBottom->setMaximum( 300 );
2764
 
        DBottom->setValue(newDB);
2765
 
 
2766
 
        DRight->setDecimals(decimals);
2767
 
        DRight->setMaximum( 300 );
2768
 
        DRight->setValue(newDR);
2769
 
 
2770
 
        RoundRect->setValues(-newRM, newRM, decimals, newRR);
2771
 
*/
2772
 
        Cpal->unitChange(oldRatio, m_unitRatio, doc->unitIndex());
2773
 
        HaveItem = tmp;
2774
 
}
2775
 
 
2776
 
void PropertiesPalette::setLevel(uint l)
2777
 
{
2778
 
        QString tm;
2779
 
        LevelTxt->setText(tm.setNum(l + 1));
2780
 
}
2781
 
 
2782
 
void PropertiesPalette::setXY(double x, double y)
2783
 
{
2784
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2785
 
                return;
2786
 
        disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2787
 
        disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2788
 
        bool useLineMode = false;
2789
 
        bool tmp = HaveItem;
2790
 
        double inX, inY, b, h, r, dummy1, dummy2;
2791
 
        QMatrix ma;
2792
 
        FPoint n;
2793
 
        if (HaveItem)
2794
 
        {
2795
 
                if (doc->m_Selection->isMultipleSelection())
2796
 
                {
2797
 
                        doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
2798
 
                        r = 0.0;
2799
 
                        ma.translate(dummy1, dummy2);
2800
 
                }
2801
 
                else
2802
 
                {
2803
 
                        b = CurItem->width();
2804
 
                        h = CurItem->height();
2805
 
                        r = CurItem->rotation();
2806
 
                        ma.translate(x, y);
2807
 
                        useLineMode = (LMode && CurItem->isLine());
2808
 
                }
2809
 
        }
2810
 
        else
2811
 
        {
2812
 
                b = 0.0;
2813
 
                h = 0.0;
2814
 
                r = 0.0;
2815
 
                ma.translate(x, y);
2816
 
        }
2817
 
        HaveItem = false;
2818
 
//      ma.translate(x, y);
2819
 
        ma.rotate(r);
2820
 
        int bp = RotationGroup->checkedId();
2821
 
        // #8890 : basepoint is meaningless when lines use "end points" mode
2822
 
        if (bp == 0 || useLineMode)
2823
 
                n = FPoint(0.0, 0.0);
2824
 
        else if (bp == 1)
2825
 
                n = FPoint(b, 0.0);
2826
 
        else if (bp == 2)
2827
 
                n = FPoint(b / 2.0, h / 2.0);
2828
 
        else if (bp == 3)
2829
 
                n = FPoint(0.0, h);
2830
 
        else if (bp == 4)
2831
 
                n = FPoint(b, h);
2832
 
        inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
2833
 
        inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
2834
 
        if (tmp)
2835
 
        {
2836
 
                inX -= doc->rulerXoffset;
2837
 
                inY -= doc->rulerYoffset;
2838
 
                if (doc->guidesSettings.rulerMode)
2839
 
                {
2840
 
                        inX -= doc->currentPage()->xOffset();
2841
 
                        inY -= doc->currentPage()->yOffset();
2842
 
                }
2843
 
        }
2844
 
        Xpos->setValue(inX*m_unitRatio);
2845
 
        Ypos->setValue(inY*m_unitRatio);
2846
 
        if (useLineMode)
2847
 
                setBH(CurItem->width(), CurItem->height());
2848
 
        HaveItem = tmp;
2849
 
        connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
2850
 
        connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
2851
 
}
2852
 
 
2853
 
void PropertiesPalette::setBH(double x, double y)
2854
 
{
2855
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2856
 
                return;
2857
 
        bool tmp = HaveItem;
2858
 
        HaveItem = false;
2859
 
        QMatrix ma;
2860
 
        QPoint dp;
2861
 
        if ((LMode) && (CurItem->asLine()))
2862
 
        {
2863
 
                ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
2864
 
                ma.rotate(static_cast<double>(Rotation->value())*(-1));
2865
 
                // Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
2866
 
                dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
2867
 
                Width->setValue(dp.x()*m_unitRatio);
2868
 
                Height->setValue(dp.y()*m_unitRatio);
2869
 
        }
2870
 
        else
2871
 
        {
2872
 
                RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
2873
 
                RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
2874
 
                Width->setValue(x*m_unitRatio);
2875
 
                Height->setValue(y*m_unitRatio);
2876
 
        }
2877
 
        HaveItem = tmp;
2878
 
}
2879
 
 
2880
 
void PropertiesPalette::setR(double r)
2881
 
{
2882
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2883
 
                return;
2884
 
        bool tmp = HaveItem;
2885
 
        double rr = r;
2886
 
        if (r > 0)
2887
 
                rr = 360 - rr;
2888
 
        HaveItem = false;
2889
 
        Rotation->setValue(fabs(rr));
2890
 
        HaveItem = tmp;
2891
 
}
2892
 
 
2893
 
void PropertiesPalette::setRR(double r)
2894
 
{
2895
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2896
 
                return;
2897
 
        bool tmp = HaveItem;
2898
 
        HaveItem = false;
2899
 
        RoundRect->setValue(r*m_unitRatio);
2900
 
        HaveItem = tmp;
2901
 
}
2902
 
 
2903
 
void PropertiesPalette::setCols(int r, double g)
2904
 
{
2905
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2906
 
                return;
2907
 
        bool tmp = HaveItem;
2908
 
        HaveItem = false;
2909
 
        DCol->setValue(r);
2910
 
        dGap->setValue(g*m_unitRatio);
2911
 
        if (tmp)
2912
 
        {
2913
 
                PageItem_TextFrame *i2=CurItem->asTextFrame();
2914
 
                if (i2!=0)
2915
 
                {
2916
 
                        DCol->setMaximum(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
2917
 
                        if (colgapLabel->currentIndex() == 0)
2918
 
                        {
2919
 
                                dGap->setMaximum(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*m_unitRatio, 0.0));
2920
 
                                dGap->setValue(i2->ColGap*m_unitRatio);
2921
 
                        }
2922
 
                        else
2923
 
                        {
2924
 
                                dGap->setMaximum(qMax((i2->width() / i2->Cols)*m_unitRatio, 0.0));
2925
 
                                dGap->setValue(i2->columnWidth()*m_unitRatio);
2926
 
                        }
2927
 
                }
2928
 
        }
2929
 
        DCol->setMinimum(1);
2930
 
        dGap->setMinimum(0);
2931
 
        HaveItem = tmp;
2932
 
}
2933
 
 
2934
 
// NewLspMode?
2935
 
// void PropertiesPalette::setLspMode(QAction *id)
2936
 
// {
2937
 
//      if ((HaveDoc) && (HaveItem))
2938
 
//      {
2939
 
//              doc->itemSelection_SetLineSpacingMode(lineSpacingPop->actions().indexOf(id));
2940
 
//              updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2941
 
//      }
2942
 
// }
2943
 
 
2944
 
// NewLspMode?
2945
 
void PropertiesPalette::setLineSpacingMode(int id)
2946
 
{
2947
 
        if ((HaveDoc) && (HaveItem))
2948
 
        {
2949
 
                if (CurItem->asTextFrame())
2950
 
                {
2951
 
//                      CurItem->asTextFrame()->ExpandParSel();
2952
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
2953
 
//                      CurItem->asTextFrame()->lastAction4Paragraph = true;
2954
 
                }
2955
 
                doc->itemSelection_SetLineSpacingMode(id);
2956
 
                updateStyle(doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2957
 
                if (CurItem->asTextFrame())
2958
 
                        CurItem->asTextFrame()->updateUndo();
2959
 
        }
2960
 
}
2961
 
 
2962
 
void PropertiesPalette::setLsp(double r)
2963
 
{
2964
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2965
 
                return;
2966
 
        bool tmp = HaveItem;
2967
 
        HaveItem = false;
2968
 
        LineSp->setValue(r);
2969
 
        const ParagraphStyle& curStyle(tmp && doc->appMode == modeEdit? CurItem->currentStyle() : CurItem->itemText.defaultStyle());
2970
 
        if (tmp)
2971
 
        {
2972
 
                setupLineSpacingSpinbox(curStyle.lineSpacingMode(), r);
2973
 
                lineSpacingModeCombo->setCurrentIndex(curStyle.lineSpacingMode());
2974
 
/*
2975
 
                QList<QAction*> actList = lineSpacingPop->actions();
2976
 
                for (int al = 0; al < actList.count(); ++al)
2977
 
                {
2978
 
                        actList[al]->setChecked(false);
2979
 
                }
2980
 
                actList[curStyle.lineSpacingMode()]->setChecked(true);
2981
 
*/
2982
 
        }
2983
 
        HaveItem = tmp;
2984
 
}
2985
 
 
2986
 
void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
2987
 
{
2988
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
2989
 
                return;
2990
 
        bool tmp = HaveItem;
2991
 
        HaveItem = false;
2992
 
        DLeft->setValue(left*m_unitRatio);
2993
 
        DTop->setValue(top*m_unitRatio);
2994
 
        DBottom->setValue(bottom*m_unitRatio);
2995
 
        DRight->setValue(right*m_unitRatio);
2996
 
        HaveItem = tmp;
2997
 
}
2998
 
 
2999
 
void PropertiesPalette::setFontFace(const QString& newFont)
3000
 
{
3001
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3002
 
                return;
3003
 
        bool tmp = HaveItem;
3004
 
        HaveItem = false;
3005
 
        if (CurItem != NULL)
3006
 
                Fonts->RebuildList(doc, CurItem->isAnnotation());
3007
 
        Fonts->setCurrentFont(newFont);
3008
 
        HaveItem = tmp;
3009
 
}
3010
 
 
3011
 
 
3012
 
void PropertiesPalette::setSize(double s)
3013
 
{
3014
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3015
 
                return;
3016
 
        bool tmp = HaveItem;
3017
 
        HaveItem = false;
3018
 
        Size->setValue(s / 10.0);
3019
 
        HaveItem = tmp;
3020
 
}
3021
 
 
3022
 
void PropertiesPalette::setExtra(double e)
3023
 
{
3024
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3025
 
                return;
3026
 
        bool tmp = HaveItem;
3027
 
        HaveItem = false;
3028
 
        Extra->setValue(e / 10.0);
3029
 
        HaveItem = tmp;
3030
 
}
3031
 
 
3032
 
void PropertiesPalette::ChangeScaling()
3033
 
{
3034
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3035
 
                return;
3036
 
        if (FreeScale == sender())
3037
 
        {
3038
 
                FrameScale->setChecked(false);
3039
 
                FreeScale->setChecked(true);
3040
 
                Aspect->setEnabled(false);
3041
 
                imageXOffsetSpinBox->setEnabled(true);
3042
 
                imageYOffsetSpinBox->setEnabled(true);
3043
 
                imageXScaleSpinBox->setEnabled(true);
3044
 
                imageYScaleSpinBox->setEnabled(true);
3045
 
                imgDpiX->setEnabled(true);
3046
 
                imgDpiY->setEnabled(true);
3047
 
        }
3048
 
        if (FrameScale == sender())
3049
 
        {
3050
 
                FrameScale->setChecked(true);
3051
 
                FreeScale->setChecked(false);
3052
 
                Aspect->setEnabled(true);
3053
 
                imageXOffsetSpinBox->setEnabled(false);
3054
 
                imageYOffsetSpinBox->setEnabled(false);
3055
 
                imageXScaleSpinBox->setEnabled(false);
3056
 
                imageYScaleSpinBox->setEnabled(false);
3057
 
                imgDpiX->setEnabled(false);
3058
 
                imgDpiY->setEnabled(false);
3059
 
        }
3060
 
        if ((HaveDoc) && (HaveItem))
3061
 
        {
3062
 
                CurItem->setImageScalingMode(FreeScale->isChecked(), Aspect->isChecked());
3063
 
                emit UpdtGui(PageItem::ImageFrame);
3064
 
                emit DocChanged();
3065
 
//              setFocus();
3066
 
        }
3067
 
}
3068
 
 
3069
 
void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
3070
 
{
3071
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3072
 
                return;
3073
 
        bool tmp = HaveItem;
3074
 
        HaveItem = false;
3075
 
        disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3076
 
        disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3077
 
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3078
 
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3079
 
        disconnect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3080
 
        disconnect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3081
 
        if (fabs(scx - scy) > 0.0002)
3082
 
        {
3083
 
                keepImageWHRatioButton->setChecked(false);
3084
 
                keepImageDPIRatioButton->setChecked(false);
3085
 
        }
3086
 
        if (tmp)
3087
 
        {
3088
 
                imageXOffsetSpinBox->setValue(x * m_unitRatio * CurItem->imageXScale());
3089
 
                imageYOffsetSpinBox->setValue(y * m_unitRatio * CurItem->imageYScale());
3090
 
                imageXScaleSpinBox->setValue(scx * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
3091
 
                imageYScaleSpinBox->setValue(scy * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
3092
 
                imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3093
 
                imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3094
 
        }
3095
 
        else
3096
 
        {
3097
 
                imageXOffsetSpinBox->setValue(x * m_unitRatio);
3098
 
                imageYOffsetSpinBox->setValue(y * m_unitRatio);
3099
 
                imageXScaleSpinBox->setValue(scx * 100);
3100
 
                imageYScaleSpinBox->setValue(scy * 100);
3101
 
                imgDpiX->setValue(72);
3102
 
                imgDpiY->setValue(72);
3103
 
        }
3104
 
        connect(keepImageWHRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKette()));
3105
 
        connect(keepImageDPIRatioButton, SIGNAL(clicked()), this, SLOT(ToggleKetteD()));
3106
 
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3107
 
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3108
 
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
3109
 
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
3110
 
        HaveItem = tmp;
3111
 
}
3112
 
 
3113
 
void PropertiesPalette::setLineWidth(double s)
3114
 
{
3115
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3116
 
                return;
3117
 
        bool tmp = HaveItem;
3118
 
        HaveItem = false;
3119
 
        LSize->setValue(s*m_unitRatio);
3120
 
        if (tmp)
3121
 
        {
3122
 
                if (CurItem->dashes().count() != 0)
3123
 
                {
3124
 
                        if (CurItem->lineWidth() != 0.0)
3125
 
                        {
3126
 
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
3127
 
                                dashEditor->setEnabled(true);
3128
 
                        }
3129
 
                        else
3130
 
                                dashEditor->setEnabled(false);
3131
 
                }
3132
 
        }
3133
 
        HaveItem = tmp;
3134
 
}
3135
 
 
3136
 
void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
3137
 
{
3138
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3139
 
                return;
3140
 
        bool tmp = HaveItem;
3141
 
        HaveItem = false;
3142
 
        if (tmp)
3143
 
        {
3144
 
                if (CurItem->dashes().count() != 0)
3145
 
                {
3146
 
                        LStyle->setCurrentIndex(37);
3147
 
                        dashEditor->setDashValues(CurItem->dashes(), qMax(CurItem->lineWidth(), 0.001), CurItem->dashOffset());
3148
 
                }
3149
 
                else
3150
 
                        LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3151
 
        }
3152
 
        else
3153
 
                LStyle->setCurrentIndex(static_cast<int>(p) - 1);
3154
 
        switch (pc)
3155
 
        {
3156
 
        case Qt::FlatCap:
3157
 
                LEndStyle->setCurrentIndex(0);
3158
 
                break;
3159
 
        case Qt::SquareCap:
3160
 
                LEndStyle->setCurrentIndex(1);
3161
 
                break;
3162
 
        case Qt::RoundCap:
3163
 
                LEndStyle->setCurrentIndex(2);
3164
 
                break;
3165
 
        default:
3166
 
                LEndStyle->setCurrentIndex(0);
3167
 
                break;
3168
 
        }
3169
 
        switch (pj)
3170
 
        {
3171
 
        case Qt::MiterJoin:
3172
 
                LJoinStyle->setCurrentIndex(0);
3173
 
                break;
3174
 
        case Qt::BevelJoin:
3175
 
                LJoinStyle->setCurrentIndex(1);
3176
 
                break;
3177
 
        case Qt::RoundJoin:
3178
 
                LJoinStyle->setCurrentIndex(2);
3179
 
                break;
3180
 
        default:
3181
 
                LJoinStyle->setCurrentIndex(0);
3182
 
                break;
3183
 
        }
3184
 
        HaveItem = tmp;
3185
 
}
3186
 
 
3187
 
void PropertiesPalette::setFlop( FirstLineOffsetPolicy f )
3188
 
{
3189
 
        if(f == FLOPFontAscent)
3190
 
                flopFontAscent->setChecked(true);
3191
 
        else if(f == FLOPLineSpacing)
3192
 
                flopLineSpacing->setChecked(true);
3193
 
        else
3194
 
                flopRealHeight->setChecked(true); //It’s historical behaviour.
3195
 
}
3196
 
 
3197
 
void PropertiesPalette::setupLineSpacingSpinbox(int mode, double value)
3198
 
{
3199
 
        if (mode > 0)
3200
 
        {
3201
 
                if (mode==1)
3202
 
                        LineSp->setSpecialValueText( tr( "Auto" ) );
3203
 
                if (mode==2)
3204
 
                        LineSp->setSpecialValueText( tr( "Baseline" ) );
3205
 
                LineSp->setMinimum(0);
3206
 
                LineSp->setValue(0);
3207
 
                LineSp->setEnabled(false);
3208
 
        }
3209
 
        else
3210
 
        {
3211
 
                LineSp->setSpecialValueText("");
3212
 
                LineSp->setMinimum(1);
3213
 
                LineSp->setValue(value);
3214
 
                LineSp->setEnabled(true);
3215
 
        }
3216
 
}
3217
 
 
3218
 
void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
3219
 
{
3220
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3221
 
                return;
3222
 
        bool tmp = HaveItem;
3223
 
        HaveItem = false;
3224
 
        setupLineSpacingSpinbox(newCurrent.lineSpacingMode(), newCurrent.lineSpacing());
3225
 
        lineSpacingModeCombo->setCurrentIndex(newCurrent.lineSpacingMode());
3226
 
        /*
3227
 
        QList<QAction*> actList = lineSpacingPop->actions();
3228
 
        for (int al = 0; al < actList.count(); ++al)
3229
 
        {
3230
 
                actList[al]->setChecked(false);
3231
 
        }
3232
 
        actList[newCurrent.lineSpacingMode()]->setChecked(true);
3233
 
        */
3234
 
        GroupAlign->setStyle(newCurrent.alignment());
3235
 
        minWordTrackingSpinBox->setValue(newCurrent.minWordTracking() * 100.0);
3236
 
        normWordTrackingSpinBox->setValue(newCurrent.charStyle().wordTracking() * 100.0);
3237
 
        minGlyphExtSpinBox->setValue(newCurrent.minGlyphExtension() * 100.0);
3238
 
        maxGlyphExtSpinBox->setValue(newCurrent.maxGlyphExtension() * 100.0);
3239
 
        
3240
 
        updateOpticalMargins(newCurrent);
3241
 
        
3242
 
        HaveItem = tmp;
3243
 
        
3244
 
        
3245
 
}
3246
 
 
3247
 
void PropertiesPalette::setStil(int s)
3248
 
{
3249
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3250
 
                return;
3251
 
        StrokeIcon->setEnabled(false);
3252
 
        TxStroke->setEnabled(false);
3253
 
        PM1->setEnabled(false);
3254
 
        SeStyle->setStyle(s);
3255
 
        if ((s & 4) || (s & 256))
3256
 
        {
3257
 
                StrokeIcon->setEnabled(true);
3258
 
                TxStroke->setEnabled(true);
3259
 
                PM1->setEnabled(true);
3260
 
        }
3261
 
}
3262
 
 
3263
 
void PropertiesPalette::setAli(int e)
3264
 
{
3265
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3266
 
                return;
3267
 
        bool tmp = HaveItem;
3268
 
        HaveItem = false;
3269
 
        GroupAlign->setEnabled(true);
3270
 
        GroupAlign->setStyle(e);
3271
 
        HaveItem = tmp;
3272
 
}
3273
 
 
3274
 
 
3275
 
void PropertiesPalette::setParStyle(const QString& name)
3276
 
{
3277
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3278
 
                return;
3279
 
        bool tmp = HaveItem;
3280
 
        HaveItem = false;
3281
 
        paraStyleCombo->setFormat(name);
3282
 
        HaveItem = tmp;
3283
 
}
3284
 
 
3285
 
 
3286
 
void PropertiesPalette::setCharStyle(const QString& name)
3287
 
{
3288
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3289
 
                return;
3290
 
        bool tmp = HaveItem;
3291
 
        HaveItem = false;
3292
 
        charStyleCombo->setFormat(name);
3293
 
        HaveItem = tmp;
3294
 
}
3295
 
 
3296
 
void PropertiesPalette::setOpticalMargins()
3297
 
{
3298
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3299
 
                return;
3300
 
        if (CurItem->asTextFrame())
3301
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(PageItem::FRAME);
3302
 
        int omt(ParagraphStyle::OM_None);
3303
 
//      if (optMarginCheckLeftProtruding->isChecked()) omt+=ParagraphStyle::OM_LeftProtruding;
3304
 
        if (optMarginRadioBoth->isChecked())
3305
 
                omt =ParagraphStyle::OM_Default;
3306
 
        else if (optMarginRadioLeft->isChecked())
3307
 
                omt = ParagraphStyle::OM_LeftHangingPunct;
3308
 
        else if (optMarginRadioRight->isChecked())
3309
 
                omt = ParagraphStyle::OM_RightHangingPunct;
3310
 
 
3311
 
        doc->itemSelection_SetOpticalMargins(omt);
3312
 
        if (CurItem->asTextFrame())
3313
 
                CurItem->asTextFrame()->updateUndo();
3314
 
}
3315
 
 
3316
 
void PropertiesPalette::resetOpticalMargins()
3317
 
{
3318
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3319
 
                return;
3320
 
        doc->itemSelection_resetOpticalMargins();
3321
 
}
3322
 
 
3323
 
void PropertiesPalette::updateOpticalMargins(const ParagraphStyle & pStyle)
3324
 
{
3325
 
        
3326
 
        ParagraphStyle::OpticalMarginType omt(static_cast<ParagraphStyle::OpticalMarginType>(pStyle.opticalMargins()));
3327
 
        if (omt == ParagraphStyle::OM_Default)
3328
 
                optMarginRadioBoth->setChecked(true);
3329
 
        else if (omt == ParagraphStyle::OM_LeftHangingPunct)
3330
 
                optMarginRadioLeft->setChecked(true);
3331
 
        else if (omt == ParagraphStyle::OM_RightHangingPunct)
3332
 
                optMarginRadioRight->setChecked(true);
3333
 
        else
3334
 
                optMarginRadioNone->setChecked(true);
3335
 
}
3336
 
 
3337
 
void PropertiesPalette::setMinWordTracking()
3338
 
{
3339
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3340
 
                return;
3341
 
        if (CurItem->asTextFrame())
3342
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3343
 
        ParagraphStyle newStyle;
3344
 
        newStyle.setMinWordTracking(minWordTrackingSpinBox->value() / 100.0);
3345
 
        doc->itemSelection_ApplyParagraphStyle(newStyle);
3346
 
        if (CurItem->asTextFrame())
3347
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3348
 
}
3349
 
 
3350
 
 
3351
 
void PropertiesPalette::setNormWordTracking()
3352
 
{
3353
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3354
 
                return;
3355
 
        if (CurItem->asTextFrame())
3356
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3357
 
        ParagraphStyle newStyle;
3358
 
//      newStyle.setNormWordTracking(percent / 100.0);
3359
 
        newStyle.charStyle().setWordTracking(normWordTrackingSpinBox->value() / 100.0);
3360
 
        doc->itemSelection_ApplyParagraphStyle(newStyle);
3361
 
        if (CurItem->asTextFrame())
3362
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3363
 
}
3364
 
 
3365
 
void PropertiesPalette::setMinGlyphExtension()
3366
 
{
3367
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3368
 
                return;
3369
 
        if (CurItem->asTextFrame())
3370
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3371
 
        ParagraphStyle newStyle;
3372
 
        newStyle.setMinGlyphExtension(minGlyphExtSpinBox->value() / 100.0);
3373
 
        doc->itemSelection_ApplyParagraphStyle(newStyle);
3374
 
        if (CurItem->asTextFrame())
3375
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3376
 
}
3377
 
 
3378
 
void PropertiesPalette::setMaxGlyphExtension()
3379
 
{
3380
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3381
 
                return;
3382
 
        if (CurItem->asTextFrame())
3383
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3384
 
        ParagraphStyle newStyle;
3385
 
        newStyle.setMaxGlyphExtension(maxGlyphExtSpinBox->value() / 100.0);
3386
 
        doc->itemSelection_ApplyParagraphStyle(newStyle);
3387
 
        if (CurItem->asTextFrame())
3388
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3389
 
}
3390
 
 
3391
 
 
3392
 
void PropertiesPalette::setTScaleV(double e)
3393
 
{
3394
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3395
 
                return;
3396
 
        bool tmp = HaveItem;
3397
 
        HaveItem = false;
3398
 
        ChScaleV->setValue(e / 10.0);
3399
 
        HaveItem = tmp;
3400
 
}
3401
 
 
3402
 
void PropertiesPalette::NewTScaleV()
3403
 
{
3404
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3405
 
                return;
3406
 
        if (CurItem->asTextFrame())
3407
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3408
 
        doc->itemSelection_SetScaleV(qRound(ChScaleV->value() * 10));
3409
 
        if (CurItem->asTextFrame())
3410
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3411
 
}
3412
 
 
3413
 
void PropertiesPalette::NewTBase()
3414
 
{
3415
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3416
 
                return;
3417
 
        if (CurItem->asTextFrame())
3418
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3419
 
        doc->itemSelection_SetBaselineOffset(qRound(ChBase->value() * 10));
3420
 
        if (CurItem->asTextFrame())
3421
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3422
 
}
3423
 
 
3424
 
void PropertiesPalette::setTScale(double e)
3425
 
{
3426
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3427
 
                return;
3428
 
        bool tmp = HaveItem;
3429
 
        HaveItem = false;
3430
 
        ChScale->setValue(e / 10.0);
3431
 
        HaveItem = tmp;
3432
 
}
3433
 
 
3434
 
void PropertiesPalette::setTBase(double e)
3435
 
{
3436
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3437
 
                return;
3438
 
        bool tmp = HaveItem;
3439
 
        HaveItem = false;
3440
 
        ChBase->setValue(e / 10.0);
3441
 
        HaveItem = tmp;
3442
 
}
3443
 
 
3444
 
void PropertiesPalette::NewTScale()
3445
 
{
3446
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3447
 
                return;
3448
 
        if (CurItem->asTextFrame())
3449
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3450
 
        doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
3451
 
        if (CurItem->asTextFrame())
3452
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3453
 
}
3454
 
 
3455
 
void PropertiesPalette::NewX()
3456
 
{
3457
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3458
 
                return;
3459
 
        if ((HaveDoc) && (HaveItem))
3460
 
        {
3461
 
                double x,y,w,h, gx, gy, gh, gw, base;
3462
 
                QMatrix ma;
3463
 
                x = Xpos->value() / m_unitRatio;
3464
 
                y = Ypos->value() / m_unitRatio;
3465
 
                w = Width->value() / m_unitRatio;
3466
 
                h = Height->value() / m_unitRatio;
3467
 
                base = 0;
3468
 
                x += doc->rulerXoffset;
3469
 
                y += doc->rulerYoffset;
3470
 
                if (doc->guidesSettings.rulerMode)
3471
 
                {
3472
 
                        x += doc->currentPage()->xOffset();
3473
 
                        y += doc->currentPage()->yOffset();
3474
 
                }
3475
 
                if (doc->m_Selection->isMultipleSelection())
3476
 
                {
3477
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3478
 
                        int bp = RotationGroup->checkedId();
3479
 
                        if ((bp == 0) || (bp == 3))
3480
 
                                base = gx;
3481
 
                        else if (bp == 2)
3482
 
                                base = gx + gw / 2.0;
3483
 
                        else if ((bp == 1) || (bp == 4))
3484
 
                                base = gx + gw;
3485
 
                        if (!_userActionOn)
3486
 
                                m_ScMW->view->startGroupTransaction();
3487
 
                        doc->moveGroup(x - base, 0, true);
3488
 
                        if (!_userActionOn)
3489
 
                        {
3490
 
                                m_ScMW->view->endGroupTransaction();
3491
 
                        }
3492
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3493
 
                        setXY(gx, gy);
3494
 
                }
3495
 
                else
3496
 
                {
3497
 
                        if ((CurItem->asLine()) && (LMode))
3498
 
                        {
3499
 
                                w += doc->rulerXoffset;
3500
 
                                h += doc->rulerYoffset;
3501
 
                                if (doc->guidesSettings.rulerMode)
3502
 
                                {
3503
 
                                        w += doc->currentPage()->xOffset();
3504
 
                                        h += doc->currentPage()->yOffset();
3505
 
                                }
3506
 
                                double r = atan2(h-y,w-x)*(180.0/M_PI);
3507
 
                                w = sqrt(pow(w-x,2)+pow(h-y,2));
3508
 
//                              doc->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
3509
 
                                CurItem->setXYPos(x, CurItem->yPos(), true);
3510
 
                                CurItem->setRotation(r, true);
3511
 
                                doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3512
 
//                              doc->RotateItem(r, CurItem->ItemNr);
3513
 
                        }
3514
 
                        else
3515
 
                        {
3516
 
                                ma.translate(CurItem->xPos(), CurItem->yPos());
3517
 
                                ma.rotate(CurItem->rotation());
3518
 
                                int bp = RotationGroup->checkedId();
3519
 
                                if (bp == 0)
3520
 
                                        base = CurItem->xPos();
3521
 
                                else if (bp == 2)
3522
 
                                        base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
3523
 
                                else if (bp == 1)
3524
 
                                        base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
3525
 
                                else if (bp == 4)
3526
 
                                        base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
3527
 
                                else if (bp == 3)
3528
 
                                        base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
3529
 
                                doc->MoveItem(x - base, 0, CurItem, true);
3530
 
                        }
3531
 
                }
3532
 
                doc->regionsChanged()->update(QRect());
3533
 
                emit DocChanged();
3534
 
        }
3535
 
}
3536
 
 
3537
 
void PropertiesPalette::NewY()
3538
 
{
3539
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3540
 
                return;
3541
 
 
3542
 
        double x,y,w,h, gx, gy, gh, gw, base;
3543
 
        QMatrix ma;
3544
 
        x = Xpos->value() / m_unitRatio;
3545
 
        y = Ypos->value() / m_unitRatio;
3546
 
        w = Width->value() / m_unitRatio;
3547
 
        h = Height->value() / m_unitRatio;
3548
 
        base = 0;
3549
 
        x += doc->rulerXoffset;
3550
 
        y += doc->rulerYoffset;
3551
 
        if (doc->guidesSettings.rulerMode)
3552
 
        {
3553
 
                x += doc->currentPage()->xOffset();
3554
 
                y += doc->currentPage()->yOffset();
3555
 
        }
3556
 
        if (doc->m_Selection->isMultipleSelection())
3557
 
        {
3558
 
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3559
 
                int bp = RotationGroup->checkedId();
3560
 
                if ((bp == 0) || (bp == 1))
3561
 
                        base = gy;
3562
 
                else if (bp == 2)
3563
 
                        base = gy + gh / 2.0;
3564
 
                else if ((bp == 3) || (bp == 4))
3565
 
                        base = gy + gh;
3566
 
                if (!_userActionOn)
3567
 
                        m_ScMW->view->startGroupTransaction();
3568
 
                doc->moveGroup(0, y - base, true);
3569
 
                if (!_userActionOn)
3570
 
                {
3571
 
                        m_ScMW->view->endGroupTransaction();
3572
 
                }
3573
 
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3574
 
                setXY(gx, gy);
3575
 
        }
3576
 
        else
3577
 
        {
3578
 
                if ((CurItem->asLine()) && (LMode))
3579
 
                {
3580
 
                        w += doc->rulerXoffset;
3581
 
                        h += doc->rulerYoffset;
3582
 
                        if (doc->guidesSettings.rulerMode)
3583
 
                        {
3584
 
                                w += doc->currentPage()->xOffset();
3585
 
                                h += doc->currentPage()->yOffset();
3586
 
                        }
3587
 
                        double r = atan2(h-y,w-x)*(180.0/M_PI);
3588
 
                        w = sqrt(pow(w-x,2)+pow(h-y,2));
3589
 
                        doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
3590
 
                        CurItem->setXYPos(CurItem->xPos(), y, true);
3591
 
                        CurItem->setRotation(r, true);
3592
 
                        doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
3593
 
                        doc->RotateItem(r, CurItem->ItemNr);
3594
 
                }
3595
 
                else
3596
 
                {
3597
 
                        ma.translate(CurItem->xPos(), CurItem->yPos());
3598
 
                        ma.rotate(CurItem->rotation());
3599
 
                        int bp = RotationGroup->checkedId();
3600
 
                        if (bp == 0)
3601
 
                                base = CurItem->yPos();
3602
 
                        else if (bp == 2)
3603
 
                                base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
3604
 
                        else if (bp == 1)
3605
 
                                base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
3606
 
                        else if (bp == 4)
3607
 
                                base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
3608
 
                        else if (bp == 3)
3609
 
                                base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
3610
 
                        doc->MoveItem(0, y - base, CurItem, true);
3611
 
                }
3612
 
        }
3613
 
        doc->regionsChanged()->update(QRect());
3614
 
        emit DocChanged();
3615
 
}
3616
 
 
3617
 
void PropertiesPalette::NewW()
3618
 
{
3619
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3620
 
                return;
3621
 
        
3622
 
        double x,y,w,h, gx, gy, gh, gw;
3623
 
        x = Xpos->value() / m_unitRatio;
3624
 
        y = Ypos->value() / m_unitRatio;
3625
 
        w = Width->value() / m_unitRatio;
3626
 
        h = Height->value() / m_unitRatio;
3627
 
        if (doc->m_Selection->isMultipleSelection())
3628
 
        {
3629
 
                if (!_userActionOn)
3630
 
                        m_ScMW->view->startGroupTransaction();
3631
 
                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3632
 
                if (keepFrameWHRatioButton->isChecked())
3633
 
                {
3634
 
//                      m_ScMW->view->frameResizeHandle = 1;
3635
 
                        doc->scaleGroup(w / gw, w / gw, false);
3636
 
                        setBH(w, (w / gw) * gh);
3637
 
                }
3638
 
                else
3639
 
                {
3640
 
//                      m_ScMW->view->frameResizeHandle = 6;
3641
 
                        doc->scaleGroup(w / gw, 1.0, false);
3642
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3643
 
                        setBH(gw, gh);
3644
 
                }
3645
 
                if (!_userActionOn)
3646
 
                {
3647
 
                        m_ScMW->view->endGroupTransaction();
3648
 
                }
3649
 
        }
3650
 
        else
3651
 
        {
3652
 
                bool oldS = CurItem->Sizing;
3653
 
                CurItem->Sizing = false;
3654
 
                CurItem->OldB2 = CurItem->width();
3655
 
                CurItem->OldH2 = CurItem->height();
3656
 
                if (CurItem->asLine())
3657
 
                {
3658
 
                        if (LMode)
3659
 
                        {
3660
 
                                double r = atan2(h-y,w-x)*(180.0/M_PI);
3661
 
                                CurItem->setRotation(r, true);
3662
 
                                w = sqrt(pow(w-x,2)+pow(h-y,2));
3663
 
                        }
3664
 
                        doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3665
 
                }
3666
 
                else
3667
 
                {
3668
 
                        double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
3669
 
                        if (CurItem->isTableItem)
3670
 
                        {
3671
 
                                int rmo = doc->RotMode;
3672
 
                                doc->RotMode = 0;
3673
 
                                double dist = w - CurItem->width();
3674
 
                                PageItem* bb2;
3675
 
                                PageItem* bb = CurItem;
3676
 
                                while (bb->TopLink != 0)
3677
 
                                {
3678
 
                                        bb = bb->TopLink;
3679
 
                                }
3680
 
                                while (bb->BottomLink != 0)
3681
 
                                {
3682
 
                                        bb2 = bb;
3683
 
                                        while (bb2->RightLink != 0)
3684
 
                                        {
3685
 
                                                doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
3686
 
                                                bb2 = bb2->RightLink;
3687
 
                                        }
3688
 
                                        doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
3689
 
                                        bb = bb->BottomLink;
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
 
                                doc->RotMode = rmo;
3699
 
                                if (keepFrameWHRatioButton->isChecked())
3700
 
                                {
3701
 
                                        keepFrameWHRatioButton->setChecked(false);
3702
 
                                        setBH(w, (w / oldW) * CurItem->height());
3703
 
                                        NewH();
3704
 
                                        keepFrameWHRatioButton->setChecked(true);
3705
 
                                }
3706
 
                        }
3707
 
                        else
3708
 
                        {
3709
 
                                if (keepFrameWHRatioButton->isChecked())
3710
 
                                {
3711
 
                                        setBH(w, (w / oldW) * CurItem->height());
3712
 
                                        doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
3713
 
                                }
3714
 
                                else
3715
 
                                        doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3716
 
                        }
3717
 
                }
3718
 
                CurItem->Sizing = oldS;
3719
 
        }
3720
 
        emit DocChanged();
3721
 
        doc->regionsChanged()->update(QRect());
3722
 
}
3723
 
 
3724
 
void PropertiesPalette::NewH()
3725
 
{
3726
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3727
 
                return;
3728
 
        if ((HaveDoc) && (HaveItem))
3729
 
        {
3730
 
                double x,y,w,h, gx, gy, gh, gw;
3731
 
                x = Xpos->value() / m_unitRatio;
3732
 
                y = Ypos->value() / m_unitRatio;
3733
 
                w = Width->value() / m_unitRatio;
3734
 
                h = Height->value() / m_unitRatio;
3735
 
                if (doc->m_Selection->isMultipleSelection())
3736
 
                {
3737
 
                        if (!_userActionOn)
3738
 
                                m_ScMW->view->startGroupTransaction();
3739
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3740
 
                        if (keepFrameWHRatioButton->isChecked())
3741
 
                        {
3742
 
//                              m_ScMW->view->frameResizeHandle = 1;
3743
 
                                doc->scaleGroup(h / gh, h / gh, false);
3744
 
                                setBH((h / gh) * gw, h);
3745
 
                        }
3746
 
                        else
3747
 
                        {
3748
 
//                              m_ScMW->view->frameResizeHandle = 5;
3749
 
                                doc->scaleGroup(1.0, h / gh, false);
3750
 
                                doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3751
 
                                setBH(gw, gh);
3752
 
                        }
3753
 
                        if (!_userActionOn)
3754
 
                        {
3755
 
                                m_ScMW->view->endGroupTransaction();
3756
 
                        }
3757
 
                }
3758
 
                else
3759
 
                {
3760
 
                        bool oldS = CurItem->Sizing;
3761
 
                        CurItem->Sizing = false;
3762
 
                        CurItem->OldB2 = CurItem->width();
3763
 
                        CurItem->OldH2 = CurItem->height();
3764
 
                        if (CurItem->asLine())
3765
 
                        {
3766
 
                                if (LMode)
3767
 
                                {
3768
 
                                        double r = atan2(h-y,w-x)*(180.0/M_PI);
3769
 
                                        CurItem->setRotation(r, true);
3770
 
                                        w = sqrt(pow(w-x,2)+pow(h-y,2));
3771
 
                                }
3772
 
                                doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
3773
 
                        }
3774
 
                        else
3775
 
                        {
3776
 
                                double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
3777
 
                                if (CurItem->isTableItem)
3778
 
                                {
3779
 
                                        int rmo = doc->RotMode;
3780
 
                                        doc->RotMode = 0;
3781
 
                                        double dist = h - CurItem->height();
3782
 
                                        PageItem* bb2;
3783
 
                                        PageItem* bb = CurItem;
3784
 
                                        while (bb->LeftLink != 0)
3785
 
                                        {
3786
 
                                                bb = bb->LeftLink;
3787
 
                                        }
3788
 
                                        while (bb->RightLink != 0)
3789
 
                                        {
3790
 
                                                bb2 = bb;
3791
 
                                                while (bb2->BottomLink != 0)
3792
 
                                                {
3793
 
                                                        doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
3794
 
                                                        bb2 = bb2->BottomLink;
3795
 
                                                }
3796
 
                                                doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
3797
 
                                                bb = bb->RightLink;
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
 
                                        doc->RotMode = rmo;
3807
 
                                        if (keepFrameWHRatioButton->isChecked())
3808
 
                                        {
3809
 
                                                keepFrameWHRatioButton->setChecked(false);
3810
 
                                                setBH((h / oldH) * CurItem->width(), h);
3811
 
                                                NewW();
3812
 
                                                keepFrameWHRatioButton->setChecked(true);
3813
 
                                        }
3814
 
                                }
3815
 
                                else
3816
 
                                {
3817
 
                                        if (keepFrameWHRatioButton->isChecked())
3818
 
                                        {
3819
 
                                                setBH((h / oldH) * CurItem->width(), h);
3820
 
                                                doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
3821
 
                                        }
3822
 
                                        else
3823
 
                                                doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
3824
 
                                }
3825
 
                        }
3826
 
                        CurItem->Sizing = oldS;
3827
 
                }
3828
 
                emit DocChanged();
3829
 
                doc->regionsChanged()->update(QRect());
3830
 
        }
3831
 
}
3832
 
 
3833
 
void PropertiesPalette::setRotation()
3834
 
{
3835
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3836
 
                return;
3837
 
        double gx, gy, gh, gw;
3838
 
        if ((HaveDoc) && (HaveItem))
3839
 
        {
3840
 
                if (!_userActionOn)
3841
 
                        m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
3842
 
                if (doc->m_Selection->isMultipleSelection())
3843
 
                {
3844
 
                        doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
3845
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
3846
 
                        setXY(gx, gy);
3847
 
                }
3848
 
                else
3849
 
                        doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
3850
 
                if (!_userActionOn)
3851
 
                {
3852
 
                        for (int i = 0; i < doc->m_Selection->count(); ++i)
3853
 
                                doc->m_Selection->itemAt(i)->checkChanges(true);
3854
 
                        m_ScMW->view->endGroupTransaction();
3855
 
                }
3856
 
                emit DocChanged();
3857
 
                doc->regionsChanged()->update(QRect());
3858
 
                RoVal = Rotation->value();
3859
 
        }
3860
 
}
3861
 
 
3862
 
void PropertiesPalette::NewCornerRadius()
3863
 
{
3864
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3865
 
                return;
3866
 
        CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
3867
 
        m_ScMW->view->SetFrameRounded();
3868
 
        emit DocChanged();
3869
 
        doc->regionsChanged()->update(QRect());
3870
 
}
3871
 
 
3872
 
void PropertiesPalette::NewLineSpacing()
3873
 
{
3874
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3875
 
                return;
3876
 
        if (CurItem->asTextFrame())
3877
 
        {
3878
 
//              CurItem->asTextFrame()->ExpandParSel();
3879
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
3880
 
//              CurItem->asTextFrame()->lastAction4Paragraph = true;
3881
 
        }
3882
 
        doc->itemSelection_SetLineSpacing(LineSp->value());
3883
 
        if (CurItem->asTextFrame())
3884
 
                CurItem->asTextFrame()->updateUndo();
3885
 
}
3886
 
 
3887
 
void PropertiesPalette::HandleGapSwitch()
3888
 
{
3889
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3890
 
                return;
3891
 
        setCols(CurItem->Cols, CurItem->ColGap);
3892
 
        dGap->setToolTip("");
3893
 
//      if (colgapLabel->getState())
3894
 
        if (colgapLabel->currentIndex() == 0)
3895
 
                dGap->setToolTip( tr( "Distance between columns" ) );
3896
 
        else
3897
 
                dGap->setToolTip( tr( "Column width" ) );
3898
 
}
3899
 
 
3900
 
void PropertiesPalette::NewCols()
3901
 
{
3902
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3903
 
                return;
3904
 
        CurItem->Cols = DCol->value();
3905
 
        setCols(CurItem->Cols, CurItem->ColGap);
3906
 
        CurItem->update();
3907
 
        emit DocChanged();
3908
 
}
3909
 
 
3910
 
void PropertiesPalette::NewPage()
3911
 
{
3912
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3913
 
                return;
3914
 
        bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
3915
 
        CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
3916
 
        if (reallynew)
3917
 
                CurItem->loadImage(CurItem->externalFile(), true);
3918
 
        CurItem->update();
3919
 
}
3920
 
 
3921
 
void PropertiesPalette::NewGap()
3922
 
{
3923
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3924
 
                return;
3925
 
        if (colgapLabel->currentIndex() == 0)
3926
 
                CurItem->ColGap = dGap->value() / m_unitRatio;
3927
 
        else
3928
 
        {
3929
 
                double lineCorr;
3930
 
                if (CurItem->lineColor() != CommonStrings::None)
3931
 
                        lineCorr = CurItem->lineWidth();
3932
 
                else
3933
 
                        lineCorr = 0;
3934
 
                double newWidth = dGap->value() / m_unitRatio;
3935
 
                double newGap = qMax(((CurItem->width() - CurItem->textToFrameDistLeft() - CurItem->textToFrameDistRight() - lineCorr) - (newWidth * CurItem->Cols)) / (CurItem->Cols - 1), 0.0);
3936
 
                CurItem->ColGap = newGap;
3937
 
        }
3938
 
        CurItem->update();
3939
 
        emit DocChanged();
3940
 
}
3941
 
 
3942
 
void PropertiesPalette::NewSize()
3943
 
{
3944
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3945
 
                return;
3946
 
        if (CurItem->asTextFrame())
3947
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3948
 
        doc->itemSelection_SetFontSize(qRound(Size->value()*10.0));
3949
 
        if (CurItem->asTextFrame())
3950
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3951
 
}
3952
 
 
3953
 
void PropertiesPalette::NewTracking()
3954
 
{
3955
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3956
 
                return;
3957
 
        if (CurItem->asTextFrame())
3958
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
3959
 
        doc->itemSelection_SetTracking(qRound(Extra->value() * 10.0));
3960
 
        if (CurItem->asTextFrame())
3961
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
3962
 
}
3963
 
 
3964
 
void PropertiesPalette::NewLocalXY()
3965
 
{
3966
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
3967
 
                return;
3968
 
        doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3969
 
}
3970
 
 
3971
 
void PropertiesPalette::NewLocalSC()
3972
 
{
3973
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3974
 
                return;
3975
 
        if ((HaveDoc) && (HaveItem))
3976
 
        {
3977
 
                /*doc->itemSelection_SetImageScale(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0);
3978
 
                doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
3979
 
                */
3980
 
                //CB Dont pass in the scale to the offset change as its taken from the new scale
3981
 
                doc->itemSelection_SetImageScaleAndOffset(imageXScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.xres * 72.0, imageYScaleSpinBox->value() / 100.0 / CurItem->pixm.imgInfo.yres * 72.0, imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
3982
 
                disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3983
 
                disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3984
 
                imgDpiX->setValue(qRound(720.0 / CurItem->imageXScale()) / 10.0);
3985
 
                imgDpiY->setValue(qRound(720.0 / CurItem->imageYScale()) / 10.0);
3986
 
                connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
3987
 
                connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
3988
 
        }
3989
 
}
3990
 
 
3991
 
void PropertiesPalette::NewLocalDpi()
3992
 
{
3993
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
3994
 
                return;
3995
 
        if ((HaveDoc) && (HaveItem))
3996
 
        {
3997
 
                /*
3998
 
                doc->itemSelection_SetImageScale(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value());
3999
 
                doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
4000
 
                */
4001
 
                //CB Dont pass in the scale to the offset change as its taken from the new scale
4002
 
                doc->itemSelection_SetImageScaleAndOffset(72.0 / imgDpiX->value(), 72.0 / imgDpiY->value(), imageXOffsetSpinBox->value() / m_unitRatio, imageYOffsetSpinBox->value() / m_unitRatio);
4003
 
                disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4004
 
                disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4005
 
                imageXScaleSpinBox->setValue(CurItem->imageXScale() * 100 / 72.0 * CurItem->pixm.imgInfo.xres);
4006
 
                imageYScaleSpinBox->setValue(CurItem->imageYScale() * 100 / 72.0 * CurItem->pixm.imgInfo.yres);
4007
 
                connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4008
 
                connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4009
 
        }
4010
 
}
4011
 
 
4012
 
void PropertiesPalette::handleImageEffects()
4013
 
{
4014
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4015
 
                return;
4016
 
        m_ScMW->ImageEffects();
4017
 
}
4018
 
 
4019
 
void PropertiesPalette::handleExtImgProperties()
4020
 
{
4021
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4022
 
                return;
4023
 
        m_ScMW->view->editExtendedImageProperties();
4024
 
        emit DocChanged();
4025
 
}
4026
 
 
4027
 
void PropertiesPalette::NewLineWidth()
4028
 
{
4029
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4030
 
                return;
4031
 
        if ((HaveDoc) && (HaveItem))
4032
 
        {
4033
 
                double oldL = CurItem->lineWidth();
4034
 
                doc->itemSelection_SetLineWidth(LSize->value() / m_unitRatio);
4035
 
                if (CurItem->dashes().count() != 0)
4036
 
                {
4037
 
                        if ((oldL != 0.0) && (CurItem->lineWidth() != 0.0))
4038
 
                        {
4039
 
                                for (int a = 0; a < CurItem->DashValues.count(); a++)
4040
 
                                {
4041
 
                                        CurItem->DashValues[a] = CurItem->DashValues[a] / oldL * CurItem->lineWidth();
4042
 
                                }
4043
 
                                CurItem->setDashOffset(CurItem->dashOffset() / oldL * CurItem->lineWidth());
4044
 
                        }
4045
 
                        if (CurItem->lineWidth() != 0.0)
4046
 
                        {
4047
 
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4048
 
                                dashEditor->setEnabled(true);
4049
 
                        }
4050
 
                        else
4051
 
                                dashEditor->setEnabled(false);
4052
 
                }
4053
 
//              emit DocChanged();
4054
 
        }
4055
 
}
4056
 
 
4057
 
void PropertiesPalette::setStartArrow(int id)
4058
 
{
4059
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4060
 
                return;
4061
 
        doc->itemSelection_ApplyArrowHead(id,-1);
4062
 
}
4063
 
 
4064
 
void PropertiesPalette::setEndArrow(int id)
4065
 
{
4066
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4067
 
                return;
4068
 
        if ((HaveDoc) && (HaveItem))
4069
 
                doc->itemSelection_ApplyArrowHead(-1, id);
4070
 
}
4071
 
 
4072
 
void PropertiesPalette::NewLineStyle()
4073
 
{
4074
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4075
 
                return;
4076
 
        if ((HaveDoc) && (HaveItem))
4077
 
        {
4078
 
                if (LStyle->currentIndex() == 37)
4079
 
                {
4080
 
                        if (CurItem->dashes().count() == 0)
4081
 
                        {
4082
 
                                if ((CurItem->lineStyle() == 0) || (CurItem->lineStyle() == 1))
4083
 
                                {
4084
 
                                        CurItem->DashValues.append(4.0 * qMax(CurItem->lineWidth(), 1.0));
4085
 
                                        CurItem->DashValues.append(2.0 * qMax(CurItem->lineWidth(), 1.0));
4086
 
                                }
4087
 
                                else
4088
 
                                        getDashArray(CurItem->lineStyle(), qMax(CurItem->lineWidth(), 1.0), CurItem->DashValues);
4089
 
                        }
4090
 
                        if (CurItem->lineWidth() != 0.0)
4091
 
                                dashEditor->setDashValues(CurItem->dashes(), CurItem->lineWidth(), CurItem->dashOffset());
4092
 
                        else
4093
 
                        {
4094
 
                                dashEditor->setEnabled(false);
4095
 
                                dashEditor->setDashValues(CurItem->dashes(), 1.0, CurItem->dashOffset());
4096
 
                        }
4097
 
                        dashEditor->show();
4098
 
                        CurItem->update();
4099
 
                }
4100
 
                else
4101
 
                {
4102
 
                        CurItem->DashValues.clear();
4103
 
                        dashEditor->hide();
4104
 
                        doc->itemSelection_SetLineArt(static_cast<Qt::PenStyle>(LStyle->currentIndex()+1));
4105
 
                }
4106
 
        }
4107
 
}
4108
 
 
4109
 
void PropertiesPalette::dashChange()
4110
 
{
4111
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4112
 
                return;
4113
 
        if ((HaveDoc) && (HaveItem))
4114
 
        {
4115
 
                if (CurItem->lineWidth() != 0.0)
4116
 
                {
4117
 
                        CurItem->setDashes(dashEditor->getDashValues(CurItem->lineWidth()));
4118
 
                        CurItem->setDashOffset(dashEditor->Offset->value() * CurItem->lineWidth());
4119
 
                }
4120
 
                CurItem->update();
4121
 
                emit DocChanged();
4122
 
        }
4123
 
}
4124
 
 
4125
 
void PropertiesPalette::NewLineMode()
4126
 
{
4127
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4128
 
                return;
4129
 
        if (LineMode->currentIndex() == 0)
4130
 
        {
4131
 
                xposLabel->setText( tr( "&X-Pos:" ) );
4132
 
                widthLabel->setText( tr( "&Width:" ) );
4133
 
                yposLabel->setText( tr( "&Y-Pos:" ) );
4134
 
                heightLabel->setText( tr( "&Height:" ) );
4135
 
                Rotation->setEnabled(true);
4136
 
                Height->setEnabled(false);
4137
 
                LMode = false;
4138
 
        }
4139
 
        else
4140
 
        {
4141
 
                xposLabel->setText( tr( "&X1:" ) );
4142
 
                widthLabel->setText( tr( "X&2:" ) );
4143
 
                yposLabel->setText( tr( "Y&1:" ) );
4144
 
                heightLabel->setText( tr( "&Y2:" ) );
4145
 
                Rotation->setEnabled(false);
4146
 
                Height->setEnabled(true);
4147
 
                LMode = true;
4148
 
        }
4149
 
        setBH(CurItem->width(), CurItem->height());
4150
 
        updateGeometry();
4151
 
//      setFocus();
4152
 
        repaint();
4153
 
}
4154
 
 
4155
 
void PropertiesPalette::NewLineJoin()
4156
 
{
4157
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4158
 
                return;
4159
 
        Qt::PenJoinStyle c = Qt::MiterJoin;
4160
 
        switch (LJoinStyle->currentIndex())
4161
 
        {
4162
 
        case 0:
4163
 
                c = Qt::MiterJoin;
4164
 
                break;
4165
 
        case 1:
4166
 
                c = Qt::BevelJoin;
4167
 
                break;
4168
 
        case 2:
4169
 
                c = Qt::RoundJoin;
4170
 
                break;
4171
 
        }
4172
 
        if ((HaveDoc) && (HaveItem))
4173
 
                doc->itemSelection_SetLineJoin(c);
4174
 
}
4175
 
 
4176
 
void PropertiesPalette::NewLineEnd()
4177
 
{
4178
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4179
 
                return;
4180
 
        Qt::PenCapStyle c = Qt::FlatCap;
4181
 
        switch (LEndStyle->currentIndex())
4182
 
        {
4183
 
        case 0:
4184
 
                c = Qt::FlatCap;
4185
 
                break;
4186
 
        case 1:
4187
 
                c = Qt::SquareCap;
4188
 
                break;
4189
 
        case 2:
4190
 
                c = Qt::RoundCap;
4191
 
                break;
4192
 
        }
4193
 
        if ((HaveDoc) && (HaveItem))
4194
 
                doc->itemSelection_SetLineEnd(c);
4195
 
}
4196
 
 
4197
 
void PropertiesPalette::ToggleKette()
4198
 
{
4199
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4200
 
                return;
4201
 
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4202
 
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4203
 
        if (keepImageWHRatioButton->isChecked())
4204
 
        {
4205
 
                imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4206
 
                NewLocalSC();
4207
 
                keepImageDPIRatioButton->setChecked(true);
4208
 
        }
4209
 
        else
4210
 
                keepImageDPIRatioButton->setChecked(false);
4211
 
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4212
 
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4213
 
}
4214
 
 
4215
 
void PropertiesPalette::HChange()
4216
 
{
4217
 
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4218
 
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4219
 
        if (keepImageWHRatioButton->isChecked())
4220
 
                imageYScaleSpinBox->setValue(imageXScaleSpinBox->value());
4221
 
        NewLocalSC();
4222
 
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4223
 
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4224
 
}
4225
 
 
4226
 
void PropertiesPalette::VChange()
4227
 
{
4228
 
        disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4229
 
        disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4230
 
        if (keepImageWHRatioButton->isChecked())
4231
 
                imageXScaleSpinBox->setValue(imageYScaleSpinBox->value());
4232
 
        NewLocalSC();
4233
 
        connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
4234
 
        connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
4235
 
}
4236
 
 
4237
 
void PropertiesPalette::ToggleKetteD()
4238
 
{
4239
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4240
 
                return;
4241
 
        disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4242
 
        disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4243
 
        if (keepImageDPIRatioButton->isChecked())
4244
 
        {
4245
 
                imgDpiY->setValue(imgDpiX->value());
4246
 
                NewLocalDpi();
4247
 
                keepImageWHRatioButton->setChecked(true);
4248
 
        }
4249
 
        else
4250
 
                keepImageWHRatioButton->setChecked(false);
4251
 
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4252
 
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4253
 
}
4254
 
 
4255
 
void PropertiesPalette::HChangeD()
4256
 
{
4257
 
        disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4258
 
        disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4259
 
        if (keepImageDPIRatioButton->isChecked())
4260
 
                imgDpiY->setValue(imgDpiX->value());
4261
 
        NewLocalDpi();
4262
 
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4263
 
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4264
 
}
4265
 
 
4266
 
void PropertiesPalette::VChangeD()
4267
 
{
4268
 
        disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4269
 
        disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4270
 
        if (keepImageDPIRatioButton->isChecked())
4271
 
                imgDpiX->setValue(imgDpiY->value());
4272
 
        NewLocalDpi();
4273
 
        connect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
4274
 
        connect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
4275
 
}
4276
 
 
4277
 
void PropertiesPalette::NewAlignement(int a)
4278
 
{
4279
 
        int selStart = 0, selEnd = 0, selLength = 0;
4280
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4281
 
                return;
4282
 
        if (CurItem->asTextFrame())
4283
 
        {
4284
 
                // hack for apply left align for text with no align at all
4285
 
                //so during Undo/Redo some align will be applied
4286
 
                StoryText& itemText(CurItem->itemText);
4287
 
                if (doc->appMode == modeEdit)
4288
 
                {
4289
 
                        //selected parapgraph(s) only
4290
 
                        selStart = (itemText.lengthOfSelection() > 0) ? itemText.startOfSelection() : CurItem->CPos;
4291
 
                        selEnd   = (itemText.lengthOfSelection() > 0) ? itemText.endOfSelection() : CurItem->CPos;
4292
 
                        selStart = itemText.startOfParagraph( itemText.nrOfParagraph(selStart) );
4293
 
                        selEnd   = itemText.endOfParagraph  ( itemText.nrOfParagraph(selEnd) );
4294
 
                }
4295
 
                else
4296
 
                {
4297
 
                        //for whole frame
4298
 
                        selStart = itemText.startOfParagraph( 0 );
4299
 
                        selEnd   = itemText.endOfParagraph  ( itemText.nrOfParagraph(itemText.lastInFrame()) );
4300
 
                }
4301
 
                selLength = qMin(selEnd - selStart + 1, itemText.length() - selStart);
4302
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(selStart, selLength);
4303
 
//              CurItem->asTextFrame()->lastAction4Paragraph = true;
4304
 
        }
4305
 
        doc->itemSelection_SetAlignment(a);
4306
 
        if (CurItem->asTextFrame())
4307
 
                CurItem->asTextFrame()->updateUndo();
4308
 
}
4309
 
 
4310
 
void PropertiesPalette::setTypeStyle(int s)
4311
 
{
4312
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4313
 
                return;
4314
 
        if (CurItem->asTextFrame())
4315
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4316
 
        emit NewEffects(s);
4317
 
        if (CurItem->asTextFrame())
4318
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4319
 
}
4320
 
 
4321
 
void PropertiesPalette::newShadowOffs()
4322
 
{
4323
 
        if ((HaveDoc) && (HaveItem))
4324
 
        {
4325
 
                if (CurItem->asTextFrame())
4326
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4327
 
                int x = qRound(SeStyle->ShadowVal->Xoffset->value() * 10.0);
4328
 
                int y = qRound(SeStyle->ShadowVal->Yoffset->value() * 10.0);
4329
 
                doc->itemSelection_SetShadowOffsets(x, y);
4330
 
                if (CurItem->asTextFrame())
4331
 
                        CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4332
 
        }
4333
 
}
4334
 
 
4335
 
void PropertiesPalette::setShadowOffs(double x, double y)
4336
 
{
4337
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4338
 
                return;
4339
 
        disconnect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4340
 
        disconnect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4341
 
        SeStyle->ShadowVal->Xoffset->setValue(x / 10.0);
4342
 
        SeStyle->ShadowVal->Yoffset->setValue(y / 10.0);
4343
 
        connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4344
 
        connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
4345
 
}
4346
 
 
4347
 
void PropertiesPalette::newUnderline()
4348
 
{
4349
 
        if ((HaveDoc) && (HaveItem))
4350
 
        {
4351
 
                if (CurItem->asTextFrame())
4352
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4353
 
                int x = qRound(SeStyle->UnderlineVal->LPos->value() * 10.0);
4354
 
                int y = qRound(SeStyle->UnderlineVal->LWidth->value() * 10.0);
4355
 
                doc->itemSelection_SetUnderline(x, y);
4356
 
                if (CurItem->asTextFrame())
4357
 
                        CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4358
 
        }
4359
 
}
4360
 
 
4361
 
void PropertiesPalette::setUnderline(double p, double w)
4362
 
{
4363
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4364
 
                return;
4365
 
        disconnect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4366
 
        disconnect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4367
 
        SeStyle->UnderlineVal->LPos->setValue(p / 10.0);
4368
 
        SeStyle->UnderlineVal->LWidth->setValue(w / 10.0);
4369
 
        connect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4370
 
        connect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
4371
 
}
4372
 
 
4373
 
void PropertiesPalette::newStrike()
4374
 
{
4375
 
        if ((HaveDoc) && (HaveItem))
4376
 
        {
4377
 
                if (CurItem->asTextFrame())
4378
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4379
 
                int x = qRound(SeStyle->StrikeVal->LPos->value() * 10.0);
4380
 
                int y = qRound(SeStyle->StrikeVal->LWidth->value() * 10.0);
4381
 
                doc->itemSelection_SetStrikethru(x, y);
4382
 
                if (CurItem->asTextFrame())
4383
 
                        CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4384
 
        }
4385
 
}
4386
 
 
4387
 
void PropertiesPalette::setStrike(double p, double w)
4388
 
{
4389
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4390
 
                return;
4391
 
        disconnect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4392
 
        disconnect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4393
 
        SeStyle->StrikeVal->LPos->setValue(p / 10.0);
4394
 
        SeStyle->StrikeVal->LWidth->setValue(w / 10.0);
4395
 
        connect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4396
 
        connect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
4397
 
}
4398
 
 
4399
 
void PropertiesPalette::setOutlineW(double x)
4400
 
{
4401
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4402
 
                return;
4403
 
        disconnect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4404
 
        SeStyle->OutlineVal->LWidth->setValue(x / 10.0);
4405
 
        connect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
4406
 
}
4407
 
 
4408
 
void PropertiesPalette::newOutlineW()
4409
 
{
4410
 
        int x = qRound(SeStyle->OutlineVal->LWidth->value() * 10.0);
4411
 
        if ((HaveDoc) && (HaveItem))
4412
 
        {
4413
 
                if (CurItem->asTextFrame())
4414
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4415
 
                doc->itemSelection_SetOutlineWidth(x);
4416
 
                if (CurItem->asTextFrame())
4417
 
                        CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4418
 
        }
4419
 
}
4420
 
 
4421
 
void PropertiesPalette::DoLower()
4422
 
{
4423
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4424
 
                return;
4425
 
        m_ScMW->view->LowerItem();
4426
 
}
4427
 
 
4428
 
void PropertiesPalette::DoRaise()
4429
 
{
4430
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4431
 
                return;
4432
 
        m_ScMW->view->RaiseItem();
4433
 
}
4434
 
 
4435
 
void PropertiesPalette::DoFront()
4436
 
{
4437
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4438
 
                return;
4439
 
        m_ScMW->view->ToFront();
4440
 
}
4441
 
 
4442
 
void PropertiesPalette::DoBack()
4443
 
{
4444
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4445
 
                return;
4446
 
        m_ScMW->view->ToBack();
4447
 
}
4448
 
 
4449
 
void PropertiesPalette::NewRotMode(int m)
4450
 
{
4451
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4452
 
                return;
4453
 
        double inX, inY, gx, gy, gh, gw;
4454
 
        inX = 0;
4455
 
        inY = 0;
4456
 
        if ((HaveDoc) && (HaveItem))
4457
 
        {
4458
 
                HaveItem = false;
4459
 
                doc->RotMode = m;
4460
 
                if (doc->m_Selection->isMultipleSelection())
4461
 
                {
4462
 
                        doc->m_Selection->setGroupRect();
4463
 
                        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
4464
 
                        if (m == 0)
4465
 
                        {
4466
 
                                m_ScMW->view->RCenter = FPoint(gx, gy);
4467
 
                                inX = gx;
4468
 
                                inY = gy;
4469
 
                        }
4470
 
                        if (m == 1)
4471
 
                        {
4472
 
                                m_ScMW->view->RCenter = FPoint(gx+gw, gy);
4473
 
                                inX = gx+gw;
4474
 
                                inY = gy;
4475
 
                        }
4476
 
                        if (m == 2)
4477
 
                        {
4478
 
                                m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
4479
 
                                inX = gx + gw / 2.0;
4480
 
                                inY = gy + gh / 2.0;
4481
 
                        }
4482
 
                        if (m == 3)
4483
 
                        {
4484
 
                                m_ScMW->view->RCenter = FPoint(gx, gy+gh);
4485
 
                                inX = gx;
4486
 
                                inY = gy+gh;
4487
 
                        }
4488
 
                        if (m == 4)
4489
 
                        {
4490
 
                                m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
4491
 
                                inX = gx+gw;
4492
 
                                inY = gy+gh;
4493
 
                        }
4494
 
                        inX -= doc->rulerXoffset;
4495
 
                        inY -= doc->rulerYoffset;
4496
 
                        if (doc->guidesSettings.rulerMode)
4497
 
                        {
4498
 
                                inX -= doc->currentPage()->xOffset();
4499
 
                                inY -= doc->currentPage()->yOffset();
4500
 
                        }
4501
 
                        Xpos->setValue(inX*m_unitRatio);
4502
 
                        Ypos->setValue(inY*m_unitRatio);
4503
 
                }
4504
 
                else
4505
 
                {
4506
 
                        double b, h, r;
4507
 
                        QMatrix ma;
4508
 
                        FPoint n;
4509
 
                        b = CurItem->width();
4510
 
                        h = CurItem->height();
4511
 
                        r = CurItem->rotation();
4512
 
//                      ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getYOffsetForPage(CurItem->OwnPage));
4513
 
                        ma.translate(CurItem->xPos(), CurItem->yPos());
4514
 
                        ma.rotate(r);
4515
 
                        int bp = RotationGroup->checkedId();
4516
 
                        if (bp == 0)
4517
 
                                n = FPoint(0.0, 0.0);
4518
 
                        else if (bp == 1)
4519
 
                                n = FPoint(b, 0.0);
4520
 
                        else if (bp == 2)
4521
 
                                n = FPoint(b / 2.0, h / 2.0);
4522
 
                        else if (bp == 3)
4523
 
                                n = FPoint(0.0, h);
4524
 
                        else if (bp == 4)
4525
 
                                n = FPoint(b, h);
4526
 
                        inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
4527
 
                        inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
4528
 
                        inX -= doc->rulerXoffset;
4529
 
                        inY -= doc->rulerYoffset;
4530
 
                        if (doc->guidesSettings.rulerMode)
4531
 
                        {
4532
 
                                inX -= doc->currentPage()->xOffset();
4533
 
                                inY -= doc->currentPage()->yOffset();
4534
 
                        }
4535
 
                        Xpos->setValue(inX*m_unitRatio);
4536
 
                        Ypos->setValue(inY*m_unitRatio);
4537
 
                }
4538
 
                if (CurItem->itemType() == PageItem::ImageFrame)
4539
 
                {
4540
 
                        if (!FreeScale->isChecked())
4541
 
                        {
4542
 
                                CurItem->AdjustPictScale();
4543
 
                                CurItem->update();
4544
 
                                disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4545
 
                                disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4546
 
                                imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
4547
 
                                imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
4548
 
                                connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4549
 
                                connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
4550
 
                                emit DocChanged();
4551
 
                        }
4552
 
                }
4553
 
                HaveItem = true;
4554
 
        }
4555
 
}
4556
 
 
4557
 
void PropertiesPalette::DoFlow()
4558
 
{
4559
 
        PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
4560
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4561
 
                return;
4562
 
        if ((HaveDoc) && (HaveItem))
4563
 
        {
4564
 
                if (CurItem->isGroupControl)
4565
 
                {
4566
 
                        if (textFlowDisabled2->isChecked())
4567
 
                                mode = PageItem::TextFlowDisabled;
4568
 
                        if (textFlowUsesFrameShape2->isChecked())
4569
 
                                mode = PageItem::TextFlowUsesFrameShape;
4570
 
                        if (textFlowUsesBoundingBox2->isChecked())
4571
 
                                mode = PageItem::TextFlowUsesBoundingBox;
4572
 
                        if (textFlowUsesContourLine2->isChecked())
4573
 
                                mode = PageItem::TextFlowUsesContourLine;
4574
 
                        if (textFlowUsesImageClipping2->isChecked())
4575
 
                                mode = PageItem::TextFlowUsesImageClipping;
4576
 
                }
4577
 
                else
4578
 
                {
4579
 
                        if (textFlowDisabled->isChecked())
4580
 
                                mode = PageItem::TextFlowDisabled;
4581
 
                        if (textFlowUsesFrameShape->isChecked())
4582
 
                                mode = PageItem::TextFlowUsesFrameShape;
4583
 
                        if (textFlowUsesBoundingBox->isChecked())
4584
 
                                mode = PageItem::TextFlowUsesBoundingBox;
4585
 
                        if (textFlowUsesContourLine->isChecked())
4586
 
                                mode = PageItem::TextFlowUsesContourLine;
4587
 
                        if (textFlowUsesImageClipping->isChecked())
4588
 
                                mode = PageItem::TextFlowUsesImageClipping;
4589
 
                }
4590
 
                CurItem->setTextFlowMode(mode);
4591
 
                m_ScMW->view->DrawNew();
4592
 
                emit DocChanged();
4593
 
        }
4594
 
}
4595
 
 
4596
 
void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
4597
 
{
4598
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4599
 
                return;
4600
 
        if ((HaveDoc) && (HaveItem))
4601
 
        {
4602
 
                if ((CurItem->itemType() == PageItem::PolyLine) || (CurItem->itemType() == PageItem::PathText))
4603
 
                        return;
4604
 
 
4605
 
                if (UndoManager::undoEnabled())
4606
 
                {
4607
 
                        // Store shape info in this form:
4608
 
                        // CHANGE_SHAPE_TYPE - ID of the undo operation
4609
 
                        // OLD_FRAME_TYPE - original frame type
4610
 
                        // NEW_FRAME_TYPE - change of frame type
4611
 
                        // binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
4612
 
                        ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
4613
 
                        is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
4614
 
                        is->set("OLD_FRAME_TYPE", CurItem->FrameType);
4615
 
                        is->set("NEW_FRAME_TYPE", f);
4616
 
                        // HACK: this is propably Evil Code (TM). I have to find better way...
4617
 
                        FPointArray newShape;
4618
 
                        int ix = 0;
4619
 
                        for (int i = 0; i < c/2; ++i)
4620
 
                        {
4621
 
                                double x = CurItem->width() * vals[ix] / 100.0;
4622
 
                                double y = CurItem->height() * vals[ix+1] / 100.0;
4623
 
                                newShape.addPoint(x, y);
4624
 
                                ix += 2;
4625
 
                        }
4626
 
                        // HACK: end of hack
4627
 
                        is->setItem(qMakePair(CurItem->shape(), newShape));
4628
 
                        UndoManager::instance()->action(CurItem, is);
4629
 
                }
4630
 
 
4631
 
                switch (f)
4632
 
                {
4633
 
                case 0:
4634
 
                        CurItem->SetRectFrame();
4635
 
                        doc->setRedrawBounding(CurItem);
4636
 
                        break;
4637
 
                case 1:
4638
 
                        CurItem->SetOvalFrame();
4639
 
                        doc->setRedrawBounding(CurItem);
4640
 
                        break;
4641
 
                default:
4642
 
                        CurItem->SetFrameShape(c, vals);
4643
 
                        doc->setRedrawBounding(CurItem);
4644
 
                        CurItem->FrameType = f+2;
4645
 
                        break;
4646
 
                }
4647
 
//qt4           m_ScMW->SCustom->setPixmap(m_ScMW->SCustom->getIconPixmap(f));
4648
 
                CurItem->update();
4649
 
                emit DocChanged();
4650
 
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
4651
 
                {
4652
 
                        RoundRect->setEnabled(f == 0);
4653
 
                        return;
4654
 
                }
4655
 
                CurItem->convertTo(PageItem::Polygon);
4656
 
                NewSel(6);
4657
 
                RoundRect->setEnabled(f == 0);
4658
 
//              TabStack->setCurrentIndex(1);
4659
 
        }
4660
 
}
4661
 
 
4662
 
void PropertiesPalette::handleShapeEdit()
4663
 
{
4664
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4665
 
                return;
4666
 
        if ((HaveDoc) && (HaveItem))
4667
 
        {
4668
 
                tmpSelection->clear();
4669
 
                m_ScMW->view->requestMode(modeEditClip);
4670
 
                RoundRect->setEnabled(false);
4671
 
        }
4672
 
}
4673
 
 
4674
 
void PropertiesPalette::NewTDist()
4675
 
{
4676
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4677
 
                return;
4678
 
        if ((HaveDoc) && (HaveItem))
4679
 
        {
4680
 
                CurItem->setTextToFrameDist(DLeft->value() / m_unitRatio, DRight->value() / m_unitRatio, DTop->value() / m_unitRatio, DBottom->value() / m_unitRatio);
4681
 
                setCols(CurItem->Cols, CurItem->ColGap);
4682
 
                CurItem->update();
4683
 
                emit DocChanged();
4684
 
        }
4685
 
}
4686
 
 
4687
 
void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2)
4688
 
{
4689
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4690
 
                return;
4691
 
        if ((HaveDoc) && (HaveItem))
4692
 
        {
4693
 
                CurItem->GrStartX = x1 / m_unitRatio;
4694
 
                CurItem->GrStartY = y1 / m_unitRatio;
4695
 
                CurItem->GrEndX = x2 / m_unitRatio;
4696
 
                CurItem->GrEndY = y2 / m_unitRatio;
4697
 
                CurItem->update();
4698
 
                QRectF upRect(QPointF(CurItem->GrStartX, CurItem->GrStartY), QPointF(CurItem->GrEndX, CurItem->GrEndY));
4699
 
                upRect.translate(CurItem->xPos(), CurItem->yPos());
4700
 
                doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0));
4701
 
                emit DocChanged();
4702
 
        }
4703
 
}
4704
 
 
4705
 
void PropertiesPalette::toggleGradientEdit()
4706
 
{
4707
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4708
 
                return;
4709
 
        if ((HaveDoc) && (HaveItem))
4710
 
        {
4711
 
                if (Cpal->gradEditButton->isChecked())
4712
 
                        m_ScMW->view->requestMode(modeEditGradientVectors);
4713
 
                else
4714
 
                        m_ScMW->view->requestMode(modeNormal);
4715
 
                m_ScMW->view->RefreshGradient(CurItem);
4716
 
        }
4717
 
}
4718
 
 
4719
 
void PropertiesPalette::NewTFont(QString c)
4720
 
{
4721
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4722
 
                return;
4723
 
        emit NewFont(c);
4724
 
}
4725
 
 
4726
 
void PropertiesPalette::DoRevert()
4727
 
{
4728
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4729
 
                return;
4730
 
        bool setter=Revert->isChecked();
4731
 
        CurItem->setImageFlippedH(setter);
4732
 
        CurItem->setReversed(setter);
4733
 
        CurItem->update();
4734
 
        emit DocChanged();
4735
 
}
4736
 
 
4737
 
 
4738
 
void PropertiesPalette::doClearCStyle()
4739
 
{
4740
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4741
 
                return;
4742
 
        if (HaveDoc)
4743
 
        {
4744
 
                if (CurItem->asTextFrame())
4745
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4746
 
                doc->itemSelection_EraseCharStyle();
4747
 
                if (CurItem->asTextFrame())
4748
 
                        CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit? PageItem::PARAMSEL : PageItem::PARAMFULL);
4749
 
        }
4750
 
}
4751
 
 
4752
 
 
4753
 
void PropertiesPalette::doClearPStyle()
4754
 
{
4755
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4756
 
                return;
4757
 
        if (HaveDoc)
4758
 
        {
4759
 
                if (CurItem->asTextFrame())
4760
 
                {
4761
 
//                      CurItem->asTextFrame()->ExpandParSel();
4762
 
                        CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
4763
 
//                      CurItem->asTextFrame()->lastAction4Paragraph = true;
4764
 
                }
4765
 
                doc->itemSelection_EraseParagraphStyle();
4766
 
                CharStyle emptyCStyle;
4767
 
                doc->itemSelection_SetCharStyle(emptyCStyle);
4768
 
                if (CurItem->asTextFrame())
4769
 
                        CurItem->asTextFrame()->updateUndo(doc->appMode == modeEdit ? PageItem::PARAMSEL : PageItem::PARAMFULL);
4770
 
        }
4771
 
}
4772
 
 
4773
 
 
4774
 
void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
4775
 
{
4776
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4777
 
                return;
4778
 
        disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4779
 
        StyledLine->clear();
4780
 
        if (dd != 0)
4781
 
        {
4782
 
                QMap<QString,multiLine>::Iterator it;
4783
 
                for (it = dd->MLineStyles.begin(); it != dd->MLineStyles.end(); ++it)
4784
 
                        StyledLine->addItem( new LineFormatItem(dd, it.value(), it.key()) );
4785
 
                StyledLine->sortItems();
4786
 
                StyledLine->insertItem( 0, tr("No Style"));
4787
 
                if (StyledLine->currentItem())
4788
 
                        StyledLine->currentItem()->setSelected(false);
4789
 
        }
4790
 
        connect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
4791
 
}
4792
 
 
4793
 
void PropertiesPalette::SetSTline(QListWidgetItem *c)
4794
 
{
4795
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4796
 
                return;
4797
 
        if (c == NULL)
4798
 
                return;
4799
 
        bool setter = (c->listWidget()->currentRow() == 0);
4800
 
        doc->itemSelection_SetNamedLineStyle(setter ? QString("") : c->text());
4801
 
        LStyle->setEnabled(setter);
4802
 
        LSize->setEnabled(setter);
4803
 
        LJoinStyle->setEnabled(setter);
4804
 
        LEndStyle->setEnabled(setter);
4805
 
}
4806
 
 
4807
 
void PropertiesPalette::updateColorList()
4808
 
{
4809
 
        if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
4810
 
                return;
4811
 
        Cpal->SetColors(doc->PageColors);
4812
 
        Cpal->SetPatterns(&doc->docPatterns);
4813
 
        assert (doc->PageColors.document());
4814
 
        TxFill->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, true);
4815
 
        TxStroke->updateBox(doc->PageColors, ColorCombo::fancyPixmaps, false);
4816
 
        TxFill->view()->setMinimumWidth(TxFill->view()->maximumViewportSize().width() + 24);
4817
 
        TxStroke->view()->setMinimumWidth(TxStroke->view()->maximumViewportSize().width() + 24);
4818
 
}
4819
 
 
4820
 
void PropertiesPalette::updateCmsList()
4821
 
{
4822
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4823
 
                return;
4824
 
        if (HaveDoc)
4825
 
        {
4826
 
                if (ScCore->haveCMS() && doc->CMSSettings.CMSinUse)
4827
 
                        GroupBoxCM->show();
4828
 
                else
4829
 
                {
4830
 
                        GroupBoxCM->hide();
4831
 
                        return;
4832
 
                }
4833
 
                disconnect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4834
 
                disconnect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4835
 
                InputP->clear();
4836
 
                if (HaveItem)
4837
 
                {
4838
 
                        if (CurItem->pixm.imgInfo.colorspace == ColorSpaceCMYK)
4839
 
                        {
4840
 
                                ProfilesL::Iterator itP;
4841
 
                                ProfilesL::Iterator itPend=ScCore->InputProfilesCMYK.end();
4842
 
                                for (itP = ScCore->InputProfilesCMYK.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->InputProfilesCMYK.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
 
                        else
4860
 
                        {
4861
 
                                ProfilesL::Iterator itP;
4862
 
                                ProfilesL::Iterator itPend=ScCore->InputProfiles.end();
4863
 
                                for (itP = ScCore->InputProfiles.begin(); itP != itPend; ++itP)
4864
 
                                {
4865
 
                                        InputP->addItem(itP.key());
4866
 
                                        if (itP.key() == CurItem->IProfile)
4867
 
                                                InputP->setCurrentIndex(InputP->count()-1);
4868
 
                                }
4869
 
                                if (!ScCore->InputProfiles.contains(CurItem->IProfile))
4870
 
                                {
4871
 
                                        InputP->addItem(CurItem->IProfile);
4872
 
                                        InputP->setCurrentIndex(InputP->count()-1);
4873
 
                                }
4874
 
                                else
4875
 
                                {
4876
 
                                        if (!CurItem->EmProfile.isEmpty())
4877
 
                                                InputP->addItem(CurItem->EmProfile);
4878
 
                                }
4879
 
                        }
4880
 
                        MonitorI->setCurrentIndex(CurItem->IRender);
4881
 
                }
4882
 
                connect(MonitorI, SIGNAL(activated(int)), this, SLOT(ChangeIntent()));
4883
 
                connect(InputP, SIGNAL(activated(const QString&)), this, SLOT(ChangeProfile(const QString&)));
4884
 
        }
4885
 
}
4886
 
 
4887
 
void PropertiesPalette::ChangeProfile(const QString& prn)
4888
 
{
4889
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4890
 
                return;
4891
 
        doc->itemSelection_SetColorProfile(InputP->currentText());
4892
 
}
4893
 
 
4894
 
void PropertiesPalette::ChangeIntent()
4895
 
{
4896
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4897
 
                return;
4898
 
        doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
4899
 
}
4900
 
 
4901
 
void PropertiesPalette::ShowCMS()
4902
 
{
4903
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
4904
 
                return;
4905
 
        if (HaveItem)
4906
 
                updateCmsList();
4907
 
        else
4908
 
                GroupBoxCM->setVisible(ScCore->haveCMS() && doc->CMSSettings.CMSinUse);
4909
 
}
4910
 
 
4911
 
void PropertiesPalette::newTxtFill()
4912
 
{
4913
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4914
 
                return;
4915
 
        if (CurItem->asTextFrame())
4916
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4917
 
        doc->itemSelection_SetFillColor(TxFill->currentColor());
4918
 
        if (CurItem->asTextFrame())
4919
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4920
 
}
4921
 
 
4922
 
void PropertiesPalette::newTxtStroke()
4923
 
{
4924
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4925
 
                return;
4926
 
        if (CurItem->asTextFrame())
4927
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4928
 
        doc->itemSelection_SetStrokeColor(TxStroke->currentColor());
4929
 
        if (CurItem->asTextFrame())
4930
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4931
 
 
4932
 
}
4933
 
 
4934
 
void PropertiesPalette::setActShade()
4935
 
{
4936
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4937
 
                return;
4938
 
        int b;
4939
 
        if (CurItem->asTextFrame())
4940
 
                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::SELECTION : PageItem::FRAME);
4941
 
        if (PM1 == sender())
4942
 
        {
4943
 
                b = PM1->getValue();
4944
 
                doc->itemSelection_SetStrokeShade(b);
4945
 
        }
4946
 
        else
4947
 
        {
4948
 
                b = PM2->getValue();
4949
 
                doc->itemSelection_SetFillShade(b);
4950
 
        }
4951
 
        if (CurItem->asTextFrame())
4952
 
                CurItem->asTextFrame()->updateUndo(CurItem->HasSel? PageItem::PARAMSEL : PageItem::PARAMFULL);
4953
 
}
4954
 
 
4955
 
void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
4956
 
{
4957
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4958
 
                return;
4959
 
        ColorList::Iterator it;
4960
 
        int c = 0;
4961
 
        PM2->setValue(qRound(shb));
4962
 
        PM1->setValue(qRound(shp));
4963
 
        if ((b != CommonStrings::None) && (!b.isEmpty()))
4964
 
        {
4965
 
                c++;
4966
 
                for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4967
 
                {
4968
 
                        if (it.key() == b)
4969
 
                                break;
4970
 
                        c++;
4971
 
                }
4972
 
        }
4973
 
        TxFill->setCurrentIndex(c);
4974
 
        c = 0;
4975
 
        if ((p != CommonStrings::None) && (!p.isEmpty()))
4976
 
        {
4977
 
//              c++;
4978
 
                for (it = doc->PageColors.begin(); it != doc->PageColors.end(); ++it)
4979
 
                {
4980
 
                        if (it.key() == p)
4981
 
                                break;
4982
 
                        c++;
4983
 
                }
4984
 
        }
4985
 
        TxStroke->setCurrentIndex(c);
4986
 
}
4987
 
 
4988
 
void PropertiesPalette::handleLock()
4989
 
{
4990
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4991
 
                return;
4992
 
        m_ScMW->scrActions["itemLock"]->toggle();
4993
 
}
4994
 
 
4995
 
void PropertiesPalette::handleLockSize()
4996
 
{
4997
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
4998
 
                return;
4999
 
        m_ScMW->scrActions["itemLockSize"]->toggle();
5000
 
}
5001
 
 
5002
 
void PropertiesPalette::handlePrint()
5003
 
{
5004
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5005
 
                return;
5006
 
        m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
5007
 
}
5008
 
 
5009
 
void PropertiesPalette::handleFlipH()
5010
 
{
5011
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5012
 
                return;
5013
 
        m_ScMW->scrActions["itemFlipH"]->toggle();
5014
 
        /*
5015
 
        if ((HaveDoc) && (HaveItem))
5016
 
        {
5017
 
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5018
 
                        doc->FlipImageH();
5019
 
                else
5020
 
                        doc->MirrorPolyH();
5021
 
                emit DocChanged();
5022
 
        }
5023
 
        */
5024
 
}
5025
 
 
5026
 
void PropertiesPalette::handleFlipV()
5027
 
{
5028
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
5029
 
                return;
5030
 
        m_ScMW->scrActions["itemFlipV"]->toggle();
5031
 
        /*
5032
 
        if ((HaveDoc) && (HaveItem))
5033
 
        {
5034
 
                if ((CurItem->itemType() == PageItem::ImageFrame) || (CurItem->itemType() == PageItem::TextFrame))
5035
 
                        doc->FlipImageV();
5036
 
                else
5037
 
                        doc->MirrorPolyV();
5038
 
                emit DocChanged();
5039
 
        }
5040
 
        */
5041
 
}
5042
 
 
5043
 
 
5044
 
void PropertiesPalette::handlePathType()
5045
 
{
5046
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5047
 
                return;
5048
 
        CurItem->textPathType = pathTextType->currentIndex();
5049
 
        CurItem->update();
5050
 
        emit DocChanged();
5051
 
}
5052
 
 
5053
 
void PropertiesPalette::handlePathFlip()
5054
 
{
5055
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5056
 
                return;
5057
 
        CurItem->textPathFlipped = flippedPathText->isChecked();
5058
 
        CurItem->updatePolyClip();
5059
 
        CurItem->update();
5060
 
        emit DocChanged();
5061
 
}
5062
 
 
5063
 
void PropertiesPalette::handlePathLine()
5064
 
{
5065
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5066
 
                return;
5067
 
        CurItem->PoShow = showcurveCheckBox->isChecked();
5068
 
        CurItem->update();
5069
 
        emit DocChanged();
5070
 
}
5071
 
 
5072
 
void PropertiesPalette::handlePathDist()
5073
 
{
5074
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5075
 
                return;
5076
 
        CurItem->setTextToFrameDistLeft(Dist->value());
5077
 
        doc->AdjustItemSize(CurItem);
5078
 
        CurItem->updatePolyClip();
5079
 
        CurItem->update();
5080
 
        emit DocChanged();
5081
 
}
5082
 
 
5083
 
void PropertiesPalette::handlePathOffs()
5084
 
{
5085
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5086
 
                return;
5087
 
        CurItem->BaseOffs = -LineW->value();
5088
 
        doc->AdjustItemSize(CurItem);
5089
 
        CurItem->updatePolyClip();
5090
 
        CurItem->update();
5091
 
        emit DocChanged();
5092
 
}
5093
 
 
5094
 
void PropertiesPalette::handleFillRule()
5095
 
{
5096
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5097
 
                return;
5098
 
        CurItem->fillRule = EvenOdd->isChecked();
5099
 
        CurItem->update();
5100
 
        qDebug() << "PropertiesPalette::handleFillRule() updateUNDO";
5101
 
        if (CurItem->asTextFrame())
5102
 
                CurItem->asTextFrame()->updateUndo();
5103
 
 
5104
 
        emit DocChanged();
5105
 
}
5106
 
 
5107
 
void PropertiesPalette::handleOverprint()
5108
 
{
5109
 
        if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
5110
 
                return;
5111
 
        doc->itemSelection_SetOverprint(Overprint->isChecked());
5112
 
}
5113
 
 
5114
 
void PropertiesPalette::NewName()
5115
 
{
5116
 
        if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5117
 
                return;
5118
 
        QString NameOld = CurItem->itemName();
5119
 
        QString NameNew = NameEdit->text();
5120
 
        if (NameNew.isEmpty())
5121
 
        {
5122
 
                NameEdit->setText(NameOld);
5123
 
                return;
5124
 
        }
5125
 
        bool found = false;
5126
 
        for (int b = 0; b < doc->Items->count(); ++b)
5127
 
        {
5128
 
                if ((NameNew == doc->Items->at(b)->itemName()) && (doc->Items->at(b) != CurItem))
5129
 
                {
5130
 
                        found = true;
5131
 
                        break;
5132
 
                }
5133
 
        }
5134
 
        if (found)
5135
 
        {
5136
 
                QMessageBox::warning(this, CommonStrings::trWarning, "<qt>"+ tr("Name \"%1\" isn't unique.<br/>Please choose another.").arg(NameNew)+"</qt>", CommonStrings::tr_OK);
5137
 
                NameEdit->setText(NameOld);
5138
 
                NameEdit->setFocus();
5139
 
        }
5140
 
        else
5141
 
        {
5142
 
                if (CurItem->itemName() != NameEdit->text())
5143
 
                {
5144
 
                        CurItem->setItemName(NameEdit->text());
5145
 
                        emit DocChanged();
5146
 
                }
5147
 
        }
5148
 
}
5149
 
 
5150
 
void PropertiesPalette::fillLangCombo(QMap<QString,QString> langMap)
5151
 
{
5152
 
        QStringList sortList;
5153
 
        QMap<QString,QString>::Iterator it;
5154
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
5155
 
                return;
5156
 
        langCombo->clear();
5157
 
        for (it = langMap.begin(); it != langMap.end(); ++it)
5158
 
                sortList.push_back(it.value());
5159
 
        langCombo->addItems(sortQStringList(sortList));
5160
 
        QListView *tmpView = dynamic_cast<QListView*>(langCombo->view()); Q_ASSERT(tmpView);
5161
 
        int tmpWidth = tmpView->sizeHintForColumn(0);
5162
 
        if (tmpWidth > 0)
5163
 
                tmpView->setMinimumWidth(tmpWidth + 24);
5164
 
}
5165
 
 
5166
 
void PropertiesPalette::NewLanguage()
5167
 
{
5168
 
        if ((HaveDoc) && (HaveItem))
5169
 
        {
5170
 
                CurItem->doc()->Language = (m_ScMW->GetLang(langCombo->currentText()));
5171
 
                emit DocChanged();
5172
 
        }
5173
 
}
5174
 
 
5175
 
void PropertiesPalette::ManageTabs()
5176
 
{
5177
 
        if ((HaveDoc) && (HaveItem))
5178
 
        {
5179
 
                PageItem_TextFrame *i2=CurItem->asTextFrame();
5180
 
                if (i2==0)
5181
 
                        return;
5182
 
                const ParagraphStyle& style(doc->appMode == modeEdit ? i2->currentStyle() : i2->itemText.defaultStyle());
5183
 
                TabManager *dia = new TabManager(this, doc->unitIndex(), style.tabValues(), i2->columnWidth());
5184
 
                if (dia->exec())
5185
 
                {
5186
 
                        if (CurItem->asTextFrame())
5187
 
                        {
5188
 
                                CurItem->itemTextSaxed = CurItem->getItemTextSaxed(doc->appMode == modeEdit? PageItem::PARAGRAPH : PageItem::FRAME);
5189
 
//                              CurItem->asTextFrame()->lastAction4Paragraph = true;
5190
 
                        }
5191
 
                        if (doc->appMode != modeEdit)
5192
 
                        {
5193
 
                                ParagraphStyle newStyle(CurItem->itemText.defaultStyle());
5194
 
                                newStyle.setTabValues(dia->tmpTab);
5195
 
                                CurItem->itemText.setDefaultStyle(newStyle);
5196
 
                        }
5197
 
                        else
5198
 
                        {
5199
 
                                ParagraphStyle newStyle;
5200
 
                                newStyle.setTabValues(dia->tmpTab);
5201
 
                                doc->itemSelection_ApplyParagraphStyle(newStyle);
5202
 
                        }
5203
 
                        CurItem->update();
5204
 
                        if (CurItem->asTextFrame())
5205
 
                                CurItem->asTextFrame()->updateUndo();
5206
 
 
5207
 
                        emit DocChanged();
5208
 
                }
5209
 
                delete dia;
5210
 
        }
5211
 
}
5212
 
 
5213
 
void PropertiesPalette::HandleTLines()
5214
 
{
5215
 
        if ((HaveDoc) && (HaveItem))
5216
 
        {
5217
 
                CurItem->TopLine = TopLine->isChecked();
5218
 
                CurItem->LeftLine = LeftLine->isChecked();
5219
 
                CurItem->RightLine = RightLine->isChecked();
5220
 
                CurItem->BottomLine = BottomLine->isChecked();
5221
 
                CurItem->update();
5222
 
                emit DocChanged();
5223
 
        }
5224
 
}
5225
 
 
5226
 
void PropertiesPalette::installSniffer(ScrSpinBox *spinBox)
5227
 
{
5228
 
        const QList<QObject*> list = spinBox->children();
5229
 
        if (!list.isEmpty())
5230
 
        {
5231
 
                QListIterator<QObject*> it(list);
5232
 
                QObject *obj;
5233
 
                while (it.hasNext())
5234
 
                {
5235
 
                        obj = it.next();
5236
 
                        obj->installEventFilter(userActionSniffer);
5237
 
                }
5238
 
        }
5239
 
}
5240
 
 
5241
 
bool PropertiesPalette::userActionOn()
5242
 
{
5243
 
        return _userActionOn;
5244
 
}
5245
 
 
5246
 
void PropertiesPalette::spinboxStartUserAction()
5247
 
{
5248
 
//      qDebug("%s", "sniffer: spinbox start action");
5249
 
        _userActionOn = true;
5250
 
}
5251
 
 
5252
 
void PropertiesPalette::spinboxFinishUserAction()
5253
 
{
5254
 
//      qDebug("%s", "sniffer: spinbox finish action");
5255
 
        _userActionOn = false;
5256
 
 
5257
 
        for (int i = 0; i < doc->m_Selection->count(); ++i)
5258
 
                doc->m_Selection->itemAt(i)->checkChanges(true);
5259
 
        if (m_ScMW->view->groupTransactionStarted())
5260
 
        {
5261
 
                m_ScMW->view->endGroupTransaction();
5262
 
        }
5263
 
}
5264
 
 
5265
 
void PropertiesPalette::changeEvent(QEvent *e)
5266
 
{
5267
 
        if (e->type() == QEvent::LanguageChange)
5268
 
        {
5269
 
                languageChange();
5270
 
        }
5271
 
        else
5272
 
                QWidget::changeEvent(e);
5273
 
}
5274
 
 
5275
 
void PropertiesPalette::languageChange()
5276
 
{
5277
 
        setWindowTitle( tr("Properties"));
5278
 
 
5279
 
        TabStack->setItemText(idXYZItem, tr("X, Y, &Z"));
5280
 
        TabStack->setItemText(idTextItem, tr("&Text"));
5281
 
        TabStack->setItemText(idImageItem, tr("&Image"));
5282
 
        TabStack->setItemText(idShapeItem, tr("&Shape"));
5283
 
        TabStack->setItemText(idLineItem, tr("&Line"));
5284
 
        TabStack->setItemText(idColorsItem, tr("&Colors"));
5285
 
        TabStack->setItemText(idGroupItem, tr("&Group"));
5286
 
 
5287
 
        NameGroup->setTitle( tr("Name"));
5288
 
        GeoGroup->setTitle( tr("Geometry"));
5289
 
        xposLabel->setText( tr("&X-Pos:"));
5290
 
        yposLabel->setText( tr("&Y-Pos:"));
5291
 
        widthLabel->setText( tr("&Width:"));
5292
 
        heightLabel->setText( tr("&Height:"));
5293
 
        rotationLabel->setText( tr("&Rotation:"));
5294
 
        basepointLabel->setText( tr("Basepoint:"));
5295
 
        LayerGroup->setTitle( tr("Level"));
5296
 
        SRect->setText( tr("Shape:"));
5297
 
//      EditShape->setText( tr("&Edit Shape..."));
5298
 
//      EditShape2->setText( tr("&Edit Shape..."));
5299
 
        EditShape->setText( tr("&Edit..."));
5300
 
        EditShape2->setText( tr("&Edit..."));
5301
 
        SRect2->setText( tr("Shape:"));
5302
 
        TransGroup->setTitle( tr( "Transparency Settings" ));
5303
 
        TransTxt->setText( tr( "Opacity:" ) );
5304
 
        TransTxt2->setText( tr( "Blend Mode:" ) );
5305
 
        int oldBlendMode = blendMode->currentIndex();
5306
 
        blendMode->clear();
5307
 
        blendMode->addItem( tr("Normal"));
5308
 
        blendMode->addItem( tr("Darken"));
5309
 
        blendMode->addItem( tr("Lighten"));
5310
 
        blendMode->addItem( tr("Multiply"));
5311
 
        blendMode->addItem( tr("Screen"));
5312
 
        blendMode->addItem( tr("Overlay"));
5313
 
        blendMode->addItem( tr("Hard Light"));
5314
 
        blendMode->addItem( tr("Soft Light"));
5315
 
        blendMode->addItem( tr("Difference"));
5316
 
        blendMode->addItem( tr("Exclusion"));
5317
 
        blendMode->addItem( tr("Color Dodge"));
5318
 
        blendMode->addItem( tr("Color Burn"));
5319
 
        blendMode->addItem( tr("Hue"));
5320
 
        blendMode->addItem( tr("Saturation"));
5321
 
        blendMode->addItem( tr("Color"));
5322
 
        blendMode->setCurrentIndex(oldBlendMode);
5323
 
        rndcornersLabel->setText( tr("R&ound\nCorners:"));
5324
 
        columnsLabel->setText( tr("Colu&mns:"));
5325
 
        int oldcolgapLabel = colgapLabel->currentIndex();
5326
 
        colgapLabel->clear();
5327
 
        colgapLabel->addItem( tr("Gap:"));
5328
 
        colgapLabel->addItem( tr("Width:"));
5329
 
        colgapLabel->setCurrentIndex(oldcolgapLabel);
5330
 
//      colgapLabel->setTexts( tr("&Gap:"), tr("&Width:"));
5331
 
        topLabel->setText( tr("To&p:"));
5332
 
        bottomLabel->setText( tr("&Bottom:"));
5333
 
        leftLabel->setText( tr("&Left:"));
5334
 
        rightLabel->setText( tr("&Right:"));
5335
 
        TabsButton->setText( tr("T&abulators..."));
5336
 
//      Distance2->setTitle( tr("Path Text Properties"));
5337
 
        int oldPathType = pathTextType->currentIndex();
5338
 
        pathTextType->clear();
5339
 
        pathTextType->addItem( tr("Default"));
5340
 
        pathTextType->addItem( tr("Stair Step"));
5341
 
        pathTextType->addItem( tr("Skew"));
5342
 
        pathTextType->setCurrentIndex(oldPathType);
5343
 
        flippedPathText->setText( tr("Flip Text"));
5344
 
        showcurveCheckBox->setText( tr("Show Curve"));
5345
 
        pathTextTypeLabel->setText( tr("Type:"));
5346
 
        startoffsetLabel->setText( tr("Start Offset:"));
5347
 
        distfromcurveLabel->setText( tr("Distance from Curve:"));
5348
 
        Distance3->setTitle( tr("Fill Rule"));
5349
 
        EvenOdd->setText( tr("Even-Odd"));
5350
 
        NonZero->setText( tr("Non Zero"));
5351
 
        textFlowOptions->setTitle( tr("Text &Flow Around Frame"));
5352
 
        textFlowDisabled->setText( tr("Disabled"));
5353
 
        textFlowUsesFrameShape->setText( tr("Use Frame &Shape"));
5354
 
        textFlowUsesBoundingBox->setText( tr("Use &Bounding Box"));
5355
 
        textFlowUsesContourLine->setText( tr("&Use Contour Line"));
5356
 
        textFlowUsesImageClipping->setText( tr("Use Image Clip Path"));
5357
 
        textFlowOptions2->setTitle( tr("Text &Flow Around Frame"));
5358
 
        textFlowDisabled2->setText( tr("Disabled"));
5359
 
        textFlowUsesFrameShape2->setText( tr("Use Frame &Shape"));
5360
 
        textFlowUsesBoundingBox2->setText( tr("Use &Bounding Box"));
5361
 
        textFlowUsesContourLine2->setText( tr("&Use Contour Line"));
5362
 
        textFlowUsesImageClipping2->setText( tr("Use Image Clip Path"));
5363
 
        paraStyleLabel->setText( tr("Paragraph St&yle:"));
5364
 
        charStyleLabel->setText( tr("Character St&yle:"));
5365
 
//      int c=optMarginCombo->currentIndex();
5366
 
//      optMarginCombo->clear();
5367
 
//      optMarginCombo->addItem( CommonStrings::trOpticalMarginsNone );
5368
 
////    Out for 1.3.4
5369
 
////    optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftProtruding );
5370
 
////    optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightProtruding );
5371
 
////    optMarginCombo->insertItem( CommonStrings::trOpticalMarginsLeftHangPunct );
5372
 
////    optMarginCombo->insertItem( CommonStrings::trOpticalMarginsRightHangPunct );
5373
 
//      optMarginCombo->addItem( CommonStrings::trOpticalMarginsDefault );
5374
 
//      optMarginCombo->setCurrentIndex(c);
5375
 
//      optMarginCheckLeftProtruding->setText( tr("Left Protruding") );
5376
 
//      optMarginCheckRightProtruding->setText( tr("Right Protruding") );
5377
 
//      optMarginCheckLeftHangPunct->setText( tr("Left Hanging Punctuation") );
5378
 
//      optMarginCheckRightHangPunct->setText( tr("Right Hanging Punctuation") );
5379
 
        optMarginRadioNone->setText( tr("None","optical margins") );
5380
 
        optMarginRadioBoth->setText( tr("Both Sides","optical margins") );
5381
 
        optMarginRadioLeft->setText( tr("Left Only","optical margins") );
5382
 
        optMarginRadioRight->setText( tr("Right Only","optical margins") );
5383
 
        optMarginResetButton->setText( tr("Reset") );
5384
 
        OptMarginsItem->setText(0, tr("Optical Margins"));
5385
 
        wordTrackingLabel->setText( tr("Word Tracking"));
5386
 
        minWordTrackingLabel->setText( tr("Min:"));
5387
 
        normWordTrackingLabel->setText( tr("Norm:"));
5388
 
        glyphExtensionLabel->setText( tr("Glyph Extension"));
5389
 
        minGlyphExtensionLabel->setText( tr("Min:"));
5390
 
        maxGlyphExtensionLabel->setText( tr("Max:"));
5391
 
        colorWidgetsItem->setText(0, tr("Color & Effects"));
5392
 
        advancedWidgetsItem->setText(0, tr("Advanced Settings"));
5393
 
        styleWidgetsItem->setText(0, tr("Style Settings"));
5394
 
        flopItem->setText(0, tr("First Line Offset"));
5395
 
        flopRealHeight->setText( tr("Maximum Ascent"));
5396
 
        flopFontAscent->setText( tr("Font Ascent"));
5397
 
        flopLineSpacing->setText( tr("Line Spacing"));
5398
 
        DistanceItem->setText(0, tr("Columns & Text Distances"));
5399
 
        Distance2Item->setText(0, tr("Path Text Properties"));
5400
 
        imagePageNumberLabel->setText( tr("&Page Number:"));
5401
 
        FreeScale->setText( tr("&Free Scaling"));
5402
 
        imgDPIXLabel->setText( tr("Actual X-DPI:"));
5403
 
        imgDPIYLabel->setText( tr("Actual Y-DPI:"));
5404
 
        xposImgLabel->setText( tr("&X-Pos:"));
5405
 
        yposImgLabel->setText( tr("&Y-Pos:"));
5406
 
        xscaleLabel->setText( tr("X-Sc&ale:"));
5407
 
        yscaleLabel->setText( tr("Y-Scal&e:"));
5408
 
        FrameScale->setText( tr("Scale &To Frame Size"));
5409
 
        Aspect->setText( tr("P&roportional"));
5410
 
        EditEffects->setText( tr("Image Effects"));
5411
 
        EditPSDProps->setText( tr("Extended Image Properties"));
5412
 
        TextCms1->setText( tr("Input Profile:"));
5413
 
        TextCms2->setText( tr("Rendering Intent:"));
5414
 
//      QList<QAction*> actList = lineSpacingPop->actions();
5415
 
//      actList[0]->setText( tr("Fixed Linespacing"));
5416
 
//      actList[1]->setText( tr("Automatic Linespacing"));
5417
 
//      actList[2]->setText( tr("Align to Baseline Grid"));
5418
 
        int oldLineSpacingMode = lineSpacingModeCombo->currentIndex();
5419
 
        lineSpacingModeCombo->clear();
5420
 
        lineSpacingModeCombo->addItem( tr("Fixed Linespacing"));
5421
 
        lineSpacingModeCombo->addItem( tr("Automatic Linespacing"));
5422
 
        lineSpacingModeCombo->addItem( tr("Align to Baseline Grid"));
5423
 
        lineSpacingModeCombo->setCurrentIndex(oldLineSpacingMode);
5424
 
        int oldMonitorI=MonitorI->currentIndex();
5425
 
        MonitorI->clear();
5426
 
        MonitorI->addItem( tr("Perceptual"));
5427
 
        MonitorI->addItem( tr("Relative Colorimetric"));
5428
 
        MonitorI->addItem( tr("Saturation"));
5429
 
        MonitorI->addItem( tr("Absolute Colorimetric"));
5430
 
        MonitorI->setCurrentIndex(oldMonitorI);
5431
 
        int oldLineStyle = LStyle->currentIndex();
5432
 
        LStyle->clear();
5433
 
        LStyle->updateList();
5434
 
        LStyle->addItem( tr("Custom"));
5435
 
        LStyle->setCurrentIndex(oldLineStyle);
5436
 
        int oldLineMode=LineMode->currentIndex();
5437
 
        LineMode->clear();
5438
 
        LineMode->addItem( tr("Left Point"));
5439
 
        LineMode->addItem( tr("End Points"));
5440
 
        LineMode->setCurrentIndex(oldLineMode);
5441
 
        LineModeT->setText( tr("&Basepoint:"));
5442
 
        linetypeLabel->setText( tr("T&ype of Line:"));
5443
 
        startArrowText->setText( tr("Start Arrow:"));
5444
 
        endArrowText->setText( tr("End Arrow:"));
5445
 
        if (HaveDoc)
5446
 
        {
5447
 
                int arrowItem=startArrow->currentIndex();
5448
 
                startArrow->rebuildList(&doc->arrowStyles);
5449
 
                startArrow->setCurrentIndex(arrowItem);
5450
 
                arrowItem=endArrow->currentIndex();
5451
 
                endArrow->rebuildList(&doc->arrowStyles);
5452
 
                endArrow->setCurrentIndex(arrowItem);
5453
 
        }
5454
 
        linewidthLabel->setText( tr("Line &Width:"));
5455
 
        edgesLabel->setText( tr("Ed&ges:"));
5456
 
        int oldLJoinStyle=LJoinStyle->currentIndex();
5457
 
        LJoinStyle->clear();
5458
 
        LJoinStyle->addItem(loadIcon("16/stroke-join-miter.png"), tr("Miter Join"));
5459
 
        LJoinStyle->addItem(loadIcon("16/stroke-join-bevel.png"), tr("Bevel Join"));
5460
 
        LJoinStyle->addItem(loadIcon("16/stroke-join-round.png"), tr("Round Join"));
5461
 
        LJoinStyle->setCurrentIndex(oldLJoinStyle);
5462
 
 
5463
 
        int oldLEndStyle=LEndStyle->currentIndex();
5464
 
        LEndStyle->clear();
5465
 
        LEndStyle->addItem(loadIcon("16/stroke-cap-butt.png"), tr("Flat Cap"));
5466
 
        LEndStyle->addItem(loadIcon("16/stroke-cap-square.png"), tr("Square Cap"));
5467
 
        LEndStyle->addItem(loadIcon("16/stroke-cap-round.png"), tr("Round Cap"));
5468
 
        LEndStyle->setCurrentIndex(oldLEndStyle);
5469
 
        endingsLabel->setText( tr("&Endings:"));
5470
 
 
5471
 
        TLines->setTitle( tr("Cell Lines"));
5472
 
        TopLine->setText( tr("Line at Top"));
5473
 
        LeftLine->setText( tr("Line at the Left"));
5474
 
        RightLine->setText( tr("Line at the Right "));
5475
 
        BottomLine->setText( tr("Line at Bottom"));
5476
 
        
5477
 
        OverP->setTitle( tr("Overprinting"));
5478
 
        KnockOut->setText( tr("Knockout"));
5479
 
        Overprint->setText( tr("Overprint"));
5480
 
 
5481
 
        QString pctSuffix=tr(" %");
5482
 
        ChBase->setSuffix(pctSuffix);
5483
 
        ChScale->setSuffix(pctSuffix);
5484
 
        ChScaleV->setSuffix(pctSuffix);
5485
 
        imageXScaleSpinBox->setSuffix(pctSuffix);
5486
 
        imageYScaleSpinBox->setSuffix(pctSuffix);
5487
 
        imgDpiX->setSuffix("");
5488
 
        imgDpiY->setSuffix("");
5489
 
        Extra->setSuffix(pctSuffix);
5490
 
        minWordTrackingSpinBox->setSuffix(pctSuffix);
5491
 
        normWordTrackingSpinBox->setSuffix(pctSuffix);
5492
 
        minGlyphExtSpinBox->setSuffix(pctSuffix);
5493
 
        maxGlyphExtSpinBox->setSuffix(pctSuffix);
5494
 
        
5495
 
        QString ptSuffix = tr(" pt");
5496
 
        Dist->setSuffix(ptSuffix);
5497
 
        LineW->setSuffix(ptSuffix);
5498
 
        Size->setSuffix(ptSuffix);
5499
 
        LineSp->setSuffix(ptSuffix);
5500
 
 
5501
 
        QString ein = (HaveDoc) ? unitGetSuffixFromIndex(doc->unitIndex()) : ptSuffix;
5502
 
 
5503
 
        LSize->setSuffix(ein);
5504
 
        LSize->setSpecialValueText( tr("Hairline"));
5505
 
        Xpos->setSuffix(ein);
5506
 
        Ypos->setSuffix(ein);
5507
 
        Width->setSuffix(ein);
5508
 
        Height->setSuffix(ein);
5509
 
        imageXOffsetSpinBox->setSuffix(ein);
5510
 
        imageYOffsetSpinBox->setSuffix(ein);
5511
 
        dGap->setSuffix(ein);
5512
 
        DLeft->setSuffix(ein);
5513
 
        DTop->setSuffix(ein);
5514
 
        DBottom->setSuffix(ein);
5515
 
        DRight->setSuffix(ein);
5516
 
        RoundRect->setSuffix(ein);
5517
 
 
5518
 
        SeStyle->languageChange();
5519
 
        GroupAlign->languageChange();
5520
 
 
5521
 
        if(StyledLine->count() > 0)
5522
 
                StyledLine->item(0)->setText( tr("No Style") );
5523
 
//      updateCList();
5524
 
//      updateCmsList();
5525
 
/* CB: doesnt look like we need to do this on languageChange anymore with qt4
5526
 
        NameEdit->setToolTip("");
5527
 
        Xpos->setToolTip("");
5528
 
        Ypos->setToolTip("");
5529
 
        Width->setToolTip("");
5530
 
        Height->setToolTip("");
5531
 
        Rotation->setToolTip("");
5532
 
        basepointLabel->setToolTip("");
5533
 
//      TopLeft->setToolTip("");
5534
 
//      TopRight->setToolTip("");
5535
 
//      BottomLeft->setToolTip("");
5536
 
//      BottomRight->setToolTip("");
5537
 
//      Center->setToolTip("");
5538
 
        FlipH->setToolTip("");
5539
 
        FlipV->setToolTip("");
5540
 
        Zup->setToolTip("");
5541
 
        ZDown->setToolTip("");
5542
 
        ZTop->setToolTip("");
5543
 
        ZBottom->setToolTip("");
5544
 
        LevelTxt->setToolTip("");
5545
 
        Locked->setToolTip("");
5546
 
        NoResize->setToolTip("");
5547
 
        NoPrint->setToolTip("");
5548
 
        textFlowOptions->setToolTip("");
5549
 
        textFlowDisabled->setToolTip("");
5550
 
        textFlowUsesFrameShape->setToolTip("");
5551
 
        textFlowUsesBoundingBox->setToolTip("");
5552
 
        textFlowUsesContourLine->setToolTip("");
5553
 
        textFlowUsesImageClipping->setToolTip("");
5554
 
        textFlowOptions2->setToolTip("");
5555
 
        textFlowDisabled2->setToolTip("");
5556
 
        textFlowUsesFrameShape2->setToolTip("");
5557
 
        textFlowUsesBoundingBox2->setToolTip("");
5558
 
        textFlowUsesContourLine2->setToolTip("");
5559
 
        textFlowUsesImageClipping2->setToolTip("");
5560
 
 
5561
 
        //Fonts->setToolTip("");
5562
 
        Size->setToolTip("");
5563
 
        ChBase->setToolTip("");
5564
 
        ChScale->setToolTip("");
5565
 
        ChScaleV->setToolTip("");
5566
 
        TxStroke->setToolTip("");
5567
 
        TxFill->setToolTip("");
5568
 
        PM1->setToolTip("");
5569
 
        PM2->setToolTip("");
5570
 
        Revert->setToolTip("");
5571
 
        Extra->setToolTip("");
5572
 
        LineSp->setToolTip("");
5573
 
        linespacingButton->setToolTip("");
5574
 
        paraStyleCombo->setToolTip("");
5575
 
        charStyleCombo->setToolTip("");
5576
 
        paraStyleClear->setToolTip("");
5577
 
        charStyleClear->setToolTip("");
5578
 
//      langCombo->setToolTip("");
5579
 
 
5580
 
        minWordTrackingSpinBox->setToolTip("");
5581
 
        normWordTrackingSpinBox->setToolTip("");
5582
 
        minGlyphExtSpinBox->setToolTip("");
5583
 
        maxGlyphExtSpinBox->setToolTip("");
5584
 
        optMarginCombo->setToolTip("");
5585
 
 
5586
 
        LineMode->setToolTip("");
5587
 
        LStyle->setToolTip("");
5588
 
        LSize->setToolTip("");
5589
 
        LJoinStyle->setToolTip("");
5590
 
        LEndStyle->setToolTip("");
5591
 
        StyledLine->setToolTip("");
5592
 
 
5593
 
        SCustom->setToolTip("");
5594
 
        EditShape->setToolTip("");
5595
 
        RoundRect->setToolTip("");
5596
 
        DCol->setToolTip("");
5597
 
        colgapLabel->setToolTip("");
5598
 
        dGap->setToolTip("");
5599
 
        DTop->setToolTip("");
5600
 
        DBottom->setToolTip("");
5601
 
        DLeft->setToolTip("");
5602
 
        DRight->setToolTip("");
5603
 
        TabsButton->setToolTip("");
5604
 
 
5605
 
        FreeScale->setToolTip("");
5606
 
        imageXOffsetSpinBox->setToolTip("");
5607
 
        imageYOffsetSpinBox->setToolTip("");
5608
 
        imageXScaleSpinBox->setToolTip("");
5609
 
        imageYScaleSpinBox->setToolTip("");
5610
 
        keepImageWHRatioButton->setToolTip("");
5611
 
        keepFrameWHRatioButton->setToolTip("");
5612
 
        FrameScale->setToolTip("");
5613
 
        Aspect->setToolTip("");
5614
 
        InputP->setToolTip("");
5615
 
        MonitorI->setToolTip("");
5616
 
*/
5617
 
        NameEdit->setToolTip( tr("Name of selected object"));
5618
 
        Xpos->setToolTip( tr("Horizontal position of current basepoint"));
5619
 
        Ypos->setToolTip( tr("Vertical position of current basepoint"));
5620
 
        Width->setToolTip( tr("Width"));
5621
 
        Height->setToolTip( tr("Height"));
5622
 
        Rotation->setToolTip( tr("Rotation of object at current basepoint"));
5623
 
        basepointLabel->setToolTip( tr("Point from which measurements or rotation angles are referenced"));
5624
 
//      TopLeft->setToolTip( tr("Select top left for basepoint"));
5625
 
//      TopRight->setToolTip( tr("Select top right for basepoint"));
5626
 
//      BottomLeft->setToolTip( tr("Select bottom left for basepoint"));
5627
 
//      BottomRight->setToolTip( tr("Select bottom right for basepoint"));
5628
 
//      Center->setToolTip( tr("Select center for basepoint"));
5629
 
        DoGroup->setToolTip( tr("Group the selected objects"));
5630
 
        DoUnGroup->setToolTip( tr("Ungroup the selected group"));
5631
 
        FlipH->setToolTip( tr("Flip Horizontal"));
5632
 
        FlipV->setToolTip( tr("Flip Vertical"));
5633
 
        Zup->setToolTip( tr("Move one level up"));
5634
 
        ZDown->setToolTip( tr("Move one level down"));
5635
 
        ZTop->setToolTip( tr("Move to front"));
5636
 
        ZBottom->setToolTip( tr("Move to back"));
5637
 
        LevelTxt->setToolTip( tr("Indicates the level the object is on, 0 means the object is at the bottom"));
5638
 
        Locked->setToolTip( tr("Lock or unlock the object"));
5639
 
        NoResize->setToolTip( tr("Lock or unlock the size of the object"));
5640
 
        NoPrint->setToolTip( tr("Enable or disable exporting of the object"));
5641
 
        /*textFlowOptions->setToolTip( tr("Make text in lower frames flow around the object shape")); */
5642
 
        textFlowDisabled->setToolTip( tr("Disable text flow from lower frames around object"));
5643
 
        textFlowUsesFrameShape->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5644
 
        textFlowUsesBoundingBox->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
5645
 
        textFlowUsesContourLine->setToolTip(  "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object. T") + "</qt>" );
5646
 
        textFlowUsesImageClipping->setToolTip(  "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5647
 
        textFlowDisabled2->setToolTip( tr("Disable text flow from lower frames around object"));
5648
 
        textFlowUsesFrameShape2->setToolTip( tr("Use the frame shape for text flow of text frames below the object."));
5649
 
        textFlowUsesBoundingBox2->setToolTip(  "<qt>" + tr("Use the bounding box, which is always rectangular, instead of the frame's shape for text flow of text frames below the object. ") + "</qt>" );
5650
 
        textFlowUsesContourLine2->setToolTip(  "<qt>" + tr("When chosen, the contour line can be edited with the Edit Shape Tool on the palette further above. When edited via the shape palette, this becomes a second separate line originally based on the frame's shape for text flow of text frames below the object. T") + "</qt>" );
5651
 
        textFlowUsesImageClipping2->setToolTip(  "<qt>" + tr("Use the clipping path of the image") + "</qt>" );
5652
 
 
5653
 
        //Fonts->setToolTip( tr("Font of selected text or object"));
5654
 
        Size->setToolTip( tr("Font Size"));
5655
 
        ChBase->setToolTip( tr("Offset to baseline of characters"));
5656
 
        ChScale->setToolTip( tr("Scaling width of characters"));
5657
 
        ChScaleV->setToolTip( tr("Scaling height of characters"));
5658
 
        TxStroke->setToolTip( "<qt>" + tr("Color of text stroke and/or drop shadow, depending which is chosen.If both are chosen, then they share the same color.") + "</qt>" );
5659
 
        TxFill->setToolTip( "<qt>" + tr("Color of selected text. If Outline text decoration is enabled, this color will be the fill color. If Drop Shadow Text is enabled, then this will be the top most color.") + "</qt>" );
5660
 
        PM1->setToolTip( tr("Saturation of color of text stroke"));
5661
 
        PM2->setToolTip( tr("Saturation of color of text fill"));
5662
 
        Revert->setToolTip( tr("Right to Left Writing"));
5663
 
        Extra->setToolTip( tr("Manual Tracking"));
5664
 
        LineSp->setToolTip( tr("Line Spacing"));
5665
 
//      linespacingButton->setToolTip( "<qt>" + tr("Click and hold down to select the line spacing mode.") + "</qt>" );
5666
 
        lineSpacingModeCombo->setToolTip( tr("Select the line spacing mode.") );
5667
 
        paraStyleCombo->setToolTip( tr("Paragraph style of currently selected text or paragraph"));
5668
 
        charStyleCombo->setToolTip( tr("Character style of currently selected text or paragraph"));
5669
 
        paraStyleClear->setToolTip( tr("Remove Direct Paragraph Formatting"));
5670
 
        charStyleClear->setToolTip( tr("Remove Direct Character Formatting"));
5671
 
//      langCombo->setToolTip( tr("Hyphenation language of frame"));
5672
 
 
5673
 
        flopRealHeight->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to use the tallest height of the included characters") + "</qt>" );
5674
 
        flopFontAscent->setToolTip( "<qt>" + tr("Set the height of the first line of text frame to use the full ascent of the font(s) in use") + "</qt>" );
5675
 
        flopLineSpacing->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to the specified line height") + "</qt>" );
5676
 
 
5677
 
        minWordTrackingSpinBox->setToolTip( tr("Minimal width of spaces between words"));
5678
 
        normWordTrackingSpinBox->setToolTip( tr("Normal width of spaces between words"));
5679
 
        minGlyphExtSpinBox->setToolTip( tr("Minimal shrinkage of glyphs for justification"));
5680
 
        maxGlyphExtSpinBox->setToolTip( tr("Maximal extension of glyphs for justification"));
5681
 
//      optMarginCombo->setToolTip( tr("Uses hanging punctuation and margin kerning to achieve nicer looking columns"));
5682
 
 
5683
 
        LineMode->setToolTip( tr("Change settings for left or end points"));
5684
 
        LStyle->setToolTip( tr("Pattern of line"));
5685
 
        LSize->setToolTip( tr("Thickness of line"));
5686
 
        LJoinStyle->setToolTip( tr("Type of line joins"));
5687
 
        LEndStyle->setToolTip( tr("Type of line end"));
5688
 
        StyledLine->setToolTip( tr("Line style of current object"));
5689
 
        startArrow->setToolTip( tr("Arrow head style for start of line"));
5690
 
        endArrow->setToolTip( tr("Arrow head style for end of line"));
5691
 
 
5692
 
        SCustom->setToolTip( tr("Choose the shape of frame..."));
5693
 
        EditShape->setToolTip( tr("Edit shape of the frame..."));
5694
 
        RoundRect->setToolTip( tr("Set radius of corner rounding"));
5695
 
        DCol->setToolTip( tr("Number of columns in text frame"));
5696
 
        colgapLabel->setToolTip( tr("Switches between Gap or Column width"));
5697
 
        dGap->setToolTip( tr("Distance between columns"));
5698
 
        DTop->setToolTip( tr("Distance of text from top of frame"));
5699
 
        DBottom->setToolTip( tr("Distance of text from bottom of frame"));
5700
 
        DLeft->setToolTip( tr("Distance of text from left of frame"));
5701
 
        DRight->setToolTip( tr("Distance of text from right of frame"));
5702
 
        TabsButton->setToolTip( tr("Edit tab settings of text frame..."));
5703
 
 
5704
 
        FreeScale->setToolTip( tr("Allow the image to be a different size to the frame"));
5705
 
        imageXOffsetSpinBox->setToolTip( tr("Horizontal offset of image within frame"));
5706
 
        imageYOffsetSpinBox->setToolTip( tr("Vertical offset of image within frame"));
5707
 
        imageXScaleSpinBox->setToolTip( tr("Resize the image horizontally"));
5708
 
        imageYScaleSpinBox->setToolTip( tr("Resize the image vertically"));
5709
 
        keepImageWHRatioButton->setToolTip( tr("Keep the X and Y scaling the same"));
5710
 
        keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
5711
 
        FrameScale->setToolTip( tr("Make the image fit within the size of the frame"));
5712
 
        imgDpiX->setToolTip( tr("Effective horizontal DPI of the image after scaling"));
5713
 
        imgDpiY->setToolTip( tr("Effective vertical DPI of the image after scaling"));
5714
 
        Aspect->setToolTip( tr("Use image proportions rather than those of the frame"));
5715
 
        InputP->setToolTip( tr("Source profile of the image"));
5716
 
        MonitorI->setToolTip( tr("Rendering intent for the image"));
5717
 
}
5718
 
 
5719
 
 
5720
 
const VGradient PropertiesPalette::getFillGradient()
5721
 
{
5722
 
        return Cpal->gradEdit->Preview->fill_gradient;
5723
 
}
5724
 
 
5725
 
void PropertiesPalette::setGradientEditMode(bool on)
5726
 
{
5727
 
        Cpal->gradEditButton->setChecked(on);
5728
 
}
5729
 
 
5730
 
void PropertiesPalette::updateColorSpecialGradient()
5731
 
{
5732
 
        if (!HaveDoc)
5733
 
                return;
5734
 
        if(doc->m_Selection->isEmpty())
5735
 
                return;
5736
 
        double dur=doc->unitRatio();
5737
 
        PageItem *currItem=doc->m_Selection->itemAt(0);
5738
 
        if (currItem)
5739
 
                Cpal->setSpecialGradient(currItem->GrStartX * dur, currItem->GrStartY * dur, currItem->GrEndX * dur, currItem->GrEndY * dur);
5740
 
}
5741
 
 
5742
 
void PropertiesPalette::updateSpinBoxConstants()
5743
 
{
5744
 
        if (!HaveDoc)
5745
 
                return;
5746
 
        if(doc->m_Selection->count()==0)
5747
 
                return;
5748
 
        Width->setConstants(&doc->constants());
5749
 
        Height->setConstants(&doc->constants());
5750
 
        Xpos->setConstants(&doc->constants());
5751
 
        Ypos->setConstants(&doc->constants());
5752
 
 
5753
 
}
5754
 
 
5755
 
UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
5756
 
{
5757
 
 
5758
 
}
5759
 
 
5760
 
bool UserActionSniffer::eventFilter(QObject*, QEvent *e)
5761
 
{
5762
 
        if (e->type() == QEvent::MouseButtonPress)
5763
 
                emit actionStart();
5764
 
        else if (e->type() == QEvent::MouseButtonRelease)
5765
 
                emit actionEnd();
5766
 
        else if (e->type() == QEvent::KeyPress)
5767
 
        {
5768
 
                QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5769
 
                if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5770
 
                        emit actionStart();
5771
 
        }
5772
 
        else if (e->type() == QEvent::KeyRelease)
5773
 
        {
5774
 
                QKeyEvent *k = dynamic_cast<QKeyEvent*>(e);
5775
 
                if (k && !k->isAutoRepeat() && (k->key() == Qt::Key_Up || k->key() == Qt::Key_Down))
5776
 
                        emit actionEnd();
5777
 
        }
5778
 
        return false;
5779
 
}
5780
 
 
5781
 
void PropertiesPalette::setLocked(bool isLocked)
5782
 
{
5783
 
        Xpos->setReadOnly(isLocked);
5784
 
        Ypos->setReadOnly(isLocked);
5785
 
        Width->setReadOnly(isLocked);
5786
 
        Height->setReadOnly(isLocked);
5787
 
        Rotation->setReadOnly(isLocked);
5788
 
        QPalette pal(qApp->palette());
5789
 
        if (isLocked)
5790
 
                pal.setCurrentColorGroup(QPalette::Disabled);
5791
 
 
5792
 
        Xpos->setPalette(pal);
5793
 
        Ypos->setPalette(pal);
5794
 
        Width->setPalette(pal);
5795
 
        Height->setPalette(pal);
5796
 
        Rotation->setPalette(pal);
5797
 
 
5798
 
        EditShape->setEnabled(!isLocked);
5799
 
        LayerGroup->setEnabled(!isLocked);
5800
 
        Locked->setChecked(isLocked);
5801
 
        if ((HaveDoc) && (HaveItem))
5802
 
        {
5803
 
                SCustom->setEnabled(!CurItem->asLine() && !CurItem->asPolyLine() && !CurItem->asPathText() && !isLocked);
5804
 
                if (((CurItem->asTextFrame()) || (CurItem->asImageFrame()) || (CurItem->asPolygon())) &&  (!CurItem->ClipEdited) && ((CurItem->FrameType == 0) || (CurItem->FrameType == 2)))
5805
 
                        RoundRect->setEnabled(!isLocked);
5806
 
                else
5807
 
                        RoundRect->setEnabled(false);
5808
 
        }
5809
 
}
5810
 
 
5811
 
void PropertiesPalette::setSizeLocked(bool isSizeLocked)
5812
 
{
5813
 
        bool b=isSizeLocked;
5814
 
        if (HaveItem && CurItem->locked())
5815
 
                b=true;
5816
 
        Width->setReadOnly(b);
5817
 
        Height->setReadOnly(b);
5818
 
        QPalette pal(qApp->palette());
5819
 
        
5820
 
        if (b)
5821
 
                pal.setCurrentColorGroup(QPalette::Disabled);
5822
 
 
5823
 
        Width->setPalette(pal);
5824
 
        Height->setPalette(pal);
5825
 
        NoResize->setChecked(isSizeLocked);
5826
 
}
5827
 
 
5828
 
void PropertiesPalette::setPrintingEnabled(bool isPrintingEnabled)
5829
 
{
5830
 
        NoPrint->setChecked(!isPrintingEnabled);
5831
 
}
5832
 
 
5833
 
void PropertiesPalette::setFlippedH(bool isFlippedH)
5834
 
{
5835
 
        FlipH->setChecked(isFlippedH);
5836
 
}
5837
 
 
5838
 
void PropertiesPalette::setFlippedV(bool isFlippedV)
5839
 
{
5840
 
        FlipV->setChecked(isFlippedV);
5841
 
}
5842
 
 
5843
 
void PropertiesPalette::setGroupTransparency(int trans)
5844
 
{
5845
 
        if ((HaveDoc) && (HaveItem))
5846
 
        {
5847
 
                CurItem->setFillTransparency(static_cast<double>(100 - trans) / 100.0);
5848
 
                CurItem->update();
5849
 
                emit DocChanged();
5850
 
        }
5851
 
}
5852
 
 
5853
 
void PropertiesPalette::setGroupBlending(int blend)
5854
 
{
5855
 
                CurItem->setFillBlendmode(blend);
5856
 
                CurItem->update();
5857
 
                emit DocChanged();
5858
 
}
5859
 
 
5860
 
void PropertiesPalette::doGrouping()
5861
 
{
5862
 
        m_ScMW->GroupObj();
5863
 
        DoGroup->setEnabled(false);
5864
 
        DoUnGroup->setEnabled(true);
5865
 
        setMultipleSelection(true);
5866
 
        double gx, gy, gh, gw;
5867
 
        doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
5868
 
        int bp = RotationGroup->checkedId();
5869
 
        if (bp == 0)
5870
 
                m_ScMW->view->RCenter = FPoint(gx, gy);
5871
 
        else if (bp == 1)
5872
 
                m_ScMW->view->RCenter = FPoint(gx + gw, gy);
5873
 
        else if (bp == 2)
5874
 
                m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
5875
 
        else if (bp == 3)
5876
 
                m_ScMW->view->RCenter = FPoint(gx, gy + gh);
5877
 
        else if (bp == 4)
5878
 
                m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
5879
 
        TabStack->setItemEnabled(idShapeItem, false);
5880
 
}
5881
 
 
5882
 
void PropertiesPalette::handleShapeEdit2()
5883
 
{
5884
 
        if (!m_ScMW || m_ScMW->scriptIsRunning())
5885
 
                return;
5886
 
        if ((HaveDoc) && (HaveItem))
5887
 
        {
5888
 
                tmpSelection->clear();
5889
 
                tmpSelection->copy(*doc->m_Selection, true);
5890
 
                doc->m_Selection->clear();
5891
 
                doc->m_Selection->addItem(CurItem);
5892
 
                CurItem->isSingleSel = true;
5893
 
                CurItem->update();
5894
 
                m_ScMW->view->requestMode(modeEditClip);
5895
 
                RoundRect->setEnabled(false);
5896
 
        }
5897
 
}
5898
 
 
5899
 
void PropertiesPalette::endEdit2()
5900
 
{
5901
 
        if ((HaveDoc) && (HaveItem))
5902
 
        {
5903
 
                if (tmpSelection->count() > 0)
5904
 
                {
5905
 
                        doc->m_Selection->copy(*tmpSelection, false);
5906
 
                        doc->m_Selection->connectItemToGUI();
5907
 
                }
5908
 
                tmpSelection->clear();
5909
 
        }
5910
 
}
5911
 
 
5912
 
void PropertiesPalette::flop(int radioFlop)
5913
 
{
5914
 
        if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
5915
 
                return;
5916
 
//      qDebug("%s", QString("rF %1").arg(radioFlop).toAscii());
5917
 
        if( radioFlop == 0)
5918
 
                CurItem->setFirstLineOffset(FLOPRealGlyphHeight);
5919
 
        else if( radioFlop == 1)
5920
 
                CurItem->setFirstLineOffset(FLOPFontAscent);
5921
 
        else if( radioFlop == 2)
5922
 
                CurItem->setFirstLineOffset(FLOPLineSpacing);
5923
 
        CurItem->update();
5924
 
        emit DocChanged();
5925
 
}
5926
 
 
5927
 
 
5928