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

« back to all changes in this revision

Viewing changes to scribus/nodeeditpalette.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-15 15:57:12 UTC
  • mfrom: (4.2.10 sid)
  • Revision ID: package-import@ubuntu.com-20120215155712-biimoc8o875jht80
Tags: 1.4.0.dfsg+r17300-1
* Prepare a dummy transitional package to converge on the 1.4.0 release.
* debian/NEWS: update the news.

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
 
#include <QEvent>
9
 
 
10
 
#include "nodeeditpalette.h"
11
 
#include "page.h"
12
 
#include "pageitem.h"
13
 
#include "scribusview.h"
14
 
#include "selection.h"
15
 
#include "undomanager.h"
16
 
#include "undostate.h"
17
 
#include "units.h"
18
 
#include "util_icon.h"
19
 
 
20
 
NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase( parent, "nodePalette", false, 0)
21
 
{
22
 
        QSize iconSize = QSize(22, 22);
23
 
        doc=0;
24
 
        unitRatio=1.0;
25
 
        vboxLayout = new QVBoxLayout(this);
26
 
        vboxLayout->setSpacing(2);
27
 
        vboxLayout->setMargin(5);
28
 
        gridLayout = new QGridLayout();
29
 
        gridLayout->setSpacing(2);
30
 
        gridLayout->setMargin(0);
31
 
        MoveNode = new QToolButton(this);
32
 
        MoveNode->setText( "" );
33
 
        MoveNode->setIcon(QIcon(loadIcon("MoveNode.png")));
34
 
        MoveNode->setIconSize(iconSize);
35
 
        MoveNode->setContentsMargins(0, 0, 0, 0);
36
 
        MoveNode->setCheckable(true);
37
 
        MoveNode->setChecked(true);
38
 
        MoveNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
39
 
        gridLayout->addWidget(MoveNode, 0, 0, 1, 1);
40
 
 
41
 
        AddNode = new QToolButton(this);
42
 
        AddNode->setIcon(QIcon(loadIcon("AddNode.png")));
43
 
        AddNode->setIconSize(iconSize);
44
 
        AddNode->setContentsMargins(0, 0, 0, 0);
45
 
        AddNode->setEnabled(true);
46
 
        AddNode->setCheckable(true);
47
 
        AddNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
48
 
        gridLayout->addWidget(AddNode, 0, 1, 1, 1);
49
 
 
50
 
        DeleteNode = new QToolButton(this);
51
 
        DeleteNode->setIcon(QIcon(loadIcon("DeleteNode.png")));
52
 
        DeleteNode->setIconSize(iconSize);
53
 
        DeleteNode->setContentsMargins(0, 0, 0, 0);
54
 
        DeleteNode->setEnabled(true);
55
 
        DeleteNode->setCheckable(true);
56
 
        DeleteNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
57
 
        gridLayout->addWidget(DeleteNode, 0, 2, 1, 1);
58
 
 
59
 
        ResNode = new QToolButton(this);
60
 
        ResNode->setIcon(QIcon(loadIcon("ResetNode.png")));
61
 
        ResNode->setIconSize(iconSize);
62
 
        ResNode->setContentsMargins(0, 0, 0, 0);
63
 
        ResNode->setEnabled(true);
64
 
        ResNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
65
 
        gridLayout->addWidget(ResNode, 0, 3, 1, 1);
66
 
 
67
 
        MoveControl = new QToolButton(this);
68
 
        MoveControl->setIcon(QIcon(loadIcon("MoveKontrol.png")));
69
 
        MoveControl->setIconSize(iconSize);
70
 
        MoveControl->setContentsMargins(0, 0, 0, 0);
71
 
        MoveControl->setCheckable(true);
72
 
        MoveControl->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
73
 
        gridLayout->addWidget(MoveControl, 1, 0, 1, 1);
74
 
 
75
 
        AsymMove = new QToolButton(this);
76
 
        AsymMove->setIcon(QIcon(loadIcon("MoveAsym.png")));
77
 
        AsymMove->setIconSize(iconSize);
78
 
        AsymMove->setContentsMargins(0, 0, 0, 0);
79
 
        AsymMove->setEnabled(false);
80
 
        AsymMove->setCheckable(true);
81
 
        AsymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
82
 
        gridLayout->addWidget(AsymMove, 1, 1, 1, 1);
83
 
 
84
 
        SymMove = new QToolButton(this);
85
 
        SymMove->setIcon(QIcon(loadIcon("MoveSym.png")));
86
 
        SymMove->setIconSize(iconSize);
87
 
        SymMove->setContentsMargins(0, 0, 0, 0);
88
 
        SymMove->setEnabled(false);
89
 
        SymMove->setCheckable(true);
90
 
        SymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
91
 
        gridLayout->addWidget(SymMove, 1, 2, 1, 1);
92
 
 
93
 
        Res1Node = new QToolButton(this);
94
 
        Res1Node->setIcon(QIcon(loadIcon("Reset1Node.png")));
95
 
        Res1Node->setIconSize(iconSize);
96
 
        Res1Node->setContentsMargins(0, 0, 0, 0);
97
 
        Res1Node->setEnabled(false);
98
 
        Res1Node->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
99
 
        gridLayout->addWidget(Res1Node, 1, 3, 1, 1);
100
 
 
101
 
        PolySplit = new QToolButton(this);
102
 
        PolySplit->setEnabled( false );
103
 
        PolySplit->setCheckable( true );
104
 
        PolySplit->setIcon(QIcon(loadIcon("PolyCut.png")));
105
 
        PolySplit->setIconSize(iconSize);
106
 
        PolySplit->setContentsMargins(0, 0, 0, 0);
107
 
        PolySplit->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
108
 
        gridLayout->addWidget(PolySplit, 2, 0, 1, 1);
109
 
 
110
 
        BezierClose = new QToolButton(this);
111
 
        BezierClose->setEnabled( false );
112
 
        BezierClose->setIcon(QIcon(loadIcon("BezierClose.png")));
113
 
        BezierClose->setIconSize(iconSize);
114
 
        BezierClose->setContentsMargins(0, 0, 0, 0);
115
 
        BezierClose->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
116
 
        gridLayout->addWidget(BezierClose, 2, 1, 1, 1);
117
 
 
118
 
        PolyMirrorH = new QToolButton(this);
119
 
        PolyMirrorH->setIcon(QIcon(loadIcon("hmirror.png")));
120
 
        PolyMirrorH->setIconSize(iconSize);
121
 
        PolyMirrorH->setContentsMargins(0, 0, 0, 0);
122
 
        PolyMirrorH->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
123
 
        gridLayout->addWidget(PolyMirrorH, 2, 2, 1, 1);
124
 
 
125
 
        PolyMirrorV = new QToolButton(this);
126
 
        PolyMirrorV->setIcon(QIcon(loadIcon("vmirror.png")));
127
 
        PolyMirrorV->setIconSize(iconSize);
128
 
        PolyMirrorV->setContentsMargins(0, 0, 0, 0);
129
 
        PolyMirrorV->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
130
 
        gridLayout->addWidget(PolyMirrorV, 2, 3, 1, 1);
131
 
 
132
 
        PolyShearL = new QToolButton(this);
133
 
        PolyShearL->setIcon(QIcon(loadIcon("22/transform-shear-left.png")));
134
 
        PolyShearL->setIconSize(iconSize);
135
 
        PolyShearL->setContentsMargins(0, 0, 0, 0);
136
 
        PolyShearL->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
137
 
        PolyShearL->setAutoRepeat(true);
138
 
        gridLayout->addWidget(PolyShearL, 3, 0, 1, 1);
139
 
 
140
 
        PolyShearR = new QToolButton(this);
141
 
        PolyShearR->setIcon(QIcon(loadIcon("22/transform-shear-right.png")));
142
 
        PolyShearR->setIconSize(iconSize);
143
 
        PolyShearR->setContentsMargins(0, 0, 0, 0);
144
 
        PolyShearR->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
145
 
        PolyShearR->setAutoRepeat(true);
146
 
        gridLayout->addWidget(PolyShearR, 3, 1, 1, 1);
147
 
 
148
 
        PolyShearU = new QToolButton(this);
149
 
        PolyShearU->setIcon(QIcon(loadIcon("22/transform-shear-up.png")));
150
 
        PolyShearU->setIconSize(iconSize);
151
 
        PolyShearU->setContentsMargins(0, 0, 0, 0);
152
 
        PolyShearU->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
153
 
        PolyShearU->setAutoRepeat(true);
154
 
        gridLayout->addWidget(PolyShearU, 3, 2, 1, 1);
155
 
 
156
 
        PolyShearD = new QToolButton(this);
157
 
        PolyShearD->setIcon(QIcon(loadIcon("22/transform-shear-down.png")));
158
 
        PolyShearD->setIconSize(iconSize);
159
 
        PolyShearD->setContentsMargins(0, 0, 0, 0);
160
 
        PolyShearD->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
161
 
        PolyShearD->setAutoRepeat(true);
162
 
        gridLayout->addWidget(PolyShearD, 3, 3, 1, 1);
163
 
        vboxLayout->addLayout(gridLayout);
164
 
 
165
 
        gridLayout1 = new QGridLayout();
166
 
        gridLayout1->setSpacing(5);
167
 
        gridLayout1->setMargin(0);
168
 
 
169
 
        RotateCCW = new QToolButton(this);
170
 
        RotateCCW->setIcon(QIcon(loadIcon("rotate_ccw.png")));
171
 
        RotateCCW->setIconSize(iconSize);
172
 
        RotateCCW->setContentsMargins(0, 0, 0, 0);
173
 
        RotateCCW->setAutoRepeat(true);
174
 
        gridLayout1->addWidget(RotateCCW, 0, 0, 1, 1);
175
 
 
176
 
        RotateCW = new QToolButton(this);
177
 
        RotateCW->setIcon(QIcon(loadIcon("rotate_cw.png")));
178
 
        RotateCW->setIconSize(iconSize);
179
 
        RotateCW->setContentsMargins(0, 0, 0, 0);
180
 
        RotateCW->setAutoRepeat(true);
181
 
        gridLayout1->addWidget(RotateCW, 0, 1, 1, 1);
182
 
 
183
 
        RotVal = new QSpinBox(this);
184
 
        RotVal->setMinimum(1);
185
 
        RotVal->setMaximum(180);
186
 
        RotVal->setValue(1);
187
 
        RotVal->setSuffix( QString::fromUtf8(" °"));
188
 
        gridLayout1->addWidget(RotVal, 0, 2, 1, 1);
189
 
 
190
 
        Expand = new QToolButton(this);
191
 
        Expand->setIcon(QIcon(loadIcon("expand.png")));
192
 
        Expand->setIconSize(iconSize);
193
 
        Expand->setContentsMargins(0, 0, 0, 0);
194
 
        Expand->setAutoRepeat(true);
195
 
        gridLayout1->addWidget(Expand, 1, 0, 1, 1);
196
 
 
197
 
        Shrink = new QToolButton(this);
198
 
        Shrink->setIcon(QIcon(loadIcon("crop.png")));
199
 
        Shrink->setIconSize(iconSize);
200
 
        Shrink->setContentsMargins(0, 0, 0, 0);
201
 
        Shrink->setAutoRepeat(true);
202
 
        gridLayout1->addWidget(Shrink, 1, 1, 1, 1);
203
 
 
204
 
        scalePercentage = new QSpinBox(this);
205
 
        scalePercentage->setMinimum(1);
206
 
        scalePercentage->setMaximum(100);
207
 
        scalePercentage->setValue(10);
208
 
        gridLayout1->addWidget(scalePercentage, 1, 2, 1, 1);
209
 
 
210
 
        Enlarge = new QToolButton(this);
211
 
        Enlarge->setIcon(QIcon(loadIcon("expand.png")));
212
 
        Enlarge->setIconSize(iconSize);
213
 
        Enlarge->setContentsMargins(0, 0, 0, 0);
214
 
        Enlarge->setAutoRepeat(true);
215
 
        gridLayout1->addWidget(Enlarge, 2, 0, 1, 1);
216
 
 
217
 
        Reduce = new QToolButton(this);
218
 
        Reduce->setIcon(QIcon(loadIcon("crop.png")));
219
 
        Reduce->setIconSize(iconSize);
220
 
        Reduce->setContentsMargins(0, 0, 0, 0);
221
 
        Reduce->setAutoRepeat(true);
222
 
        gridLayout1->addWidget(Reduce, 2, 1, 1, 1);
223
 
 
224
 
        scaleDistance = new ScrSpinBox( 1, 16777215, this, 0);
225
 
        scaleDistance->setValues(-16777215, 16777215, 2, 30);
226
 
        gridLayout1->addWidget(scaleDistance, 2, 2, 1, 1);
227
 
        vboxLayout->addLayout(gridLayout1);
228
 
 
229
 
        gridLayout2 = new QGridLayout();
230
 
        gridLayout2->setSpacing(5);
231
 
        gridLayout2->setMargin(0);
232
 
 
233
 
        QSpacerItem* spacer = new QSpacerItem( 3, 3, QSizePolicy::Fixed, QSizePolicy::Fixed );
234
 
        vboxLayout->addItem(spacer);
235
 
        AbsMode = new QGroupBox( "&Absolute Coordinates", this );
236
 
        AbsMode->setCheckable(true);
237
 
        AbsMode->setChecked(false);
238
 
        vboxLayout1 = new QVBoxLayout(AbsMode);
239
 
        vboxLayout1->setSpacing(2);
240
 
        vboxLayout1->setMargin(5);
241
 
        absToCanvas = new QRadioButton( tr("to Canvas"), AbsMode);
242
 
        vboxLayout1->addWidget(absToCanvas);
243
 
        absToPage = new QRadioButton( tr("to Page"), AbsMode);
244
 
        vboxLayout1->addWidget(absToPage);
245
 
        absToCanvas->setChecked(true);
246
 
        gridLayout2->addWidget(AbsMode, 1, 0, 1, 2);
247
 
 
248
 
        TextLabel1 = new QLabel(this);
249
 
        gridLayout2->addWidget(TextLabel1, 2, 0, 1, 1);
250
 
 
251
 
        XSpin = new ScrSpinBox( 0, 16777215, this, 2 );
252
 
        XSpin->setEnabled(false);
253
 
        gridLayout2->addWidget(XSpin, 2, 1, 1, 1);
254
 
 
255
 
        TextLabel2 = new QLabel(this);
256
 
        gridLayout2->addWidget(TextLabel2, 3, 0, 1, 1);
257
 
 
258
 
        YSpin = new ScrSpinBox( 0, 16777215, this, 2 );
259
 
        YSpin->setEnabled(false);
260
 
        gridLayout2->addWidget(YSpin, 3, 1, 1, 1);
261
 
        TextLabel1->setBuddy(XSpin);
262
 
        TextLabel2->setBuddy(YSpin);
263
 
 
264
 
        EditCont = new QCheckBox(this);
265
 
        EditCont->setChecked(false);
266
 
        gridLayout2->addWidget(EditCont, 4, 0, 1, 2);
267
 
 
268
 
        ResetCont = new QPushButton(this);
269
 
        ResetCont->setEnabled(false);
270
 
        gridLayout2->addWidget(ResetCont, 5, 0, 1, 2);
271
 
 
272
 
        ResetContClip = new QPushButton(this);
273
 
        ResetContClip->setEnabled(true);
274
 
        ResetContClip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
275
 
        ResetContClip->hide();
276
 
        gridLayout2->addWidget(ResetContClip, 6, 0, 1, 2);
277
 
 
278
 
        ResetShape2Clip = new QPushButton(this);
279
 
        ResetShape2Clip->setEnabled(true);
280
 
        ResetShape2Clip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
281
 
        ResetShape2Clip->hide();
282
 
        gridLayout2->addWidget(ResetShape2Clip, 7, 0, 1, 2);
283
 
 
284
 
        editEditButton = new QPushButton(this);
285
 
        editEditButton->setDefault(true);
286
 
        gridLayout2->addWidget(editEditButton, 8, 0, 1, 2);
287
 
 
288
 
        vboxLayout->addLayout(gridLayout2);
289
 
        resize(QSize(170, 380).expandedTo(minimumSizeHint()));
290
 
 
291
 
        languageChange();
292
 
}
293
 
 
294
 
