ManaPlus
Public Member Functions | Protected Attributes
SetupItemSliderInt Class Reference

#include <setupitem.h>

Inheritance diagram for SetupItemSliderInt:
SetupItemSliderList SetupItem ActionListener Widget2

Public Member Functions

 SetupItemSliderInt (const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, ListModel *const model, const int min, const int width, const OnTheFly onTheFly, const MainConfig mainConfig)
 
void addMoreControls ()
 
void fromWidget ()
 
void toWidget ()
 
- Public Member Functions inherited from SetupItemSliderList
 ~SetupItemSliderList ()
 
void createControls ()
 
void action (const ActionEvent &event)
 
void apply (const std::string &eventName)
 
- Public Member Functions inherited from SetupItem
 ~SetupItem ()
 
void load ()
 
virtual void save ()
 
void setWidget (Widget *widget)
 
WidgetgetWidget () const
 
ConfigurationgetConfig () const
 
virtual std::string getActionEventId () const
 
virtual void doAction ()
 
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 ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
 
const ColorgetThemeCharColor (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)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 

Protected Attributes

int mMin
 
- Protected Attributes inherited from SetupItemSliderList
HorizontContainermHorizont
 
LabelmLabel
 
SliderListmSlider
 
ListModelmModel
 
int mWidth
 
OnTheFly mOnTheFly
 
- Protected Attributes inherited from SetupItem
std::string mText
 
std::string mDescription
 
std::string mKeyName
 
SetupTabScrollmParent
 
std::string mEventName
 
std::string mValue
 
std::string mDefault
 
WidgetmWidget
 
std::list< Widget * > mTempWidgets
 
int mValueType
 
MainConfig mMainConfig
 
bool mUseDefault
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 

Additional Inherited Members

- Public Types inherited from SetupItem
enum  { VBOOL = 0 , VSTR , VINT , VNONE }
 
- Protected Member Functions inherited from SetupItemSliderList
 SetupItemSliderList (const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, ListModel *const model, const int width, const OnTheFly onTheFly, const MainConfig mainConfig)
 
 SetupItemSliderList (const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, ListModel *const model, const std::string &def, const int width, const OnTheFly onTheFly, const MainConfig mainConfig)
 
- Protected Member Functions inherited from SetupItem
 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)
 

Detailed Description

Definition at line 588 of file setupitem.h.

Constructor & Destructor Documentation

◆ SetupItemSliderInt()

SetupItemSliderInt::SetupItemSliderInt ( const std::string &  text,
const std::string &  description,
const std::string &  keyName,
SetupTabScroll *const  parent,
const std::string &  eventName,
ListModel *const  model,
const int  min,
const int  width,
const OnTheFly  onTheFly,
const MainConfig  mainConfig 
)

Definition at line 1332 of file setupitem.cpp.

1341  :
1342  SetupItemSliderList(text, description, keyName, parent, eventName,
1343  model, width, onTheFly, mainConfig),
1344  mMin(min)
1345 {
1346  createControls();
1347 }
SetupItemSliderList(const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, ListModel *const model, const int width, const OnTheFly onTheFly, const MainConfig mainConfig)
Definition: setupitem.cpp:1179

References SetupItemSliderList::createControls().

Member Function Documentation

◆ addMoreControls()

void SetupItemSliderInt::addMoreControls ( )
virtual

Implements SetupItemSliderList.

Definition at line 1349 of file setupitem.cpp.

1350 {
1351  toWidget();
1352 }

References toWidget().

◆ fromWidget()

void SetupItemSliderInt::fromWidget ( )
virtual

Reimplemented from SetupItemSliderList.

Definition at line 1354 of file setupitem.cpp.

1355 {
1356  if (mSlider == nullptr)
1357  return;
1358 
1360 }
SliderList * mSlider
Definition: setupitem.h:559
std::string mValue
Definition: setupitem.h:139
int getSelected() const
Definition: sliderlist.h:73
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774

References SliderList::getSelected(), mMin, SetupItemSliderList::mSlider, SetupItem::mValue, and Catch::toString().

◆ toWidget()

void SetupItemSliderInt::toWidget ( )
virtual

Reimplemented from SetupItemSliderList.

Definition at line 1362 of file setupitem.cpp.

1363 {
1364  if (mSlider == nullptr)
1365  return;
1366 
1367  mSlider->setSelected(atoi(mValue.c_str()) - mMin);
1368 }
void setSelected(const int idx)
Definition: sliderlist.cpp:213

References mMin, SetupItemSliderList::mSlider, SetupItem::mValue, and SliderList::setSelected().

Referenced by addMoreControls().

Field Documentation

◆ mMin

int SetupItemSliderInt::mMin
protected

Definition at line 611 of file setupitem.h.

Referenced by fromWidget(), and toWidget().


The documentation for this class was generated from the following files: