dialog for column selection; column settings are stored

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@77 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-19 22:30:19 +00:00
parent 1836cf4de9
commit 040e87e938
12 changed files with 261 additions and 22 deletions
+3 -1
View File
@@ -24,9 +24,10 @@ Field::Field()
, save_value (true)
, show_statistics (true)
, identifying (false)
, card_list_column (-1)
, card_list_column (100)
, card_list_width (100)
, card_list_allow (true)
, card_list_visible(false)
, card_list_align (ALIGN_LEFT)
, tab_index (0)
{}
@@ -47,6 +48,7 @@ IMPLEMENT_REFLECTION(Field) {
REFLECT(identifying);
REFLECT(card_list_column);
REFLECT(card_list_width);
REFLECT(card_list_visible);
REFLECT(card_list_allow);
REFLECT(card_list_name);
if (tag.reading() && card_list_name.empty()) card_list_name = name;
+3 -2
View File
@@ -42,9 +42,10 @@ class Field {
bool save_value; ///< Should values of this field be written to files? Can be false for script generated fields.
bool show_statistics; ///< Should this field appear as a group by choice in the statistics panel?
bool identifying; ///< Does this field give Card::identification()?
int card_list_column; ///< What column to use in the card list? -1 = don't list
int card_list_column; ///< What column to use in the card list?
UInt card_list_width; ///< Width of the card list column (pixels).
bool card_list_allow; ///< Is this field allowed to appear in the card list.
bool card_list_visible;///< Is this field shown in the card list?
bool card_list_allow; ///< Is this field allowed to appear in the card list?
String card_list_name; ///< Alternate name to use in card list.
Alignment card_list_align; ///< Alignment of the card list colummn.
int tab_index; ///< Tab index in editor
+16 -7
View File
@@ -30,6 +30,9 @@ ColumnSettings::ColumnSettings()
: width(100), position(COLUMN_NOT_INITIALIZED), visible(false)
{}
// dummy for ColumnSettings reflection
ScriptValueP toScript(const ColumnSettings&) { return script_nil; }
IMPLEMENT_REFLECTION(ColumnSettings) {
REFLECT(width);
REFLECT(position);
@@ -39,13 +42,17 @@ IMPLEMENT_REFLECTION(ColumnSettings) {
IMPLEMENT_REFLECTION(GameSettings) {
REFLECT(default_stylesheet);
REFLECT(default_export);
// REFLECT_N("cardlist columns", columns);
REFLECT_N("cardlist columns", columns);
REFLECT(sort_cards_by);
REFLECT(sort_cards_ascending);
}
IMPLEMENT_REFLECTION(StyleSheetSettings) {
// TODO
REFLECT(card_zoom);
REFLECT(card_angle);
REFLECT(card_anti_alias);
REFLECT(card_borders);
REFLECT(card_normal_export);
}
// ----------------------------------------------------------------------------- : Settings
@@ -89,7 +96,7 @@ ColumnSettings& Settings::columnSettingsFor(const Game& game, const Field& field
ColumnSettings& cs = gs.columns[field.name];
if (cs.position == COLUMN_NOT_INITIALIZED) {
// column info not set, initialize based on the game
cs.visible = field.card_list_column >= 0;
cs.visible = field.card_list_visible;
cs.position = field.card_list_column;
cs.width = field.card_list_width;
}
@@ -114,7 +121,9 @@ String Settings::settingsFile() {
}
IMPLEMENT_REFLECTION(Settings) {
// ioMseVersion(io, "settings", file_version);
tag.handleAppVersion();
tag.addAlias(300, _("style settings"), _("stylesheet settings"));
tag.addAlias(300, _("default style settings"), _("default stylesheet settings"));
REFLECT(recent_sets);
REFLECT(set_window_maximized);
REFLECT(set_window_width);
@@ -124,9 +133,9 @@ IMPLEMENT_REFLECTION(Settings) {
REFLECT(apprentice_location);
REFLECT(updates_url);
REFLECT(check_updates);
// ioAll(io, game_settings);
// ioStyleSettings(io);
// REFLECT(default_style_settings);
REFLECT(game_settings);
REFLECT(stylesheet_settings);
REFLECT(default_stylesheet_settings);
}
void Settings::read() {
+1 -1
View File
@@ -159,7 +159,7 @@ void SymbolPart::calculateBounds() {
// ----------------------------------------------------------------------------- : Symbol
IMPLEMENT_REFLECTION(Symbol) {
//%% version?
tag.handleAppVersion();
REFLECT(parts);
}