void NodePalette::connectSignals()
295
 
{
296
 
        // signals and slots connections
297
 
        connect(editEditButton, SIGNAL(clicked()), this, SLOT(EndEdit()));
298
 
        connect(DeleteNode, SIGNAL(clicked()), this, SLOT(DelN()));
299
 
        connect(AddNode, SIGNAL(clicked()), this, SLOT(AddN()));
300
 
        connect(MoveNode, SIGNAL(clicked()), this, SLOT(MoveN()));
301
 
        connect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
302
 
        connect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
303
 
        connect(ResNode, SIGNAL(clicked()), this, SLOT(ResetControl()));
304
 
        connect(Res1Node, SIGNAL(clicked()), this, SLOT(Reset1Control()));
305
 
        connect(BezierClose, SIGNAL(clicked()), this, SLOT(CloseBezier()));
306
 
        connect(PolySplit, SIGNAL(clicked()), this, SLOT(SplitPoly()));
307
 
        connect(MoveControl, SIGNAL(clicked()), this, SLOT(MoveK()));
308
 
        connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
309
 
        connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
310
 
        connect(PolyMirrorH, SIGNAL(clicked()), this, SLOT(MirrorH()));
311
 
        connect(PolyMirrorV, SIGNAL(clicked()), this, SLOT(MirrorV()));
312
 
        connect(PolyShearR, SIGNAL(clicked()), this, SLOT(ShearR()));
313
 
        connect(PolyShearL, SIGNAL(clicked()), this, SLOT(ShearL()));
314
 
        connect(PolyShearU, SIGNAL(clicked()), this, SLOT(ShearU()));
315
 
        connect(PolyShearD, SIGNAL(clicked()), this, SLOT(ShearD()));
316
 
        connect(RotateCCW, SIGNAL(clicked()), this, SLOT(doRotCCW()));
317
 
        connect(RotateCW, SIGNAL(clicked()), this, SLOT(doRotCW()));
318
 
        connect(Shrink, SIGNAL(clicked()), this, SLOT(doShrink()));
319
 
        connect(Expand, SIGNAL(clicked()), this, SLOT(doExpand()));
320
 
        connect(Reduce, SIGNAL(clicked()), this, SLOT(doReduce()));
321
 
        connect(Enlarge, SIGNAL(clicked()), this, SLOT(doEnlarge()));
322
 
        connect(AbsMode, SIGNAL(clicked()), this, SLOT(ToggleAbsMode()));
323
 
        connect(absToCanvas, SIGNAL(clicked()), this, SLOT(ToggleAbsMode()));
324
 
        connect(absToPage, SIGNAL(clicked()), this, SLOT(ToggleAbsMode()));
325
 
        connect(EditCont, SIGNAL(clicked()), this, SLOT(ToggleConMode()));
326
 
        connect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
327
 
        connect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
328
 
        connect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
329
 
}
330
 
 
331
 
