mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Fixed: CardViewers fighting over styles when multiple windows are open
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1184 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -23,11 +23,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA StyleP>);
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataViewer
|
||||
|
||||
DataViewer::DataViewer() : drawing(false) {}
|
||||
DataViewer::DataViewer() {}
|
||||
DataViewer::~DataViewer() {}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Drawing
|
||||
|
||||
IMPLEMENT_DYNAMIC_ARG(bool, drawing_card, false);
|
||||
|
||||
void DataViewer::draw(DC& dc) {
|
||||
StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet);
|
||||
RotatedDC rdc(dc, getRotation(),
|
||||
@@ -36,7 +38,7 @@ void DataViewer::draw(DC& dc) {
|
||||
}
|
||||
void DataViewer::draw(RotatedDC& dc, const Color& background) {
|
||||
if (!set) return; // no set specified, don't draw anything
|
||||
drawing = true;
|
||||
WITH_DYNAMIC_ARG(drawing_card, true);
|
||||
// fill with background color
|
||||
clearDC(dc.getDC(), background);
|
||||
// update style scripts
|
||||
@@ -69,7 +71,6 @@ void DataViewer::draw(RotatedDC& dc, const Color& background) {
|
||||
}
|
||||
}
|
||||
}
|
||||
drawing = false;
|
||||
}
|
||||
void DataViewer::drawViewer(RotatedDC& dc, ValueViewer& v) {
|
||||
v.draw(dc);
|
||||
|
||||
@@ -20,6 +20,8 @@ class Context;
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataViewer
|
||||
|
||||
DECLARE_DYNAMIC_ARG(bool, drawing_card);
|
||||
|
||||
/// A viewer can generate an image of some values, usually a card.
|
||||
class DataViewer : public SetView {
|
||||
public:
|
||||
@@ -98,7 +100,6 @@ class DataViewer : public SetView {
|
||||
|
||||
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
|
||||
CardP card; ///< The card that is currently displayed, if any
|
||||
bool drawing; ///< Are we currently drawing?
|
||||
mutable StyleSheetP stylesheet; ///< Stylesheet being used
|
||||
};
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#include <render/value/choice.hpp>
|
||||
#include <render/card/viewer.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(wxPoint);
|
||||
|
||||
// ----------------------------------------------------------------------------- : ChoiceValueViewer
|
||||
|
||||
IMPLEMENT_VALUE_VIEWER(Choice);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <render/card/viewer.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ColorField::ChoiceP);
|
||||
DECLARE_TYPEOF_COLLECTION(wxPoint);
|
||||
|
||||
// ----------------------------------------------------------------------------- : ColorValueViewer
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <render/card/viewer.hpp>
|
||||
#include <gui/util.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(wxPoint);
|
||||
|
||||
// ----------------------------------------------------------------------------- : ImageValueViewer
|
||||
|
||||
IMPLEMENT_VALUE_VIEWER(Image);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <gui/util.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(String);
|
||||
DECLARE_TYPEOF_COLLECTION(wxPoint);
|
||||
|
||||
// ----------------------------------------------------------------------------- : MultipleChoiceValueViewer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user