ManaPlus
|
#include <setupitem.h>
Public Types | |
enum | { VBOOL = 0 , VSTR , VINT , VNONE } |
Public Member Functions | |
~SetupItem () | |
void | load () |
virtual void | save () |
virtual void | fromWidget ()=0 |
virtual void | toWidget ()=0 |
void | setWidget (Widget *widget) |
Widget * | getWidget () const |
Configuration * | getConfig () const |
virtual std::string | getActionEventId () const |
void | action (const ActionEvent &event) |
virtual void | doAction () |
virtual void | apply (const std::string &eventName) |
virtual void | cancel (const std::string &eventName) |
virtual void | externalUpdated (const std::string &eventName) |
virtual void | externalUnloaded (const std::string &eventName) |
MainConfig | isMainConfig () const |
void | fixFirstItemSize (Widget *const widget) |
virtual void | rereadValue () |
void | setValue (const std::string &str) |
std::string | getValue () const |
std::string | getEventName () const |
Public Member Functions inherited from ActionListener | |
virtual | ~ActionListener () |
Public Member Functions inherited from Widget2 | |
virtual | ~Widget2 () |
const Color & | getThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE |
const Color & | getThemeCharColor (const signed char c, bool &valid) const A_INLINE |
virtual void | setWidget2 (const Widget2 *const widget) |
void | setPalette (int palette) |
void | checkPalette () |
void | setForegroundColor2 (const Color &color) |
Widget * | getWindow () const |
virtual void | setWindow (Widget *const window) |
Protected Member Functions | |
SetupItem (const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, const MainConfig mainConfig) | |
SetupItem (const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, const std::string &def, const MainConfig mainConfig) | |
Protected Member Functions inherited from ActionListener | |
ActionListener () | |
Protected Member Functions inherited from Widget2 | |
Widget2 (const Widget2 *const widget) | |
Protected Attributes | |
std::string | mText |
std::string | mDescription |
std::string | mKeyName |
SetupTabScroll * | mParent |
std::string | mEventName |
std::string | mValue |
std::string | mDefault |
Widget * | mWidget |
std::list< Widget * > | mTempWidgets |
int | mValueType |
MainConfig | mMainConfig |
bool | mUseDefault |
Protected Attributes inherited from Widget2 | |
int | mPaletteOffset |
Widget * | mWindow |
Color | mForegroundColor2 |
Definition at line 51 of file setupitem.h.
anonymous enum |
SetupItem::~SetupItem | ( | ) |
Definition at line 102 of file setupitem.cpp.
|
protected |
Definition at line 55 of file setupitem.cpp.
|
protected |
Definition at line 78 of file setupitem.cpp.
|
virtual |
Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.
actionEvent | The event of the action. |
Implements ActionListener.
Reimplemented in SetupQuickItem, SetupItemSound, SetupItemSliderList, SetupItemSlider2, SetupItemSlider, SetupItemLabel, SetupItemIntTextField, and SetupItemTextField.
Definition at line 163 of file setupitem.cpp.
References doAction(), Widget::getActionEventId(), ActionEvent::getId(), and mWidget.
|
virtual |
Reimplemented in SetupQuickItem, SetupItemSliderList, SetupItemSlider2, SetupItemSlider, SetupItemLabel, SetupItemIntTextField, SetupItemTextField, and SetupButtonItem.
Definition at line 177 of file setupitem.cpp.
References save().
|
virtual |
Reimplemented in SetupQuickItem, SetupItemTextField, and SetupButtonItem.
Definition at line 182 of file setupitem.cpp.
References load(), and toWidget().
|
virtual |
|
virtual |
Definition at line 194 of file setupitem.cpp.
Referenced by SetupTabScroll::externalUnloaded().
|
virtual |
Reimplemented in SetupQuickItem, SetupItemTextField, and SetupButtonItem.
Definition at line 188 of file setupitem.cpp.
References load(), and toWidget().
Referenced by SetupTabScroll::externalUpdated().
void SetupItem::fixFirstItemSize | ( | Widget *const | widget | ) |
Definition at line 198 of file setupitem.cpp.
References SetupTabScroll::getPreferredFirstItemSize(), Widget::getWidth(), mParent, and Widget::setWidth().
Referenced by SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), and SetupActionDropDown::createControls().
|
pure virtual |
Implemented in SetupActionDropDown, SetupQuickItem, SetupItemSliderInt, SetupItemSliderList, SetupItemSlider2, SetupItemSlider, SetupItemDropDownStr, SetupItemDropDown, SetupItemLabel, SetupItemIntTextField, SetupItemTextField, SetupItemCheckBox, and SetupButtonItem.
Referenced by doAction().
|
virtual |
Definition at line 155 of file setupitem.cpp.
References Widget::getActionEventId(), and mWidget.
Referenced by SetupTabScroll::addControl().
Configuration * SetupItem::getConfig | ( | ) | const |
Definition at line 106 of file setupitem.cpp.
References config, MainConfig_true, mMainConfig, and serverConfig.
|
inline |
Definition at line 110 of file setupitem.h.
References mEventName.
Referenced by Setup_Mods::saveMods().
|
inline |
Definition at line 107 of file setupitem.h.
References mValue.
Referenced by Setup_Mods::saveMods().
|
inline |
|
inline |
Definition at line 97 of file setupitem.h.
References mMainConfig.
Referenced by SetupTabScroll::externalUnloaded(), and SetupTabScroll::externalUpdated().
void SetupItem::load | ( | ) |
Definition at line 113 of file setupitem.cpp.
References Configuration::getBoolValue(), getConfig(), Configuration::getIntValue(), Configuration::getStringValue(), ConfigurationObject::getValue(), mDefault, mKeyName, mUseDefault, mValue, mValueType, Catch::toString(), VBOOL, VINT, VNONE, and VSTR.
Referenced by cancel(), SetupItemTextField::cancel(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupActionDropDown::createControls(), externalUpdated(), SetupItemTextField::externalUpdated(), rereadValue(), and SetupItemTextField::rereadValue().
|
virtual |
Reimplemented in SetupQuickItem, SetupItemTextField, and SetupButtonItem.
Definition at line 207 of file setupitem.cpp.
References load(), and toWidget().
Referenced by SetupTabScroll::reread().
|
virtual |
Reimplemented in SetupQuickItem, SetupItemTextField, and SetupButtonItem.
Definition at line 146 of file setupitem.cpp.
References getConfig(), mKeyName, mValue, and Configuration::setValue().
Referenced by SetupItemSlider::action(), SetupItemSlider2::action(), SetupItemSliderList::action(), apply(), SetupItemIntTextField::apply(), SetupItemSlider::apply(), SetupItemSlider2::apply(), SetupItemSliderList::apply(), and SetupItemTextField::save().
|
inline |
Definition at line 104 of file setupitem.h.
References mValue.
Referenced by Setup_Mods::loadMods().
|
inline |
|
pure virtual |
Implemented in SetupActionDropDown, SetupQuickItem, SetupItemSliderInt, SetupItemSliderList, SetupItemSlider2, SetupItemSlider, SetupItemDropDownStr, SetupItemDropDown, SetupItemLabel, SetupItemIntTextField, SetupItemTextField, SetupItemCheckBox, and SetupButtonItem.
Referenced by cancel(), externalUpdated(), Setup_Mods::loadMods(), and rereadValue().
|
protected |
Definition at line 141 of file setupitem.h.
Referenced by load().
|
protected |
Definition at line 131 of file setupitem.h.
Referenced by SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemLabel::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupQuickItem::createControls(), and SetupActionDropDown::createControls().
|
protected |
Definition at line 137 of file setupitem.h.
Referenced by SetupItemTextField::action(), SetupItemIntTextField::action(), SetupItemSound::action(), SetupQuickItem::action(), SetupItemSound::addMoreControls(), SetupItemTextField::apply(), SetupItemIntTextField::apply(), SetupItemSlider::apply(), SetupItemSlider2::apply(), SetupItemSliderList::apply(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupQuickItem::createControls(), SetupActionDropDown::createControls(), and getEventName().
|
protected |
Definition at line 133 of file setupitem.h.
|
protected |
Definition at line 149 of file setupitem.h.
Referenced by getConfig(), and isMainConfig().
|
protected |
Definition at line 135 of file setupitem.h.
Referenced by SetupButtonItem::createControls(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemLabel::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupQuickItem::createControls(), SetupActionDropDown::createControls(), and fixFirstItemSize().
|
protected |
Definition at line 145 of file setupitem.h.
|
protected |
Definition at line 129 of file setupitem.h.
Referenced by SetupItemTextField::action(), SetupItemIntTextField::action(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemLabel::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), and SetupActionDropDown::createControls().
|
protected |
Definition at line 151 of file setupitem.h.
Referenced by load().
|
protected |
Definition at line 139 of file setupitem.h.
Referenced by SetupItemTextField::cancel(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupActionDropDown::createControls(), SetupItemTextField::externalUpdated(), SetupItemCheckBox::fromWidget(), SetupItemTextField::fromWidget(), SetupItemIntTextField::fromWidget(), SetupItemDropDown::fromWidget(), SetupItemDropDownStr::fromWidget(), SetupItemSlider::fromWidget(), SetupItemSlider2::fromWidget(), SetupItemSliderList::fromWidget(), SetupItemSliderInt::fromWidget(), SetupActionDropDown::fromWidget(), getValue(), load(), SetupItemTextField::rereadValue(), save(), SetupItemTextField::save(), SetupItemDropDown::selectionByValue(), SetupItemDropDownStr::selectionByValue(), setValue(), SetupItemCheckBox::toWidget(), SetupItemTextField::toWidget(), SetupItemIntTextField::toWidget(), SetupItemSlider::toWidget(), SetupItemSlider2::toWidget(), SetupItemSliderList::toWidget(), SetupItemSliderInt::toWidget(), and SetupActionDropDown::toWidget().
|
protected |
Definition at line 147 of file setupitem.h.
Referenced by load(), SetupActionDropDown::SetupActionDropDown(), SetupButtonItem::SetupButtonItem(), SetupItemDropDown::SetupItemDropDown(), SetupItemDropDownStr::SetupItemDropDownStr(), SetupItemIntTextField::SetupItemIntTextField(), SetupItemLabel::SetupItemLabel(), SetupItemSlider::SetupItemSlider(), SetupItemSlider2::SetupItemSlider2(), SetupItemSliderList::SetupItemSliderList(), SetupItemTextField::SetupItemTextField(), and SetupQuickItem::SetupQuickItem().
|
protected |
Definition at line 143 of file setupitem.h.
Referenced by action(), SetupItemTextField::action(), SetupItemIntTextField::action(), SetupButtonItem::createControls(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemLabel::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), SetupQuickItem::createControls(), SetupActionDropDown::createControls(), getActionEventId(), getWidget(), SetupButtonItem::SetupButtonItem(), setWidget(), SetupActionDropDown::~SetupActionDropDown(), SetupButtonItem::~SetupButtonItem(), SetupItemCheckBox::~SetupItemCheckBox(), SetupItemDropDown::~SetupItemDropDown(), SetupItemDropDownStr::~SetupItemDropDownStr(), SetupItemIntTextField::~SetupItemIntTextField(), SetupItemLabel::~SetupItemLabel(), SetupItemSlider::~SetupItemSlider(), SetupItemSlider2::~SetupItemSlider2(), SetupItemSliderList::~SetupItemSliderList(), SetupItemTextField::~SetupItemTextField(), and SetupQuickItem::~SetupQuickItem().