void NodePalette::disconnectSignals()
332
 
{
333
 
        // signals and slots disconnetions
334
 
        disconnect(editEditButton, SIGNAL(clicked()), this, SLOT(EndEdit()));
335
 
        disconnect(DeleteNode, SIGNAL(clicked()), this, SLOT(DelN()));
336
 
        disconnect(AddNode, SIGNAL(clicked()), this, SLOT(AddN()));
337
 
        disconnect(MoveNode, SIGNAL(clicked()), this, SLOT(MoveN()));
338
 
        disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
339
 
        disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
340
 
        disconnect(ResNode, SIGNAL(clicked()), this, SLOT(ResetControl()));
341
 
        disconnect(Res1Node, SIGNAL(clicked()), this, SLOT(Reset1Control()));
342
 
        disconnect(BezierClose, SIGNAL(clicked()), this, SLOT(CloseBezier()));
343
 
        disconnect(PolySplit, SIGNAL(clicked()), this, SLOT(SplitPoly()));
344
 
        disconnect(MoveControl, SIGNAL(clicked()), this, SLOT(MoveK()));
345
 
        disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
346
 
        disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
347
 
        disconnect(PolyMirrorH, SIGNAL(clicked()), this, SLOT(MirrorH()));
348
 
        disconnect(PolyMirrorV, SIGNAL(clicked()), this, SLOT(MirrorV()));
349
 
        disconnect(PolyShearR, SIGNAL(clicked()), this, SLOT(ShearR()));
350
 
        disconnect(PolyShearL, SIGNAL(clicked()), this, SLOT(ShearL()));
351
 
        disconnect(PolyShearU, SIGNAL(clicked()), this, SLOT(ShearU()));
352
 
        disconnect(PolyShearD, SIGNAL(clicked()), this, SLOT(ShearD()));
353
 
        disconnect(RotateCCW, SIGNAL(clicked()), this, SLOT(doRotCCW()));
354
 
        disconnect(RotateCW, SIGNAL(clicked()), this, SLOT(doRotCW()));
355
 
        disconnect(Shrink, SIGNAL(clicked()), this, SLOT(doShrink()));
356
 
        disconnect(Expand, SIGNAL(clicked()), this, SLOT(doExpand()));
357
 
        disconnect(Reduce, SIGNAL(clicked()), this, SLOT(doReduce()));
358
 
        disconnect(Enlarge, SIGNAL(clicked()), this, SLOT(doEnlarge()));
359
 
        disconnect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
360
 
        disconnect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
361
 
        disconnect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
362
 
}
363
 
 
364
 
