Choice images recomputed less often;

Implemented GraphType for choosing different layouts on the stats panel;
Added option to define order of graph groups;
Added busy cursor when loading recent file;
Parentheses in FOR_EACH macro

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@351 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-13 15:22:26 +00:00
parent cc036b94f3
commit 8d5fc6949f
11 changed files with 154 additions and 63 deletions
+16 -9
View File
@@ -29,10 +29,14 @@ StatsDimension::StatsDimension(const Field& field)
, numeric (false)
, show_empty (false)
{
// choice colors?
// choice field?
const ChoiceField* choice_field = dynamic_cast<const ChoiceField*>(&field);
if (choice_field) {
colors = choice_field->choice_colors;
int count = choice_field->choices->lastId();
for (int i = 0 ; i < count ; ++i) {
groups.push_back(choice_field->choices->choiceName(i));
}
}
// initialize script, card.{field_name}
Script& s = script.getScript();
@@ -50,6 +54,7 @@ IMPLEMENT_REFLECTION_NO_GET_MEMBER(StatsDimension) {
REFLECT(numeric);
REFLECT(show_empty);
REFLECT(colors);
REFLECT(groups);
}
}
@@ -69,13 +74,6 @@ StatsCategory::StatsCategory(const StatsDimensionP& dim)
, type(GRAPH_TYPE_BAR)
{}
IMPLEMENT_REFLECTION_ENUM(GraphType) {
VALUE_N("bar", GRAPH_TYPE_BAR);
VALUE_N("stack", GRAPH_TYPE_STACK);
VALUE_N("pie", GRAPH_TYPE_PIE);
VALUE_N("scatter", GRAPH_TYPE_SCATTER);
}
IMPLEMENT_REFLECTION_NO_GET_MEMBER(StatsCategory) {
if (!automatic) {
REFLECT(name);
@@ -102,4 +100,13 @@ void StatsCategory::find_dimensions(const vector<StatsDimensionP>& available) {
dimensions.push_back(dim);
}
}
}
}
// ----------------------------------------------------------------------------- : GraphType (from graph_type.hpp)
IMPLEMENT_REFLECTION_ENUM(GraphType) {
VALUE_N("bar", GRAPH_TYPE_BAR);
VALUE_N("pie", GRAPH_TYPE_PIE);
VALUE_N("stack", GRAPH_TYPE_STACK);
VALUE_N("scatter", GRAPH_TYPE_SCATTER);
}