events on script update; fix in cycle_sort; card list updated on value action

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@136 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-21 21:56:49 +00:00
parent 572881aa31
commit 2ba1d0b1b8
7 changed files with 47 additions and 11 deletions
+9
View File
@@ -141,3 +141,12 @@ TextValueAction* typing_action(const TextValueP& value, size_t start, size_t end
}
}
// ----------------------------------------------------------------------------- : Event
String ScriptValueEvent::getName(bool) const {
assert(false); // this action is just an event, getName shouldn't be called
throw InternalError(_("ScriptValueEvent::getName"));
}
void ScriptValueEvent::perform(bool) {
assert(false); // this action is just an event, it should not be performed
}
+15
View File
@@ -18,6 +18,7 @@
#include <util/action_stack.hpp>
#include <util/defaultable.hpp>
class Card;
DECLARE_POINTER_TYPE(Value);
DECLARE_POINTER_TYPE(TextValue);
DECLARE_POINTER_TYPE(ChoiceValue);
@@ -72,5 +73,19 @@ TextValueAction* toggle_format_action(const TextValueP& value, const String& tag
/// Typing in a TextValue, replace the selection [start...end) with replacement
TextValueAction* typing_action(const TextValueP& value, size_t start, size_t end, const String& replacement, const String& action_name);
// ----------------------------------------------------------------------------- : Event
/// Notification that a script caused a value to change
class ScriptValueEvent : public Action {
public:
inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {}
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
const Card* card; ///< Card the value is on
const Value* value; ///< The modified value
};
// ----------------------------------------------------------------------------- : EOF
#endif