void NodePalette::setDoc(ScribusDoc *dc, ScribusView *vi)
365
 
{
366
 
        doc = dc;
367
 
        view = vi;
368
 
 
369
 
        unitChange();
370
 
        disconnect(EditCont, SIGNAL(clicked()), this, SLOT(ToggleConMode()));
371
 
        disconnect(AbsMode, SIGNAL(clicked()), this, SLOT(ToggleAbsMode()));
372
 
        if (doc!=0)
373
 
        {
374
 
                YSpin->setNewUnit(doc->unitIndex());
375
 
                XSpin->setNewUnit(doc->unitIndex());
376
 
        }
377
 
        AbsMode->setChecked(false);
378
 
        EditCont->setChecked(false);
379
 
        if (doc==0)
380
 
                disconnectSignals();
381
 
        else
382
 
                connectSignals();
383
 
}
384
 
 
385
 
void NodePalette::SplitPoly()
386
 
{
387
 
        if (doc==0)
388
 
                return;
389
 
        MoveN();
390
 
        doc->nodeEdit.submode = NodeEditContext::SPLIT_PATH;
391
 
        PolySplit->setChecked(true);
392
 
}
393
 
 
394
 
void NodePalette::IsOpen()
395
 
{
396
 
        if (doc==0)
397
 
                return;
398
 
        PolySplit->setChecked(false);
399
 
        BezierClose->setEnabled(true);
400
 
        PolySplit->setEnabled(true);
401
 
        EditCont->setEnabled(false);
402
 
}
403
 
 
404
 
