ManaPlus
Public Member Functions | Protected Attributes
SetupButtonItem Class Reference

#include <setupbuttonitem.h>

Inheritance diagram for SetupButtonItem:
SetupItem ActionListener Widget2

Public Member Functions

 SetupButtonItem (const std::string &text, const std::string &description, const std::string &actionEventId, SetupTabScroll *const parent, const std::string &eventName, ActionListener *const listener)
 
 ~SetupButtonItem ()
 
void createControls ()
 
void fromWidget ()
 
void toWidget ()
 
void action (const ActionEvent &event)
 
void apply (const std::string &eventName)
 
void cancel (const std::string &eventName)
 
void externalUpdated (const std::string &eventName)
 
void rereadValue ()
 
void save ()
 
- Public Member Functions inherited from SetupItem
 ~SetupItem ()
 
void load ()
 
void setWidget (Widget *widget)
 
WidgetgetWidget () const
 
ConfigurationgetConfig () const
 
virtual std::string getActionEventId () const
 
void action (const ActionEvent &event)
 
virtual void doAction ()
 
virtual void externalUnloaded (const std::string &eventName)
 
MainConfig isMainConfig () const
 
void fixFirstItemSize (Widget *const widget)
 
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

HorizontContainermHorizont
 
ButtonmButton
 
- 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 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 31 of file setupbuttonitem.h.

Constructor & Destructor Documentation

◆ SetupButtonItem()

SetupButtonItem::SetupButtonItem ( const std::string &  text,
const std::string &  description,
const std::string &  actionEventId,
SetupTabScroll *const  parent,
const std::string &  eventName,
ActionListener *const  listener 
)

Definition at line 32 of file setupbuttonitem.cpp.

37  :
38  SetupItem(text, description, "", parent, eventName, MainConfig_false),
39  mHorizont(nullptr),
40  mButton(nullptr)
41 {
42  mValueType = VSTR;
43  mWidget = new Button(this,
44  text,
45  actionEventId,
47  listener);
49 }
const std::string BUTTON_SKIN
Definition: button.h:89
Definition: button.h:102
HorizontContainer * mHorizont
Widget * mWidget
Definition: setupitem.h:143
SetupItem(const std::string &text, const std::string &description, const std::string &keyName, SetupTabScroll *const parent, const std::string &eventName, const MainConfig mainConfig)
Definition: setupitem.cpp:55
int mValueType
Definition: setupitem.h:147
const bool MainConfig_false
Definition: mainconfig.h:30

References BUTTON_SKIN, createControls(), anonymous_namespace{itemlinkhandler.cpp}::listener, SetupItem::mValueType, SetupItem::mWidget, and SetupItem::VSTR.

◆ ~SetupButtonItem()

SetupButtonItem::~SetupButtonItem ( )

Definition at line 51 of file setupbuttonitem.cpp.

52 {
53  mHorizont = nullptr;
54  mWidget = nullptr;
55  mButton = nullptr;
56 }

References mButton, mHorizont, and SetupItem::mWidget.

Member Function Documentation

◆ action()

void SetupButtonItem::action ( const ActionEvent actionEvent)
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.

Parameters
actionEventThe event of the action.

Implements ActionListener.

Definition at line 94 of file setupbuttonitem.cpp.

95 {
96 }

◆ apply()

void SetupButtonItem::apply ( const std::string &  eventName)
virtual

Reimplemented from SetupItem.

Definition at line 98 of file setupbuttonitem.cpp.

99 {
100 }

◆ cancel()

void SetupButtonItem::cancel ( const std::string &  eventName)
virtual

Reimplemented from SetupItem.

Definition at line 62 of file setupbuttonitem.cpp.

63 {
64 }

◆ createControls()

void SetupButtonItem::createControls ( )

Definition at line 74 of file setupbuttonitem.cpp.

75 {
76  mHorizont = new HorizontContainer(this, 32, 2);
77 
78  // TRANSLATORS: setup item button
80 
81  mParent->getContainer()->add2(mHorizont, true, 4);
82  mParent->addControl(this);
83 // mWidget->addActionListener(this);
84 }
void add(Widget *const widget)
SetupTabScroll * mParent
Definition: setupitem.h:135
void addControl(SetupItem *const widget)
VertContainer * getContainer() const
void add2(Widget *const widget, const bool resizable, const int spacing)

References HorizontContainer::add(), VertContainer::add2(), SetupTabScroll::addControl(), SetupTabScroll::getContainer(), mHorizont, SetupItem::mParent, and SetupItem::mWidget.

Referenced by SetupButtonItem().

◆ externalUpdated()

void SetupButtonItem::externalUpdated ( const std::string &  eventName)
virtual

Reimplemented from SetupItem.

Definition at line 66 of file setupbuttonitem.cpp.

67 {
68 }

◆ fromWidget()

void SetupButtonItem::fromWidget ( )
virtual

Implements SetupItem.

Definition at line 86 of file setupbuttonitem.cpp.

87 {
88 }

◆ rereadValue()

void SetupButtonItem::rereadValue ( )
virtual

Reimplemented from SetupItem.

Definition at line 70 of file setupbuttonitem.cpp.

71 {
72 }

◆ save()

void SetupButtonItem::save ( )
virtual

Reimplemented from SetupItem.

Definition at line 58 of file setupbuttonitem.cpp.

59 {
60 }

◆ toWidget()

void SetupButtonItem::toWidget ( )
virtual

Implements SetupItem.

Definition at line 90 of file setupbuttonitem.cpp.

91 {
92 }

Field Documentation

◆ mButton

Button* SetupButtonItem::mButton
protected

Definition at line 67 of file setupbuttonitem.h.

Referenced by ~SetupButtonItem().

◆ mHorizont

HorizontContainer* SetupButtonItem::mHorizont
protected

Definition at line 66 of file setupbuttonitem.h.

Referenced by createControls(), and ~SetupButtonItem().


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