mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
implemented choice editor with drop down list, todo: submenus
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@93 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <data/card.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <data/settings.hpp>
|
||||
#include <data/action/value.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ValueViewerP);
|
||||
typedef IndexMap<FieldP,StyleP> IndexMap_FieldP_StyleP;
|
||||
@@ -116,6 +117,15 @@ ValueViewerP DataViewer::makeViewer(const StyleP& style) {
|
||||
return style->makeViewer(*this, style);
|
||||
}
|
||||
|
||||
void DataViewer::onAction(const Action&, bool undone) {
|
||||
// TODO
|
||||
void DataViewer::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
FOR_EACH(v, viewers) {
|
||||
if (v->getValue() == action.valueP) {
|
||||
// refresh the viewer
|
||||
v->onAction(action, undone);
|
||||
onChange();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ class ValueViewer {
|
||||
inline const FieldP& getField() const { return styleP->fieldP; }
|
||||
/// Return the associated style
|
||||
inline const StyleP& getStyle() const { return styleP; }
|
||||
/// Return the associated value
|
||||
inline const ValueP& getValue() const { return valueP; }
|
||||
|
||||
// Draw this value
|
||||
virtual void draw(RotatedDC& dc) = 0;
|
||||
|
||||
Reference in New Issue
Block a user