void NodePalette::PolyStatus(int typ, uint size)
405
 
{
406
 
        if (doc==0)
407
 
                return;
408
 
        bool setter;
409
 
        switch (typ)
410
 
        {
411
 
        case 6:
412
 
                PolySplit->setEnabled(true);
413
 
                BezierClose->setEnabled(false);
414
 
                break;
415
 
        case 7:
416
 
                setter = size > 7 ? true : false;
417
 
                BezierClose->setEnabled(setter);
418
 
                PolySplit->setEnabled(setter);
419
 
                break;
420
 
        default:
421
 
                BezierClose->setEnabled(false);
422
 
                PolySplit->setEnabled(false);
423
 
                break;
424
 
        }
425
 
}
426
 
 
427
 
void NodePalette::CloseBezier()
428
 
{
429
 
        if (doc==0)
430
 
                return;
431
 
        MoveN();
432
 
        PageItem *currItem = doc->m_Selection->itemAt(0);
433
 
        PageItem* newItem = doc->convertItemTo(currItem, PageItem::Polygon);
434
 
        doc->m_Selection->clear();
435
 
        doc->m_Selection->addItem(newItem);
436
 
        newItem->update();
437
 
        BezierClose->setEnabled(false);
438
 
        PolySplit->setEnabled(true);
439
 
        EditCont->setEnabled(true);
440
 
}
441
 
 
442
 
void NodePalette::doRotCCW()
443
 
{
444
 
        if (doc != 0)
445
 
                view->TransformPoly(0, RotVal->value());
446
 
}
447
 
 
448
 
void NodePalette::doRotCW()
449
 
{
450
 
        if (doc != 0)
451
 
                view->TransformPoly(1, RotVal->value());
452
 
}
453
 
 
454
 
void NodePalette::doShrink()
455
 
{
456
 
        if (doc != 0)
457
 
                view->TransformPoly(2, 1, scalePercentage->value());
458
 
}
459
 
 
460
 
void NodePalette::doExpand()
461
 
{
462
 
        if (doc != 0)
463
 
                view->TransformPoly(3, 1, scalePercentage->value());
464
 
}
465
 
 
466
 
void NodePalette::doReduce()
467
 
{
468
 
        if (doc != 0)
469
 
                view->TransformPoly(8, 1, scaleDistance->value()/unitGetRatioFromIndex(doc->unitIndex()));
470
 
}
471
 
 
472
 
void NodePalette::doEnlarge()
473
 
{
474
 
        if (doc != 0)
475
 
                view->TransformPoly(9, 1, scaleDistance->value()/unitGetRatioFromIndex(doc->unitIndex()));
476
 
}
477
 
 
478
 
void NodePalette::ShearR()
479
 
{
480
 
        if (doc != 0)
481
 
                view->TransformPoly(5);
482
 
}
483
 
 
484
 
void NodePalette::ShearL()
485
 
{
486
 
        if (doc != 0)
487
 
                view->TransformPoly(4);
488
 
}
489
 
 
490
 
void NodePalette::ShearU()
491
 
{
492
 
        if (doc != 0)
493
 
                view->TransformPoly(6);
494
 
}
495
 
 
496
 
void NodePalette::ShearD()
497
 
{
498
 
        if (doc != 0)
499
 
                view->TransformPoly(7);
500
 
}
501
 
 
502
 
void NodePalette::MirrorH()
503
 
{
504
 
        if (doc != 0)
505
 
                doc->MirrorPolyH(doc->m_Selection->itemAt(0));
506
 
}
507
 
 
508
 
void NodePalette::MirrorV()
509
 
{
510
 
        if (doc != 0)
511
 
                doc->MirrorPolyV(doc->m_Selection->itemAt(0));
512
 
}
513
 
 
514
 
void NodePalette::ResetControl()
515
 
{
516
 
        if (doc != 0)
517
 
                doc->nodeEdit.resetControl(doc->m_Selection->itemAt(0));
518
 
}
519
 
 
520
 
void NodePalette::Reset1Control()
521
 
{
522
 
        if (doc != 0)
523
 
                doc->nodeEdit.reset1Control(doc->m_Selection->itemAt(0));
524
 
}
525
 
 
526
 
void NodePalette::ResetContour()
527
 
{
528
 
        if (doc != 0)
529
 
        {
530
 
                PageItem *currItem = doc->m_Selection->itemAt(0);
531
 
                if (UndoManager::undoEnabled())
532
 
                {
533
 
                        ItemState<FPointArray> *is = new ItemState<FPointArray>(Um::ResetContourLine, "",Um::IBorder);
534
 
                        is->set("RESET_CONTOUR", "reset_contour");
535
 
                        is->setItem(doc->m_Selection->itemAt(0)->ContourLine);
536
 
                        UndoManager::instance()->action(currItem, is);
537
 
                }
538
 
                //FIXME make an internal item copy poline to contourline member
539
 
                currItem->ContourLine = currItem->PoLine.copy();
540
 
                currItem->ClipEdited = true;
541
 
                view->DrawNew();
542
 
        }
543
 
}
544
 
 
545
 
void NodePalette::ResetContourToImageClip()
546
 
{
547
 
        if (doc != 0)
548
 
        {
549
 
                PageItem *currItem = doc->m_Selection->itemAt(0);
550
 
                currItem->ContourLine = currItem->imageClip.copy();
551
 
                currItem->ClipEdited = true;
552
 
                view->DrawNew();
553
 
        }
554
 
}
555
 
 
556
 
void NodePalette::ResetShapeToImageClip()
557
 
{
558
 
        if (doc != 0)
559
 
        {
560
 
                PageItem *currItem = doc->m_Selection->itemAt(0);
561
 
                currItem->PoLine = currItem->imageClip.copy();
562
 
                currItem->ClipEdited = true;
563
 
                currItem->FrameType = 3;
564
 
                doc->AdjustItemSize(currItem);
565
 
                emit DocChanged();
566
 
        }
567
 
}
568
 
 
569
 
