Scripts depending on content_something are re-updating after updating the content properties

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@480 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-04 17:15:08 +00:00
parent 95d4ca89f9
commit b3d04fe192
11 changed files with 63 additions and 34 deletions
+2 -1
View File
@@ -12,7 +12,7 @@
// ----------------------------------------------------------------------------- : TextValueViewer
void TextValueViewer::prepare(RotatedDC& dc) {
bool TextValueViewer::prepare(RotatedDC& dc) {
if (!style().mask_filename.empty() && !style().mask.ok()) {
// load contour mask
Image image;
@@ -22,6 +22,7 @@ void TextValueViewer::prepare(RotatedDC& dc) {
}
}
v.prepare(dc, value().value(), style(), viewer.getContext());
return true;
}
void TextValueViewer::draw(RotatedDC& dc) {
+1 -1
View File
@@ -21,7 +21,7 @@ class TextValueViewer : public ValueViewer {
public:
DECLARE_VALUE_VIEWER(Text) : ValueViewer(parent,style) {}
virtual void prepare(RotatedDC& dc);
virtual bool prepare(RotatedDC& dc);
virtual void draw(RotatedDC& dc);
virtual void onValueChange();
virtual void onStyleChange();
+3 -2
View File
@@ -40,8 +40,9 @@ class ValueViewer : public StyleListener {
inline const ValueP& getValue() const { return valueP; }
/// Prepare before drawing.
/** Scripts are updated after preparing, allowing */
virtual void prepare(RotatedDC& dc) {};
/** Should return true if a content property has changed
* Scripts are re-updated after preparing if they depend on content properties. */
virtual bool prepare(RotatedDC& dc) { return false; };
/// Draw this value
virtual void draw(RotatedDC& dc) = 0;