Added 'filter' support to position function; Made sure sort script can depend on the value of the field itself.

Cleaned up some things, why is a blank image not thread safe?

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@548 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-10 18:57:41 +00:00
parent 7676c0b6b6
commit 8833d07c4a
20 changed files with 229 additions and 142 deletions
+3 -3
View File
@@ -8,7 +8,6 @@
#include <data/field/choice.hpp>
#include <util/io/package.hpp>
#include <wx/spinctrl.h>
#include <wx/imaglist.h>
DECLARE_TYPEOF_COLLECTION(ChoiceField::ChoiceP);
@@ -312,9 +311,10 @@ String ChoiceValue::toString() const {
return value();
}
bool ChoiceValue::update(Context& ctx) {
bool change = field().default_script.invokeOnDefault(ctx, value)
| field(). script.invokeOn(ctx, value);
Value::update(ctx);
return field().default_script.invokeOnDefault(ctx, value)
| field(). script.invokeOn(ctx, value);
return change;
}
IMPLEMENT_REFLECTION_NAMELESS(ChoiceValue) {
+3 -2
View File
@@ -91,9 +91,10 @@ String ColorValue::toString() const {
return _("<color>");
}
bool ColorValue::update(Context& ctx) {
bool change = field().default_script.invokeOnDefault(ctx, value)
| field(). script.invokeOn(ctx, value);
Value::update(ctx);
return field().default_script.invokeOnDefault(ctx, value)
| field(). script.invokeOn(ctx, value);
return change;
}
IMPLEMENT_REFLECTION_NAMELESS(ColorValue) {
+3 -2
View File
@@ -66,9 +66,10 @@ String InfoValue::toString() const {
return value;
}
bool InfoValue::update(Context& ctx) {
Value::update(ctx);
if (value.empty()) value = field().name;
return field().script.invokeOn(ctx, value);
bool change = field().script.invokeOn(ctx, value);
Value::update(ctx);
return change;
}
IMPLEMENT_REFLECTION_NAMELESS(InfoValue) {
+2 -1
View File
@@ -127,12 +127,13 @@ String TextValue::toString() const {
return untag_hide_sep(value());
}
bool TextValue::update(Context& ctx) {
Value::update(ctx);
updateAge();
WITH_DYNAMIC_ARG(last_update_age, last_update.get());
WITH_DYNAMIC_ARG(value_being_updated, this);
bool change = field().default_script.invokeOnDefault(ctx, value)
| field(). script.invokeOn(ctx, value);
if (change) last_update.update();
updateSortValue(ctx);
return change;
}