Files
MagicSetEditor2/src/gui/value/multiple_choice.hpp
T
twanvl fdb725963c Removed the need for a separate multiple choice thumbnail request. This does no longer rely on any evil unsafe casts.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@511 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-07-06 19:37:11 +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