Implemented the context management part of the ScriptManager

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@61 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-30 21:39:58 +00:00
parent 0a3a089c98
commit 0caaf01a78
22 changed files with 288 additions and 58 deletions
+10 -1
View File
@@ -13,10 +13,13 @@
#include <util/reflect.hpp>
#include <util/alignment.hpp>
#include <script/scriptable.hpp>
#include <script/dependency.hpp>
DECLARE_POINTER_TYPE(Field);
DECLARE_POINTER_TYPE(Style);
DECLARE_POINTER_TYPE(Value);
class Context;
class Dependency;
// for DataViewer/editor
class DataViewer; class DataEditor;
@@ -44,7 +47,7 @@ class Field {
String card_list_name; ///< Alternate name to use in card list.
Alignment card_list_align; ///< Alignment of the card list colummn.
int tab_index; ///< Tab index in editor
// vector<Dependency> dependentScripts; // scripts that depend on values of this field
vector<Dependency> dependent_scripts; ///< Scripts that depend on values of this field
/// Creates a new Value corresponding to this Field
/** thisP is a smart pointer to this */
@@ -55,6 +58,9 @@ class Field {
/// Type of this field
virtual String typeName() const = 0;
/// Add the given dependency to the dependet_scripts list for the variables this field depends on
virtual void initDependencies(Context&, const Dependency&) const {}
private:
DECLARE_REFLECTION_VIRTUAL();
};
@@ -90,6 +96,9 @@ class Style {
/** thisP is a smart pointer to this */
virtual ValueEditorP makeEditor(DataEditor& parent, const StyleP& thisP) = 0;
/// Add the given dependency to the dependet_scripts list for the variables this style depends on
virtual void initDependencies(Context&, const Dependency&) const;
private:
DECLARE_REFLECTION_VIRTUAL();
};