mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
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:
@@ -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)
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user