void NodePalette::MovePoint()
570
 
{
571
 
        if (doc==0)
572
 
                return;
573
 
        if (doc->nodeEdit.submode == NodeEditContext::MOVE_POINT)
574
 
        {
575
 
                PageItem *currItem = doc->m_Selection->itemAt(0);
576
 
                FPoint zp;
577
 
                FPoint np(XSpin->value()/doc->unitRatio(), YSpin->value()/doc->unitRatio());
578
 
                if (AbsMode->isChecked())
579
 
                {
580
 
                        if (absToCanvas->isChecked())
581
 
                                zp = FPoint(currItem->xPos(), currItem->yPos());
582
 
                        else
583
 
                                zp = FPoint(currItem->xPos() - doc->currentPage()->xOffset(), currItem->yPos() - doc->currentPage()->yOffset());
584
 
                        np -= zp;
585
 
                }
586
 
                doc->nodeEdit.moveClipPoint(currItem, np);
587
 
                doc->AdjustItemSize(currItem);
588
 
                emit DocChanged();
589
 
        }
590
 
}
591
 
 
592
 
void NodePalette::SetSym()
593
 
{
594
 
        if (doc != 0)
595
 
                doc->nodeEdit.MoveSym = true;
596
 
        SymMove->setChecked(true);
597
 
        AsymMove->setChecked(false);
598
 
}
599
 
 
600
 
void NodePalette::SetAsym()
601
 
{
602
 
        if (doc != 0)
603
 
                doc->nodeEdit.MoveSym = false;
604
 
        SymMove->setChecked(false);
605
 
        AsymMove->setChecked(true);
606
 
}
607
 
 
608
 
void NodePalette::SetXY(double x, double y)
609
 
{
610
 
        if (doc==0)
611
 
                return;
612
 
        FPoint zp(0.0, 0.0);
613
 
        disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
614
 
        disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
615
 
        if (AbsMode->isChecked())
616
 
        {
617
 
                if (absToCanvas->isChecked())
618
 
                        zp = FPoint(doc->m_Selection->itemAt(0)->xPos(), doc->m_Selection->itemAt(0)->yPos());
619
 
                else
620
 
                        zp = FPoint(doc->m_Selection->itemAt(0)->xPos() - doc->currentPage()->xOffset(), doc->m_Selection->itemAt(0)->yPos() - doc->currentPage()->yOffset());
621
 
        }
622
 
        XSpin->setValue((x + zp.x())*doc->unitRatio());
623
 
        YSpin->setValue((y + zp.y())*doc->unitRatio());
624
 
        connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
625
 
        connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
626
 
}
627
 
 
628
 
void NodePalette::ToggleAbsMode()
629
 
{
630
 
        if (doc==0)
631
 
                return;
632
 
        FPoint zp(0.0, 0.0);
633
 
        disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
634
 
        disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
635
 
        FPointArray Clip;
636
 
        FPoint np(0.0, 0.0);
637
 
        if (EditCont->isChecked())
638
 
                Clip = doc->m_Selection->itemAt(0)->ContourLine;
639
 
        else
640
 
                Clip = doc->m_Selection->itemAt(0)->PoLine;
641
 
        if (doc->nodeEdit.SelNode.count() != 0)
642
 
                np = Clip.point(doc->nodeEdit.SelNode.at(0));
643
 
        if (AbsMode->isChecked())
644
 
        {
645
 
                XSpin->setMinimum(-16777215);
646
 
                YSpin->setMinimum(-16777215);
647
 
                if (absToCanvas->isChecked())
648
 
                        zp = FPoint(doc->m_Selection->itemAt(0)->xPos(), doc->m_Selection->itemAt(0)->yPos());
649
 
                else
650
 
                        zp = FPoint(doc->m_Selection->itemAt(0)->xPos() - doc->currentPage()->xOffset(), doc->m_Selection->itemAt(0)->yPos() - doc->currentPage()->yOffset());
651
 
        }
652
 
        else
653
 
        {
654
 
                XSpin->setMinimum(0);
655
 
                YSpin->setMinimum(0);
656
 
        }
657
 
        XSpin->setValue((np.x() + zp.x())*doc->unitRatio());
658
 
        YSpin->setValue((np.y() + zp.y())*doc->unitRatio());
659
 
        connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
660
 
        connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
661
 
}
662
 
 
663
 
void NodePalette::ToggleConMode()
664
 
{
665
 
        disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
666
 
        disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
667
 
        if (doc != 0)
668
 
        {
669
 
                doc->nodeEdit.isContourLine = EditCont->isChecked();
670
 
                if (EditCont->isChecked())
671
 
                {
672
 
                        BezierClose->setEnabled(false);
673
 
                        PolySplit->setEnabled(false);
674
 
                        ResetCont->setEnabled(true);
675
 
                        ResetContClip->setEnabled(true);
676
 
                        XSpin->setMinimum(-16777215);
677
 
                        YSpin->setMinimum(-16777215);
678
 
                }
679
 
                else
680
 
                {
681
 
                        BezierClose->setEnabled(false);
682
 
                        PolySplit->setEnabled(true);
683
 
                        ResetCont->setEnabled(false);
684
 
                        ResetContClip->setEnabled(false);
685
 
                        if (AbsMode->isChecked())
686
 
                        {
687
 
                                XSpin->setMinimum(-16777215);
688
 
                                YSpin->setMinimum(-16777215);
689
 
                        }
690
 
                        else
691
 
                        {
692
 
                                XSpin->setMinimum(0);
693
 
                                YSpin->setMinimum(0);
694
 
                        }
695
 
                }
696
 
                view->DrawNew();
697
 
        }
698
 
        connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
699
 
        connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
700
 
}
701
 
 
702
 
