insilmaril@0
|
1 |
#include "ornamentedobj.h"
|
insilmaril@0
|
2 |
#include "texteditor.h"
|
insilmaril@0
|
3 |
#include "mapeditor.h"
|
insilmaril@0
|
4 |
#include "linkablemapobj.h"
|
insilmaril@0
|
5 |
|
insilmaril@0
|
6 |
extern TextEditor *textEditor;
|
insilmaril@0
|
7 |
extern FlagRowObj *systemFlagsDefault;
|
insilmaril@0
|
8 |
extern FlagRowObj *standardFlagsDefault;
|
insilmaril@0
|
9 |
|
insilmaril@0
|
10 |
|
insilmaril@0
|
11 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
12 |
// OrnamentedObj
|
insilmaril@0
|
13 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
14 |
|
insilmaril@0
|
15 |
OrnamentedObj::OrnamentedObj():LinkableMapObj()
|
insilmaril@0
|
16 |
{
|
insilmaril@0
|
17 |
// cout << "Const OrnamentedObj ()\n";
|
insilmaril@0
|
18 |
init ();
|
insilmaril@0
|
19 |
}
|
insilmaril@0
|
20 |
|
insilmaril@408
|
21 |
OrnamentedObj::OrnamentedObj(QGraphicsScene* s) :LinkableMapObj(s)
|
insilmaril@0
|
22 |
{
|
insilmaril@408
|
23 |
// cout << "Const OrnamentedObj (s)\n";
|
insilmaril@0
|
24 |
init ();
|
insilmaril@0
|
25 |
}
|
insilmaril@0
|
26 |
|
insilmaril@408
|
27 |
OrnamentedObj::OrnamentedObj (OrnamentedObj* lmo) : LinkableMapObj (lmo->scene)
|
insilmaril@0
|
28 |
{
|
insilmaril@0
|
29 |
copy (lmo);
|
insilmaril@0
|
30 |
}
|
insilmaril@0
|
31 |
|
insilmaril@0
|
32 |
OrnamentedObj::~OrnamentedObj()
|
insilmaril@0
|
33 |
{
|
insilmaril@442
|
34 |
delete heading;
|
insilmaril@442
|
35 |
delete systemFlags;
|
insilmaril@442
|
36 |
delete standardFlags;
|
insilmaril@442
|
37 |
delete frame;
|
insilmaril@0
|
38 |
}
|
insilmaril@0
|
39 |
|
insilmaril@0
|
40 |
|
insilmaril@0
|
41 |
void OrnamentedObj::init ()
|
insilmaril@0
|
42 |
{
|
insilmaril@408
|
43 |
heading = new HeadingObj(scene);
|
insilmaril@0
|
44 |
heading->move (absPos.x(), absPos.y());
|
insilmaril@0
|
45 |
|
insilmaril@0
|
46 |
note.setNote("");
|
insilmaril@0
|
47 |
note.setFontHint (textEditor->getFontHintDefault() );
|
insilmaril@417
|
48 |
isNoteInEditor=false;
|
insilmaril@0
|
49 |
|
insilmaril@408
|
50 |
systemFlags=new FlagRowObj(scene);
|
insilmaril@0
|
51 |
systemFlags->clone(systemFlagsDefault);
|
insilmaril@0
|
52 |
systemFlags->setName ("systemFlags");
|
insilmaril@0
|
53 |
|
insilmaril@408
|
54 |
standardFlags=new FlagRowObj(scene);
|
insilmaril@0
|
55 |
standardFlags->clone(standardFlagsDefault);
|
insilmaril@0
|
56 |
standardFlags->setName ("standardFlags");
|
insilmaril@243
|
57 |
|
insilmaril@442
|
58 |
frame = new FrameObj (scene);
|
insilmaril@442
|
59 |
|
insilmaril@243
|
60 |
hideExport=false;
|
insilmaril@260
|
61 |
hidden=false;
|
insilmaril@243
|
62 |
|
insilmaril@243
|
63 |
url="";
|
insilmaril@243
|
64 |
vymLink="";
|
insilmaril@243
|
65 |
|
insilmaril@0
|
66 |
}
|
insilmaril@0
|
67 |
|
insilmaril@0
|
68 |
void OrnamentedObj::copy (OrnamentedObj* other)
|
insilmaril@0
|
69 |
{
|
insilmaril@0
|
70 |
LinkableMapObj::copy(other);
|
insilmaril@0
|
71 |
heading->copy(other->heading);
|
insilmaril@243
|
72 |
setColor (other->heading->getColor());
|
insilmaril@0
|
73 |
|
insilmaril@0
|
74 |
note.copy (other->note);
|
insilmaril@0
|
75 |
systemFlags->copy (other->systemFlags);
|
insilmaril@0
|
76 |
standardFlags->copy (other->standardFlags);
|
insilmaril@0
|
77 |
|
insilmaril@227
|
78 |
ornamentsBBox=other->ornamentsBBox;
|
insilmaril@227
|
79 |
|
insilmaril@243
|
80 |
hideExport=other->hideExport;
|
insilmaril@243
|
81 |
url=other->url;
|
insilmaril@243
|
82 |
vymLink=other->vymLink;
|
insilmaril@0
|
83 |
}
|
insilmaril@0
|
84 |
|
insilmaril@0
|
85 |
QString OrnamentedObj::getHeading()
|
insilmaril@0
|
86 |
{
|
insilmaril@0
|
87 |
return heading->text();
|
insilmaril@0
|
88 |
}
|
insilmaril@0
|
89 |
|
insilmaril@0
|
90 |
void OrnamentedObj::setLinkColor()
|
insilmaril@0
|
91 |
{
|
insilmaril@398
|
92 |
if (mapEditor->getMapLinkColorHint()==HeadingColor)
|
insilmaril@0
|
93 |
LinkableMapObj::setLinkColor (heading->getColor());
|
insilmaril@0
|
94 |
else
|
insilmaril@398
|
95 |
LinkableMapObj::setLinkColor (mapEditor->getMapDefLinkColor());
|
insilmaril@0
|
96 |
}
|
insilmaril@0
|
97 |
|
insilmaril@243
|
98 |
void OrnamentedObj::setColor (QColor col)
|
insilmaril@243
|
99 |
{
|
insilmaril@243
|
100 |
heading->setColor(col);
|
insilmaril@243
|
101 |
setLinkColor();
|
insilmaril@243
|
102 |
}
|
insilmaril@243
|
103 |
|
insilmaril@0
|
104 |
QColor OrnamentedObj::getColor ()
|
insilmaril@0
|
105 |
{
|
insilmaril@0
|
106 |
return heading->getColor();
|
insilmaril@0
|
107 |
}
|
insilmaril@0
|
108 |
|
insilmaril@476
|
109 |
FrameObj::FrameType OrnamentedObj::getFrameType()
|
insilmaril@442
|
110 |
{
|
insilmaril@442
|
111 |
return frame->getFrameType();
|
insilmaril@442
|
112 |
}
|
insilmaril@442
|
113 |
|
insilmaril@476
|
114 |
QString OrnamentedObj::getFrameTypeName()
|
insilmaril@476
|
115 |
{
|
insilmaril@476
|
116 |
return frame->getFrameTypeName();
|
insilmaril@476
|
117 |
}
|
insilmaril@476
|
118 |
|
insilmaril@476
|
119 |
void OrnamentedObj::setFrameType(const FrameObj::FrameType &t)
|
insilmaril@442
|
120 |
{
|
insilmaril@442
|
121 |
frame->setFrameType(t);
|
insilmaril@476
|
122 |
if (t == FrameObj::NoFrame)
|
insilmaril@476
|
123 |
linkpos=LinkableMapObj::Bottom;
|
insilmaril@442
|
124 |
else
|
insilmaril@476
|
125 |
linkpos=LinkableMapObj::Middle;
|
insilmaril@442
|
126 |
|
insilmaril@442
|
127 |
calcBBoxSize();
|
insilmaril@442
|
128 |
positionBBox();
|
insilmaril@442
|
129 |
requestReposition();
|
insilmaril@442
|
130 |
}
|
insilmaril@442
|
131 |
|
insilmaril@442
|
132 |
void OrnamentedObj::setFrameType(const QString &t)
|
insilmaril@442
|
133 |
{
|
insilmaril@442
|
134 |
frame->setFrameType(t);
|
insilmaril@476
|
135 |
if (frame->getFrameType() == FrameObj::NoFrame)
|
insilmaril@476
|
136 |
linkpos=LinkableMapObj::Bottom;
|
insilmaril@442
|
137 |
else
|
insilmaril@476
|
138 |
linkpos=LinkableMapObj::Middle;
|
insilmaril@442
|
139 |
|
insilmaril@442
|
140 |
calcBBoxSize();
|
insilmaril@442
|
141 |
positionBBox();
|
insilmaril@442
|
142 |
requestReposition();
|
insilmaril@442
|
143 |
}
|
insilmaril@442
|
144 |
|
insilmaril@476
|
145 |
void OrnamentedObj::setFramePadding (const int &i)
|
insilmaril@476
|
146 |
{
|
insilmaril@476
|
147 |
frame->setPadding (i);
|
insilmaril@476
|
148 |
calcBBoxSize();
|
insilmaril@476
|
149 |
positionBBox();
|
insilmaril@476
|
150 |
requestReposition();
|
insilmaril@476
|
151 |
}
|
insilmaril@476
|
152 |
|
insilmaril@476
|
153 |
int OrnamentedObj::getFramePadding ()
|
insilmaril@476
|
154 |
{
|
insilmaril@476
|
155 |
return frame->getPadding();
|
insilmaril@476
|
156 |
}
|
insilmaril@476
|
157 |
|
insilmaril@476
|
158 |
void OrnamentedObj::setFrameBorderWidth (const int &i)
|
insilmaril@476
|
159 |
{
|
insilmaril@476
|
160 |
frame->setBorderWidth(i);
|
insilmaril@476
|
161 |
calcBBoxSize();
|
insilmaril@476
|
162 |
positionBBox();
|
insilmaril@476
|
163 |
requestReposition();
|
insilmaril@476
|
164 |
}
|
insilmaril@476
|
165 |
|
insilmaril@476
|
166 |
int OrnamentedObj::getFrameBorderWidth()
|
insilmaril@476
|
167 |
{
|
insilmaril@476
|
168 |
return frame->getBorderWidth();
|
insilmaril@476
|
169 |
}
|
insilmaril@476
|
170 |
|
insilmaril@442
|
171 |
void OrnamentedObj::setFramePenColor(QColor col)
|
insilmaril@442
|
172 |
{
|
insilmaril@442
|
173 |
frame->setPenColor (col);
|
insilmaril@442
|
174 |
}
|
insilmaril@442
|
175 |
|
insilmaril@442
|
176 |
QColor OrnamentedObj::getFramePenColor()
|
insilmaril@442
|
177 |
{
|
insilmaril@442
|
178 |
return frame->getPenColor ();
|
insilmaril@442
|
179 |
}
|
insilmaril@442
|
180 |
|
insilmaril@442
|
181 |
void OrnamentedObj::setFrameBrushColor(QColor col)
|
insilmaril@442
|
182 |
{
|
insilmaril@442
|
183 |
frame->setBrushColor (col);
|
insilmaril@442
|
184 |
}
|
insilmaril@442
|
185 |
|
insilmaril@442
|
186 |
QColor OrnamentedObj::getFrameBrushColor()
|
insilmaril@442
|
187 |
{
|
insilmaril@442
|
188 |
return frame->getBrushColor ();
|
insilmaril@442
|
189 |
}
|
insilmaril@0
|
190 |
|
insilmaril@177
|
191 |
void OrnamentedObj::positionContents()
|
insilmaril@0
|
192 |
{
|
insilmaril@476
|
193 |
double d=frame->getPadding()/2;
|
insilmaril@177
|
194 |
double x=absPos.x();
|
insilmaril@177
|
195 |
double y=absPos.y();
|
insilmaril@227
|
196 |
|
insilmaril@227
|
197 |
double ox,oy; // Offset due to padding
|
insilmaril@227
|
198 |
|
insilmaril@227
|
199 |
ox=leftPad + d;
|
insilmaril@227
|
200 |
oy=topPad + d;
|
insilmaril@227
|
201 |
|
insilmaril@227
|
202 |
systemFlags-> move (ox +x , oy + y );
|
insilmaril@0
|
203 |
|
insilmaril@0
|
204 |
// vertical align heading to bottom
|
insilmaril@227
|
205 |
heading->move (ox + x + systemFlags->getBBox().width(),
|
insilmaril@227
|
206 |
oy + y + ornamentsBBox.height() - heading->getHeight()
|
insilmaril@0
|
207 |
);
|
insilmaril@227
|
208 |
standardFlags->move (ox +x + heading->getWidth() + systemFlags->getBBox().width() , oy + y );
|
insilmaril@227
|
209 |
|
insilmaril@408
|
210 |
ornamentsBBox.moveTopLeft ( QPointF ((int)(ox+x),(int)(oy+y)));
|
insilmaril@408
|
211 |
clickBox.moveTopLeft (QPointF ((int)(ox + x), (int)(oy + y)));
|
insilmaril@177
|
212 |
}
|
insilmaril@0
|
213 |
|
insilmaril@177
|
214 |
void OrnamentedObj::move (double x, double y)
|
insilmaril@177
|
215 |
{
|
insilmaril@177
|
216 |
MapObj::move (x,y);
|
insilmaril@177
|
217 |
positionContents();
|
insilmaril@0
|
218 |
updateLink();
|
insilmaril@0
|
219 |
requestReposition();
|
insilmaril@0
|
220 |
}
|
insilmaril@0
|
221 |
|
insilmaril@408
|
222 |
void OrnamentedObj::move (QPointF p)
|
insilmaril@0
|
223 |
{
|
insilmaril@0
|
224 |
move (p.x(), p.y());
|
insilmaril@0
|
225 |
}
|
insilmaril@0
|
226 |
|
insilmaril@0
|
227 |
void OrnamentedObj::moveBy (double x, double y)
|
insilmaril@0
|
228 |
{
|
insilmaril@0
|
229 |
|
insilmaril@0
|
230 |
MapObj::moveBy (x,y);
|
insilmaril@0
|
231 |
frame->moveBy (x,y);
|
insilmaril@0
|
232 |
systemFlags->moveBy (x,y);
|
insilmaril@0
|
233 |
standardFlags->moveBy (x,y);
|
insilmaril@0
|
234 |
heading->moveBy (x,y);
|
insilmaril@0
|
235 |
updateLink();
|
insilmaril@0
|
236 |
requestReposition();
|
insilmaril@0
|
237 |
}
|
insilmaril@0
|
238 |
|
insilmaril@408
|
239 |
void OrnamentedObj::moveBy (QPointF p)
|
insilmaril@0
|
240 |
{
|
insilmaril@0
|
241 |
moveBy (p.x(), p.y());
|
insilmaril@0
|
242 |
}
|
insilmaril@0
|
243 |
|
insilmaril@0
|
244 |
void OrnamentedObj::move2RelPos(double x, double y)
|
insilmaril@0
|
245 |
{
|
insilmaril@408
|
246 |
setRelPos (QPointF((int)x,(int)y));
|
insilmaril@388
|
247 |
if (parObj)
|
insilmaril@388
|
248 |
{
|
insilmaril@408
|
249 |
QPointF p=parObj->getChildPos();
|
insilmaril@388
|
250 |
move (p.x()+x, p.y() +y);
|
insilmaril@388
|
251 |
}
|
insilmaril@0
|
252 |
}
|
insilmaril@0
|
253 |
|
insilmaril@408
|
254 |
void OrnamentedObj::move2RelPos(QPointF p)
|
insilmaril@0
|
255 |
{
|
insilmaril@218
|
256 |
move2RelPos (p.x(),p.y());
|
insilmaril@0
|
257 |
}
|
insilmaril@0
|
258 |
|
insilmaril@0
|
259 |
void OrnamentedObj::setNote(QString s)
|
insilmaril@0
|
260 |
{
|
insilmaril@0
|
261 |
note.setNote(s);
|
insilmaril@417
|
262 |
updateNoteFlag();
|
insilmaril@0
|
263 |
}
|
insilmaril@0
|
264 |
|
insilmaril@0
|
265 |
void OrnamentedObj::setNote(NoteObj n)
|
insilmaril@0
|
266 |
{
|
insilmaril@0
|
267 |
note=n;
|
insilmaril@417
|
268 |
updateNoteFlag();
|
insilmaril@0
|
269 |
}
|
insilmaril@0
|
270 |
|
insilmaril@0
|
271 |
QString OrnamentedObj::getNote()
|
insilmaril@0
|
272 |
{
|
insilmaril@0
|
273 |
return note.getNote();
|
insilmaril@0
|
274 |
}
|
insilmaril@0
|
275 |
|
insilmaril@187
|
276 |
QString OrnamentedObj::getNoteASCII()
|
insilmaril@187
|
277 |
{
|
insilmaril@187
|
278 |
return note.getNoteASCII();
|
insilmaril@187
|
279 |
}
|
insilmaril@187
|
280 |
|
insilmaril@187
|
281 |
QString OrnamentedObj::getNoteOpenDoc()
|
insilmaril@187
|
282 |
{
|
insilmaril@187
|
283 |
return note.getNoteOpenDoc();
|
insilmaril@187
|
284 |
}
|
insilmaril@187
|
285 |
|
insilmaril@243
|
286 |
void OrnamentedObj::setURL(QString s)
|
insilmaril@243
|
287 |
{
|
insilmaril@243
|
288 |
url=s;
|
insilmaril@243
|
289 |
if (!url.isEmpty())
|
insilmaril@243
|
290 |
systemFlags->activate("url");
|
insilmaril@243
|
291 |
else
|
insilmaril@243
|
292 |
systemFlags->deactivate("url");
|
insilmaril@243
|
293 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
294 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
295 |
forceReposition();
|
insilmaril@243
|
296 |
}
|
insilmaril@243
|
297 |
|
insilmaril@243
|
298 |
QString OrnamentedObj::getURL()
|
insilmaril@243
|
299 |
{
|
insilmaril@243
|
300 |
return url;
|
insilmaril@243
|
301 |
}
|
insilmaril@243
|
302 |
|
insilmaril@243
|
303 |
void OrnamentedObj::setVymLink(QString s)
|
insilmaril@243
|
304 |
{
|
insilmaril@243
|
305 |
if (!s.isEmpty())
|
insilmaril@243
|
306 |
{
|
insilmaril@243
|
307 |
// We need the relative (from loading)
|
insilmaril@243
|
308 |
// or absolute path (from User event)
|
insilmaril@243
|
309 |
// and build the absolute path.
|
insilmaril@243
|
310 |
// Note: If we have relative, use path of
|
insilmaril@243
|
311 |
// current map to build absolute path
|
insilmaril@243
|
312 |
QDir d(s);
|
insilmaril@243
|
313 |
if (!d.path().startsWith ("/"))
|
insilmaril@243
|
314 |
{
|
insilmaril@243
|
315 |
QString p=mapEditor->getDestPath();
|
insilmaril@243
|
316 |
int i=p.findRev("/",-1);
|
insilmaril@243
|
317 |
d.setPath(p.left(i)+"/"+s);
|
insilmaril@243
|
318 |
d.convertToAbs();
|
insilmaril@243
|
319 |
}
|
insilmaril@243
|
320 |
vymLink=d.path();
|
insilmaril@243
|
321 |
systemFlags->activate("vymLink");
|
insilmaril@243
|
322 |
}
|
insilmaril@243
|
323 |
else
|
insilmaril@243
|
324 |
{
|
insilmaril@243
|
325 |
systemFlags->deactivate("vymLink");
|
insilmaril@243
|
326 |
vymLink="";
|
insilmaril@243
|
327 |
}
|
insilmaril@243
|
328 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
329 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
330 |
forceReposition();
|
insilmaril@243
|
331 |
}
|
insilmaril@243
|
332 |
|
insilmaril@243
|
333 |
QString OrnamentedObj::getVymLink()
|
insilmaril@243
|
334 |
{
|
insilmaril@243
|
335 |
return vymLink;
|
insilmaril@243
|
336 |
}
|
insilmaril@243
|
337 |
|
insilmaril@243
|
338 |
|
insilmaril@447
|
339 |
void OrnamentedObj::clearStandardFlags()
|
insilmaril@447
|
340 |
{
|
insilmaril@447
|
341 |
standardFlags->deactivateAll();
|
insilmaril@447
|
342 |
calcBBoxSize();
|
insilmaril@447
|
343 |
positionBBox();
|
insilmaril@447
|
344 |
move (absPos.x(), absPos.y() );
|
insilmaril@447
|
345 |
forceReposition();
|
insilmaril@447
|
346 |
}
|
insilmaril@447
|
347 |
|
insilmaril@103
|
348 |
void OrnamentedObj::toggleStandardFlag(QString f, bool exclusive)
|
insilmaril@0
|
349 |
{
|
insilmaril@103
|
350 |
standardFlags->toggle(f,exclusive);
|
insilmaril@0
|
351 |
calcBBoxSize();
|
insilmaril@0
|
352 |
positionBBox();
|
insilmaril@0
|
353 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
354 |
forceReposition();
|
insilmaril@0
|
355 |
}
|
insilmaril@0
|
356 |
|
insilmaril@0
|
357 |
void OrnamentedObj::activateStandardFlag(QString f)
|
insilmaril@0
|
358 |
{
|
insilmaril@0
|
359 |
standardFlags->activate(f);
|
insilmaril@0
|
360 |
calcBBoxSize();
|
insilmaril@0
|
361 |
positionBBox();
|
insilmaril@0
|
362 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
363 |
forceReposition();
|
insilmaril@0
|
364 |
}
|
insilmaril@0
|
365 |
|
insilmaril@366
|
366 |
void OrnamentedObj::deactivateStandardFlag(QString f)
|
insilmaril@366
|
367 |
{
|
insilmaril@366
|
368 |
standardFlags->deactivate(f);
|
insilmaril@366
|
369 |
calcBBoxSize();
|
insilmaril@366
|
370 |
positionBBox();
|
insilmaril@366
|
371 |
move (absPos.x(), absPos.y() );
|
insilmaril@366
|
372 |
forceReposition();
|
insilmaril@366
|
373 |
}
|
insilmaril@366
|
374 |
|
insilmaril@296
|
375 |
bool OrnamentedObj::isSetStandardFlag (QString f)
|
insilmaril@296
|
376 |
{
|
insilmaril@296
|
377 |
return standardFlags->isActive(f);
|
insilmaril@296
|
378 |
}
|
insilmaril@296
|
379 |
|
insilmaril@408
|
380 |
QString OrnamentedObj::getSystemFlagName(const QPointF &p)
|
insilmaril@0
|
381 |
{
|
insilmaril@0
|
382 |
return systemFlags->getFlagName(p);
|
insilmaril@0
|
383 |
}
|
insilmaril@0
|
384 |
|
insilmaril@236
|
385 |
bool OrnamentedObj::isActiveFlag (const QString & fname)
|
insilmaril@236
|
386 |
{
|
insilmaril@236
|
387 |
if (standardFlags->isActive (fname) ) return true;
|
insilmaril@236
|
388 |
return false;
|
insilmaril@236
|
389 |
}
|
insilmaril@236
|
390 |
|
insilmaril@417
|
391 |
void OrnamentedObj::getNoteFromTextEditor ()
|
insilmaril@417
|
392 |
{
|
insilmaril@417
|
393 |
note.setFilenameHint (textEditor->getFilename());
|
insilmaril@417
|
394 |
note.setFontHint (textEditor->getFontHint() );
|
insilmaril@417
|
395 |
setNote( textEditor->getText() );
|
insilmaril@417
|
396 |
}
|
insilmaril@417
|
397 |
|
insilmaril@0
|
398 |
void OrnamentedObj::updateNoteFlag()
|
insilmaril@0
|
399 |
{
|
insilmaril@417
|
400 |
bool noteEmpty;
|
insilmaril@417
|
401 |
if (isNoteInEditor)
|
insilmaril@417
|
402 |
noteEmpty=textEditor->isEmpty();
|
insilmaril@417
|
403 |
else
|
insilmaril@417
|
404 |
noteEmpty=note.isEmpty();
|
insilmaril@0
|
405 |
|
insilmaril@417
|
406 |
if (!noteEmpty)
|
insilmaril@417
|
407 |
{
|
insilmaril@417
|
408 |
if (systemFlags->isActive ("note")) return;
|
insilmaril@417
|
409 |
systemFlags->activate("note");
|
insilmaril@417
|
410 |
}
|
insilmaril@417
|
411 |
else
|
insilmaril@417
|
412 |
{
|
insilmaril@417
|
413 |
if (!systemFlags->isActive ("note")) return;
|
insilmaril@417
|
414 |
systemFlags->deactivate("note");
|
insilmaril@417
|
415 |
}
|
insilmaril@417
|
416 |
mapEditor->setChanged();
|
insilmaril@417
|
417 |
calcBBoxSize();
|
insilmaril@417
|
418 |
positionBBox();
|
insilmaril@417
|
419 |
move (absPos.x(), absPos.y() );
|
insilmaril@417
|
420 |
forceReposition();
|
insilmaril@0
|
421 |
|
insilmaril@417
|
422 |
}
|
insilmaril@0
|
423 |
|
insilmaril@366
|
424 |
void OrnamentedObj::updateFlagsToolbar()
|
insilmaril@366
|
425 |
{
|
insilmaril@366
|
426 |
standardFlags->updateToolbar();
|
insilmaril@366
|
427 |
}
|
insilmaril@366
|
428 |
|
insilmaril@243
|
429 |
void OrnamentedObj::setHideInExport(bool b)
|
insilmaril@243
|
430 |
{
|
insilmaril@260
|
431 |
if (parObj)
|
insilmaril@260
|
432 |
{
|
insilmaril@260
|
433 |
// Don't allow to MapCenter to be hidden
|
insilmaril@260
|
434 |
hideExport=b;
|
insilmaril@260
|
435 |
if (b)
|
insilmaril@260
|
436 |
systemFlags->activate("hideInExport");
|
insilmaril@260
|
437 |
else
|
insilmaril@260
|
438 |
systemFlags->deactivate("hideInExport");
|
insilmaril@260
|
439 |
calcBBoxSize();
|
insilmaril@260
|
440 |
positionBBox();
|
insilmaril@260
|
441 |
requestReposition();
|
insilmaril@260
|
442 |
}
|
insilmaril@243
|
443 |
}
|
insilmaril@243
|
444 |
|
insilmaril@243
|
445 |
bool OrnamentedObj::hideInExport()
|
insilmaril@243
|
446 |
{
|
insilmaril@243
|
447 |
return hideExport;
|
insilmaril@243
|
448 |
}
|
insilmaril@243
|
449 |
|
insilmaril@260
|
450 |
bool OrnamentedObj::isHidden()
|
insilmaril@260
|
451 |
{
|
insilmaril@260
|
452 |
return hidden;
|
insilmaril@260
|
453 |
}
|
insilmaril@260
|
454 |
|
insilmaril@243
|
455 |
QString OrnamentedObj::getOrnAttr()
|
insilmaril@243
|
456 |
{
|
insilmaril@243
|
457 |
QString posAttr;
|
insilmaril@252
|
458 |
|
insilmaril@388
|
459 |
if (depth==0)
|
insilmaril@388
|
460 |
posAttr=
|
insilmaril@408
|
461 |
attribut("absPosX",QString().setNum(absPos.x())) +
|
insilmaril@408
|
462 |
attribut("absPosY",QString().setNum(absPos.y()));
|
insilmaril@243
|
463 |
else
|
insilmaril@252
|
464 |
{
|
insilmaril@395
|
465 |
if (depth==1 || typeid (*this)==typeid (FloatImageObj))
|
insilmaril@388
|
466 |
posAttr=
|
insilmaril@408
|
467 |
attribut("relPosX",QString().setNum(relPos.x())) +
|
insilmaril@408
|
468 |
attribut("relPosY",QString().setNum(relPos.y()));
|
insilmaril@252
|
469 |
else
|
insilmaril@252
|
470 |
posAttr="";
|
insilmaril@252
|
471 |
}
|
insilmaril@243
|
472 |
|
insilmaril@243
|
473 |
QString urlAttr;
|
insilmaril@243
|
474 |
if (!url.isEmpty())
|
insilmaril@243
|
475 |
urlAttr=attribut ("url",url);
|
insilmaril@243
|
476 |
|
insilmaril@243
|
477 |
QString vymLinkAttr;
|
insilmaril@243
|
478 |
if (!vymLink.isEmpty())
|
insilmaril@243
|
479 |
vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
|
insilmaril@243
|
480 |
|
insilmaril@243
|
481 |
QString hideExpAttr;
|
insilmaril@243
|
482 |
if (hideExport)
|
insilmaril@243
|
483 |
hideExpAttr= attribut("hideInExport","true");
|
insilmaril@243
|
484 |
else
|
insilmaril@243
|
485 |
hideExpAttr="";
|
insilmaril@243
|
486 |
|
insilmaril@243
|
487 |
return posAttr +urlAttr +vymLinkAttr +getLinkAttr() +hideExpAttr;
|
insilmaril@243
|
488 |
}
|
insilmaril@243
|
489 |
|