paritially implemented MultipleChoice viewer/editor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@222 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-21 18:04:09 +00:00
parent fddc389e24
commit 0c6068d6a2
14 changed files with 139 additions and 25 deletions
+11 -7
View File
@@ -103,11 +103,15 @@ enum ChoicePopupStyle
};
// How should a choice value be rendered?
enum ChoiceRenderStyle
{ RENDER_TEXT = 0x01 // render the name as text
, RENDER_IMAGE = 0x10 // render an image
, RENDER_BOTH = RENDER_TEXT | RENDER_IMAGE
, RENDER_HIDDEN = 0x20 // don't render anything, only have a menu
, RENDER_HIDDEN_IMAGE = RENDER_HIDDEN | RENDER_IMAGE
{ RENDER_TEXT = 0x01 // render the name as text
, RENDER_IMAGE = 0x10 // render an image
, RENDER_HIDDEN = 0x20 // don't render anything, only have a menu
, RENDER_CHECKLIST = 0x100 // render as a checklist, intended for multiple choice
, RENDER_BOTH = RENDER_TEXT | RENDER_IMAGE
, RENDER_HIDDEN_IMAGE = RENDER_HIDDEN | RENDER_IMAGE
, RENDER_TEXT_CHECKLIST = RENDER_CHECKLIST | RENDER_TEXT
, RENDER_IMAGE_CHECKLIST = RENDER_CHECKLIST | RENDER_IMAGE
, RENDER_BOTH_CHECKLIST = RENDER_CHECKLIST | RENDER_BOTH
};
/// The Style for a ChoiceField
@@ -147,9 +151,9 @@ class ChoiceStyle : public Style {
/// The Value in a ChoiceField
class ChoiceValue : public Value {
public:
inline ChoiceValue(const ChoiceFieldP& field)
inline ChoiceValue(const ChoiceFieldP& field, bool initial_empty = false)
: Value(field)
, value(field->initial.empty()
, value(field->initial.empty() && !initial_empty
? field->choices->choiceName(0) // first choice
: field->initial, true)
{}