void NodePalette::HaveNode(bool have, bool mov)
703
 
{
704
 
        if (doc==0)
705
 
                return;
706
 
        bool setter = have ? true : false;
707
 
        if (doc->nodeEdit.SelNode.count() > 1)
708
 
        {
709
 
                XSpin->setEnabled(false);
710
 
                YSpin->setEnabled(false);
711
 
        }
712
 
        else
713
 
        {
714
 
                XSpin->setEnabled(setter);
715
 
                YSpin->setEnabled(setter);
716
 
        }
717
 
        if (setter == true)
718
 
        {
719
 
                if (doc->nodeEdit.EdPoints)
720
 
                        ResNode->setEnabled(setter);
721
 
                else
722
 
                        Res1Node->setEnabled(setter);
723
 
        }
724
 
        else
725
 
        {
726
 
                ResNode->setEnabled(setter);
727
 
                Res1Node->setEnabled(setter);
728
 
        }
729
 
        if (doc->nodeEdit.submode == NodeEditContext::MOVE_POINT)
730
 
        {
731
 
                disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
732
 
                disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
733
 
                if (mov)
734
 
                {
735
 
                        SymMove->setChecked(true);
736
 
                        AsymMove->setChecked(false);
737
 
                }
738
 
                else
739
 
                {
740
 
                        AsymMove->setChecked(true);
741
 
                        SymMove->setChecked(false);
742
 
                }
743
 
                connect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
744
 
                connect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
745
 
        }
746
 
        if (doc->nodeEdit.submode == NodeEditContext::DEL_POINT)
747
 
        {
748
 
                uint cc;
749
 
                bool leaveEd = false;
750
 
                PageItem*currItem=doc->m_Selection->itemAt(0);
751
 
                if (doc->nodeEdit.isContourLine)
752
 
                        cc = currItem->ContourLine.size();
753
 
                else
754
 
                        cc = currItem->PoLine.size();
755
 
                if (currItem->asPolyLine())
756
 
                {
757
 
                        if (cc < 5)
758
 
                                leaveEd = true;
759
 
                }
760
 
                else
761
 
                {
762
 
                        if (cc < 13)
763
 
                                leaveEd = true;
764
 
                }
765
 
                if (leaveEd)
766
 
                {
767
 
                        MoveN();
768
 
                        MoveControl->setEnabled(true);
769
 
                }
770
 
        }
771
 
}
772
 
 
773
 
void NodePalette::MoveK()
774
 
{
775
 
        if (doc==0)
776
 
                return;
777
 
        doc->nodeEdit.submode = NodeEditContext::MOVE_POINT;
778
 
        doc->nodeEdit.EdPoints = false;
779
 
        doc->nodeEdit.ClRe = -1;
780
 
        doc->nodeEdit.ClRe2 = -1;
781
 
        doc->nodeEdit.SegP1 = -1;
782
 
        doc->nodeEdit.SegP2 = -1;
783
 
        if (doc->m_Selection->count() > 0)
784
 
                doc->m_Selection->itemAt(0)->update();
785
 
        SymMove->setEnabled(true);
786
 
        AsymMove->setEnabled(true);
787
 
        Res1Node->setEnabled(true);
788
 
        ResNode->setEnabled(false);
789
 
        AddNode->setEnabled(false);
790
 
        DeleteNode->setEnabled(false);
791
 
        MoveNode->setChecked(false);
792
 
        MoveControl->setChecked(true);
793
 
        DeleteNode->setChecked(false);
794
 
        AddNode->setChecked(false);
795
 
}
796
 
 
797
 
void NodePalette::MoveN()
798
 
{
799
 
        if (doc==0)
800
 
                return;
801
 
        doc->nodeEdit.submode = NodeEditContext::MOVE_POINT;
802
 
        doc->nodeEdit.EdPoints = true;
803
 
        doc->nodeEdit.ClRe = -1;
804
 
        doc->nodeEdit.ClRe2 = -1;
805
 
        doc->nodeEdit.SegP1 = -1;
806
 
        doc->nodeEdit.SegP2 = -1;
807
 
        if (doc->m_Selection->count() > 0)
808
 
                doc->m_Selection->itemAt(0)->update();
809
 
        ResNode->setEnabled(true);
810
 
        AddNode->setEnabled(true);
811
 
        DeleteNode->setEnabled(true);
812
 
        SymMove->setEnabled(false);
813
 
        AsymMove->setEnabled(false);
814
 
        Res1Node->setEnabled(false);
815
 
        MoveNode->setChecked(true);
816
 
        MoveControl->setChecked(false);
817
 
        DeleteNode->setChecked(false);
818
 
        AddNode->setChecked(false);
819
 
}
820
 
 
821
 
void NodePalette::AddN()
822
 
{
823
 
        if (doc==0)
824
 
                return;
825
 
        doc->nodeEdit.submode = NodeEditContext::ADD_POINT;
826
 
        doc->nodeEdit.EdPoints = true;
827
 
        SymMove->setEnabled(false);
828
 
        AsymMove->setEnabled(false);
829
 
        ResNode->setEnabled(false);
830
 
        Res1Node->setEnabled(false);
831
 
        AddNode->setChecked(true);
832
 
        DeleteNode->setChecked(false);
833
 
}
834
 
 
835
 
void NodePalette::DelN()
836
 
{
837
 
        if (doc==0)
838
 
                return;
839
 
        doc->nodeEdit.submode = NodeEditContext::DEL_POINT;
840
 
        doc->nodeEdit.EdPoints = true;
841
 
        SymMove->setEnabled(false);
842
 
        AsymMove->setEnabled(false);
843
 
        ResNode->setEnabled(false);
844
 
        Res1Node->setEnabled(false);
845
 
        AddNode->setChecked(false);
846
 
        DeleteNode->setChecked(true);
847
 
}
848
 
 
849
 
