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 30 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 31 of file setupbuttonitem.cpp.

References BUTTON_SKIN, createControls(), SetupItem::mValueType, SetupItem::mWidget, and SetupItem::VSTR.

36  :
37  SetupItem(text, description, "", parent, eventName, MainConfig_false),
38  mHorizont(nullptr),
39  mButton(nullptr)
40 {
41  mValueType = VSTR;
42  mWidget = new Button(this,
43  text,
44  actionEventId,
46  listener);
48 }
Definition: button.h:96
int mValueType
Definition: setupitem.h:146
const std::string BUTTON_SKIN
Definition: button.h:88
Widget * mWidget
Definition: setupitem.h:142
const bool MainConfig_false
Definition: mainconfig.h:29
HorizontContainer * mHorizont
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:54

◆ ~SetupButtonItem()

SetupButtonItem::~SetupButtonItem ( )

Definition at line 50 of file setupbuttonitem.cpp.

References mButton, mHorizont, and SetupItem::mWidget.

51 {
52  mHorizont = nullptr;
53  mWidget = nullptr;
54  mButton = nullptr;
55 }
Widget * mWidget
Definition: setupitem.h:142
HorizontContainer * mHorizont

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 93 of file setupbuttonitem.cpp.

94 {
95 }

◆ apply()

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

Reimplemented from SetupItem.

Definition at line 97 of file setupbuttonitem.cpp.

98 {
99 }

◆ cancel()

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

Reimplemented from SetupItem.

Definition at line 61 of file setupbuttonitem.cpp.

62 {
63 }

◆ createControls()

void SetupButtonItem::createControls ( )

Definition at line 73 of file setupbuttonitem.cpp.

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

Referenced by SetupButtonItem().

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

◆ externalUpdated()

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

Reimplemented from SetupItem.

Definition at line 65 of file setupbuttonitem.cpp.

66 {
67 }

◆ fromWidget()

void SetupButtonItem::fromWidget ( )
virtual

Implements SetupItem.

Definition at line 85 of file setupbuttonitem.cpp.

86 {
87 }

◆ rereadValue()

void SetupButtonItem::rereadValue ( )
virtual

Reimplemented from SetupItem.

Definition at line 69 of file setupbuttonitem.cpp.

70 {
71 }

◆ save()

void SetupButtonItem::save ( )
virtual

Reimplemented from SetupItem.

Definition at line 57 of file setupbuttonitem.cpp.

58 {
59 }

◆ toWidget()

void SetupButtonItem::toWidget ( )
virtual

Implements SetupItem.

Definition at line 89 of file setupbuttonitem.cpp.

90 {
91 }

Field Documentation

◆ mButton

Button* SetupButtonItem::mButton
protected

Definition at line 66 of file setupbuttonitem.h.

Referenced by ~SetupButtonItem().

◆ mHorizont

HorizontContainer* SetupButtonItem::mHorizont
protected

Definition at line 65 of file setupbuttonitem.h.

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


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