Movement of objects with the arrow keys in symbol editor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@527 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-08 13:48:53 +00:00
parent b46d979f9e
commit b18dea0f69
9 changed files with 232 additions and 46 deletions
+22
View File
@@ -11,6 +11,7 @@
#include <gfx/bezier.hpp>
DECLARE_TYPEOF_COLLECTION(ControlPointP);
DECLARE_TYPEOF_COLLECTION(SymbolPartP);
// ----------------------------------------------------------------------------- : ControlPoint
@@ -108,6 +109,7 @@ SymbolPartP read_new<SymbolPart>(Reader& reader) {
reader.handle(_("type"), type);
if (type == _("shape") || type.empty()) return new_intrusive<SymbolShape>();
else if (type == _("symmetry")) return new_intrusive<SymbolSymmetry>();
else if (type == _("group")) return new_intrusive<SymbolGroup>();
else {
throw ParseError(_("Unsupported symbol part type: '") + type + _("'"));
}
@@ -218,6 +220,26 @@ IMPLEMENT_REFLECTION(SymbolSymmetry) {
}
}
// ----------------------------------------------------------------------------- : SymbolGroup
String SymbolGroup::typeName() const {
return _("group");
}
SymbolPartP SymbolGroup::clone() const {
SymbolGroupP part(new SymbolGroup(*this));
// also clone the parts inside
FOR_EACH(p, part->parts) {
p = p->clone();
}
return part;
}
IMPLEMENT_REFLECTION(SymbolGroup) {
REFLECT_BASE(SymbolPart);
REFLECT(parts);
}
// ----------------------------------------------------------------------------- : Symbol
IMPLEMENT_REFLECTION(Symbol) {