New translation: Italian. Minor Improvements in mmap Import
1 #include "ornamentedobj.h"
2 #include "texteditor.h"
4 #include "linkablemapobj.h"
6 extern TextEditor *textEditor;
7 extern FlagRowObj *systemFlagsDefault;
8 extern FlagRowObj *standardFlagsDefault;
11 /////////////////////////////////////////////////////////////////
13 /////////////////////////////////////////////////////////////////
15 OrnamentedObj::OrnamentedObj():LinkableMapObj()
17 // cout << "Const OrnamentedObj ()\n";
21 OrnamentedObj::OrnamentedObj(QCanvas* c) :LinkableMapObj(c)
23 // cout << "Const OrnamentedObj\n";
27 OrnamentedObj::OrnamentedObj (OrnamentedObj* lmo) : LinkableMapObj (lmo->canvas)
32 OrnamentedObj::~OrnamentedObj()
36 delete (standardFlags);
41 void OrnamentedObj::init ()
43 heading = new HeadingObj(canvas);
44 heading->move (absPos.x(), absPos.y());
47 note.setFontHint (textEditor->getFontHintDefault() );
49 systemFlags=new FlagRowObj(canvas);
50 systemFlags->clone(systemFlagsDefault);
51 systemFlags->setName ("systemFlags");
53 standardFlags=new FlagRowObj(canvas);
54 standardFlags->clone(standardFlagsDefault);
55 standardFlags->setName ("standardFlags");
58 void OrnamentedObj::copy (OrnamentedObj* other)
60 LinkableMapObj::copy(other);
61 heading->copy(other->heading);
62 setColor (other->heading->getColor(),false);
64 note.copy (other->note);
65 systemFlags->copy (other->systemFlags);
66 standardFlags->copy (other->standardFlags);
70 QString OrnamentedObj::getHeading()
72 return heading->text();
75 void OrnamentedObj::setLinkColor()
77 if (mapEditor->getLinkColorHint()==HeadingColor)
78 LinkableMapObj::setLinkColor (heading->getColor());
80 LinkableMapObj::setLinkColor (mapEditor->getDefLinkColor());
83 QColor OrnamentedObj::getColor ()
85 return heading->getColor();
89 void OrnamentedObj::positionContents()
91 double d=frame->getBorder()/2;
94 systemFlags-> move (x + d, y + d );
96 // vertical align heading to bottom
97 int h=max (systemFlags->getBBox().height(), standardFlags->getBBox().height());
98 h=max (h,heading->getHeight());
99 heading->move (x + d + systemFlags->getBBox().width(),
100 y + d + h - heading->getHeight()
102 standardFlags->move (x + heading->getWidth() + systemFlags->getBBox().width() + d , y + d );
105 void OrnamentedObj::move (double x, double y)
113 void OrnamentedObj::move (QPoint p)
118 void OrnamentedObj::moveBy (double x, double y)
121 MapObj::moveBy (x,y);
123 systemFlags->moveBy (x,y);
124 standardFlags->moveBy (x,y);
125 heading->moveBy (x,y);
130 void OrnamentedObj::moveBy (QPoint p)
132 moveBy (p.x(), p.y());
135 void OrnamentedObj::move2RelPos(double x, double y)
138 move (parObj->getChildPos().x()+x, parObj->getChildPos().y()+y);
141 void OrnamentedObj::move2RelPos(QPoint p)
143 move2RelPos (p.x(),p.y());
146 void OrnamentedObj::setNote(QString s)
150 systemFlags->activate("note");
152 systemFlags->deactivate("note");
155 move (absPos.x(), absPos.y() );
159 void OrnamentedObj::setNote(NoteObj n)
163 systemFlags->activate("note");
165 systemFlags->deactivate("note");
168 move (absPos.x(), absPos.y() );
173 QString OrnamentedObj::getNote()
175 return note.getNote();
178 QString OrnamentedObj::getNoteASCII()
180 return note.getNoteASCII();
183 QString OrnamentedObj::getNoteOpenDoc()
185 return note.getNoteOpenDoc();
188 void OrnamentedObj::toggleStandardFlag(QString f, bool exclusive)
190 standardFlags->toggle(f,exclusive);
193 move (absPos.x(), absPos.y() );
197 void OrnamentedObj::activateStandardFlag(QString f)
199 standardFlags->activate(f);
202 move (absPos.x(), absPos.y() );
206 QString OrnamentedObj::getSystemFlagName(const QPoint &p)
208 return systemFlags->getFlagName(p);
211 void OrnamentedObj::updateNoteFlag()
215 // text in NoteEditor has changed, notify MapEditor
216 mapEditor->setChanged();
219 setNote( textEditor->getText() );
222 note.setFontHint (textEditor->getFontHint() );