mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
ImageValueViewer now works and the viewer control is refreshed
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@55 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -25,6 +25,10 @@ wxSize CardViewer::DoGetBestSize() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardViewer::onChange() {
|
||||||
|
Refresh(false);
|
||||||
|
}
|
||||||
|
|
||||||
void CardViewer::onPaint(wxPaintEvent&) {
|
void CardViewer::onPaint(wxPaintEvent&) {
|
||||||
wxBufferedPaintDC dc(this);
|
wxBufferedPaintDC dc(this);
|
||||||
dc.BeginDrawing();
|
dc.BeginDrawing();
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class CardViewer : public wxControl, public DataViewer {
|
|||||||
/// Return the desired size of control
|
/// Return the desired size of control
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
virtual void onChange();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ void DataViewer::setData(IndexMap<FieldP,ValueP>& values) {
|
|||||||
FOR_EACH(v, viewers) {
|
FOR_EACH(v, viewers) {
|
||||||
v->setValue(values[v->getField()]);
|
v->setValue(values[v->getField()]);
|
||||||
}
|
}
|
||||||
|
onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ class DataViewer : public SetView {
|
|||||||
/// Update the viewers and forward actions
|
/// Update the viewers and forward actions
|
||||||
virtual void onAction(const Action&, bool undone);
|
virtual void onAction(const Action&, bool undone);
|
||||||
|
|
||||||
|
/// Notification that the total image has changed
|
||||||
|
virtual void onChange() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
|
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ class Scriptable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
T value; ///< The actual value
|
||||||
OptionalScript script; ///< The optional script
|
OptionalScript script; ///< The optional script
|
||||||
T value; ///< The scripted value
|
|
||||||
|
|
||||||
DECLARE_REFLECTION();
|
DECLARE_REFLECTION();
|
||||||
};
|
};
|
||||||
@@ -100,7 +100,7 @@ void Reader::handle(Scriptable<T>& s) {
|
|||||||
s.script.unparsed = s.script.unparsed.substr(7);
|
s.script.unparsed = s.script.unparsed.substr(7);
|
||||||
s.script.parse(*this);
|
s.script.parse(*this);
|
||||||
} else {
|
} else {
|
||||||
handle(value);
|
handle(s.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ String trim(const String& s){
|
|||||||
}
|
}
|
||||||
|
|
||||||
String trim_left(const String& s) {
|
String trim_left(const String& s) {
|
||||||
size_t start = s.find_first_not_of(_(' '));
|
size_t start = s.find_first_not_of(_(" \t"));
|
||||||
if (start == String::npos) {
|
if (start == String::npos) {
|
||||||
return String();
|
return String();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user