Implemented CardsPanel with just a CardList for now

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@42 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-20 13:38:43 +00:00
parent b5cb26474a
commit 44b516036d
10 changed files with 284 additions and 49 deletions
+2
View File
@@ -39,6 +39,7 @@ IMPLEMENT_REFLECTION(Field) {
REFLECT(type);
}
REFLECT(name);
if (tag.reading()) name = cannocial_name_form(name);
REFLECT(description);
REFLECT(editable);
REFLECT(save_value);
@@ -48,6 +49,7 @@ IMPLEMENT_REFLECTION(Field) {
REFLECT(card_list_width);
REFLECT(card_list_allow);
REFLECT(card_list_name);
if (tag.reading() && card_list_name.empty()) card_list_name = name;
REFLECT_N("card_list_alignment", card_list_align);
REFLECT(tab_index);
}
+4 -2
View File
@@ -26,7 +26,7 @@ class Field {
Field();
virtual ~Field();
UInt index; ///< Used by IndexMap
size_t index; ///< Used by IndexMap
String name; ///< Name of the field, for refering to it from scripts and files
String description; ///< Description, used in status bar
bool editable; ///< Can values of this field be edited?
@@ -56,7 +56,9 @@ class Field {
template <>
shared_ptr<Field> read_new<Field>(Reader& reader);
inline void update_index(FieldP& f, size_t index) {
f->index = index;
}
// ----------------------------------------------------------------------------- : Style
+1 -1
View File
@@ -128,7 +128,7 @@ IMPLEMENT_REFLECTION_NO_GET_MEMBER(ChoiceField::Choice) {
if (isGroup() || (tag.reading() && tag.isComplex())) {
// complex values are groups
REFLECT(name);
REFLECT_N("group choice", default_name);
REFLECT_N("group_choice", default_name);
REFLECT(choices);
} else {
REFLECT_NAMELESS(name);
+4 -1
View File
@@ -45,7 +45,10 @@ SetView::~SetView() {
void SetView::setSet(const SetP& newSet) {
// no longer listening to old set
if (set) set->actions.removeListener(this);
if (set) {
onBeforeChangeSet();
set->actions.removeListener(this);
}
set = newSet;
// start listening to new set
if (set) set->actions.addListener(this);