Switched to a new coding style, which plays nicely with the Reader/Writer. This new style allows REFLECT to be used instead of REFLECT_N in most places.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@15 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-11 22:26:55 +00:00
parent 33abea6221
commit 9de743030e
51 changed files with 1041 additions and 767 deletions
+64
View File
@@ -0,0 +1,64 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <data/field/text.hpp>
// ----------------------------------------------------------------------------- : TextField
TextField::TextField()
: multi_line(false), move_cursor_with_sort(false)
, default_name(_("Default"))
{}
StyleP TextField::newStyle(const FieldP& thisP) const {
assert(thisP.get() == this);
return new_shared<TextStyle>();
}
ValueP TextField::newValue(const FieldP& thisP) const {
assert(thisP.get() == this);
return new_shared<TextValue>();
}
FieldP TextField::clone() const {
return new_shared1<TextField>(*this);
}
String TextField::typeName() const {
return _("text");
}
IMPLEMENT_REFLECTION(TextField) {
REFLECT_BASE(Field);
REFLECT(multi_line);
// REFLECT(script);
// REFLECT_N("default", default_script);
REFLECT(move_cursor_with_sort);
REFLECT(default_name);
}
// ----------------------------------------------------------------------------- : TextStyle
StyleP TextStyle::clone() const {
return new_shared1<TextStyle>(*this);
}
IMPLEMENT_REFLECTION(TextStyle) {
REFLECT_BASE(Style);
}
// ----------------------------------------------------------------------------- : TextValue
ValueP TextValue::clone() const {
return new_shared1<TextValue>(*this);
}
IMPLEMENT_REFLECTION(TextValue) {
REFLECT_BASE(Value);
}