Files
MagicSetEditor2/src/gui/value/multiple_choice.hpp
T
twanvl 97e0e8d6d6 Choice rendering now uses "style.image()" instead of "style.choice_images[value]";
Added script functions for working with multiple choice values;
Added in_context support for filter_rule;
Optimized toUpper/toLower because they are slow on windows (they use thread local storage and mutexes)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@427 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-06-17 13:13:56 +00:00

47 lines
1.7 KiB
C++

//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_GUI_VALUE_MULTIPLE_CHOICE
#define HEADER_GUI_VALUE_MULTIPLE_CHOICE
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <gui/value/editor.hpp>
#include <gui/value/choice.hpp>
#include <render/value/multiple_choice.hpp>
// ----------------------------------------------------------------------------- : MultipleChoiceValueEditor
/// An editor 'control' for editing MultipleChoiceValues
class MultipleChoiceValueEditor : public MultipleChoiceValueViewer, public ValueEditor {
public:
DECLARE_VALUE_EDITOR(MultipleChoice);
~MultipleChoiceValueEditor();
virtual void onValueChange();
virtual void determineSize(bool force_fit);
virtual bool onLeftDown (const RealPoint& pos, wxMouseEvent& ev);
virtual bool onChar(wxKeyEvent& ev);
virtual void onLoseFocus();
private:
DropDownListP drop_down;
vector<int> active; ///< Which choices are active? (note: vector<bool> is evil)
friend class DropDownMultipleChoiceList;
/// Initialize the drop down list
DropDownList& initDropDown();
/// Toggle a choice or on or off
void toggle(int id);
/// Toggle defaultness or on or off
void toggleDefault();
};
// ----------------------------------------------------------------------------- : EOF
#endif