void NodePalette::closeEvent(QCloseEvent *ce)
850
 
{
851
 
        if (doc != 0)
852
 
        {
853
 
                MoveN();
854
 
                doc->nodeEdit.ClRe = -1;
855
 
                doc->nodeEdit.ClRe2 = -1;
856
 
                doc->nodeEdit.SegP1 = -1;
857
 
                doc->nodeEdit.SegP2 = -1;
858
 
                doc->nodeEdit.SelNode.clear();
859
 
        }
860
 
        PolySplit->setEnabled( false );
861
 
        BezierClose->setEnabled( false );
862
 
        emit Schliessen();
863
 
        ScrPaletteBase::closeEvent(ce);
864
 
}
865
 
 
866
 
void NodePalette::EndEdit()
867
 
{
868
 
        if (doc != 0)
869
 
        {
870
 
                MoveN();
871
 
                doc->nodeEdit.ClRe = -1;
872
 
                doc->nodeEdit.ClRe2 = -1;
873
 
                doc->nodeEdit.SegP1 = -1;
874
 
                doc->nodeEdit.SegP2 = -1;
875
 
                doc->nodeEdit.SelNode.clear();
876
 
                EditCont->setChecked(false);
877
 
                ToggleConMode();
878
 
        }
879
 
        PolySplit->setEnabled( false );
880
 
        BezierClose->setEnabled( false );
881
 
        EditCont->setChecked(false);
882
 
        emit Schliessen();
883
 
}
884
 
 
885
 
void NodePalette::changeEvent(QEvent *e)
886
 
{
887
 
        if (e->type() == QEvent::LanguageChange)
888
 
        {
889
 
                languageChange();
890
 
        }
891
 
        else
892
 
                QWidget::changeEvent(e);
893
 
}
894
 
 
895
 
void NodePalette::languageChange()
896
 
{
897
 
        setWindowTitle( tr( "Nodes" ) );
898
 
        scalePercentage->setSuffix( tr(" %"));
899
 
 
900
 
        AbsMode->setTitle( tr("&Absolute Coordinates"));
901
 
        absToCanvas->setText( tr("to Canvas"));
902
 
        absToPage->setText( tr("to Page"));
903
 
        TextLabel1->setText( tr("&X-Pos:"));
904
 
        TextLabel2->setText( tr("&Y-Pos:"));
905
 
        EditCont->setText( tr("Edit &Contour Line"));
906
 
        ResetCont->setText( tr("&Reset Contour Line"));
907
 
        ResetContClip->setText( tr("Set Contour to Image Clip"));
908
 
        ResetShape2Clip->setText( tr("Set Shape to Image Clip"));
909
 
        editEditButton->setText( tr("&End Editing"));
910
 
        MoveNode->setToolTip( tr("Move Nodes"));
911
 
        MoveControl->setToolTip( tr("Move Control Points"));
912
 
        AddNode->setToolTip( tr("Add Nodes"));
913
 
        DeleteNode->setToolTip( tr("Delete Nodes"));
914
 
        AsymMove->setToolTip( tr("Move Control Points Independently"));
915
 
        SymMove->setToolTip( tr("Move Control Points Symmetrical"));
916
 
        ResNode->setToolTip( tr("Reset Control Points"));
917
 
        Res1Node->setToolTip( tr("Reset this Control Point"));
918
 
        PolySplit->setToolTip( tr("Open a Polygon or Cuts a Bezier Curve"));
919
 
        BezierClose->setToolTip( tr("Close this Bezier Curve"));
920
 
        PolyMirrorH->setToolTip( tr("Mirror the Path Horizontally"));
921
 
        PolyMirrorV->setToolTip( tr("Mirror the Path Vertically"));
922
 
        PolyShearR->setToolTip( tr("Shear the Path Horizontally to the Right"));
923
 
        PolyShearL->setToolTip( tr("Shear the Path Horizontally to the Left"));
924
 
        PolyShearU->setToolTip( tr("Shear the Path Vertically Up"));
925
 
        PolyShearD->setToolTip( tr("Shear the Path Vertically Down"));
926
 
        RotateCCW->setToolTip( tr("Rotate the Path Counter-Clockwise"));
927
 
        RotateCW->setToolTip( tr("Rotate the Path Clockwise"));
928
 
        Shrink->setToolTip( tr("Shrink the Size of the Path by shown %"));
929
 
        Expand->setToolTip( tr("Enlarge the Size of the Path by shown %"));
930
 
        Reduce->setToolTip( tr("Reduce the Size of the Path by the shown value"));
931
 
        Enlarge->setToolTip( tr("Enlarge the Size of the Path by the shown value"));
932
 
        RotVal->setToolTip( tr("Angle of Rotation"));
933
 
        scalePercentage->setToolTip( tr("% to Enlarge or Shrink By"));
934
 
        scaleDistance->setToolTip( tr("Value to Enlarge or Shrink By"));
935
 
        EditCont->setToolTip( tr("Activate Contour Line Editing Mode"));
936
 
        ResetCont->setToolTip( tr("Reset the Contour Line to the Original Shape of the Frame"));
937
 
        ResetContClip->setToolTip( tr("Reset the Contour Line to the Clipping Path of the Image"));
938
 
        ResetShape2Clip->setToolTip( tr("Set the Shape to the Clipping Path of the Image"));
939
 
        AbsMode->setToolTip(  "<qt>" + tr("When checked use coordinates relative to the page, otherwise coordinates are relative to the Object.") + "</qt>");
940
 
}
941
 
 
942
 
void NodePalette::unitChange()
943
 
{
944
 
        if (doc==0)
945
 
                return;
946
 
        unitRatio = doc->unitRatio();
947
 
        scaleDistance->setNewUnit(doc->unitIndex());
948
 
}
949
 
 
950
 
ScribusDoc* NodePalette::currentDocument() const
951
 
{
952
 
        return doc;
953
 
}