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 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, text, actionEventId, listener);
44 }
Definition: button.h:94
int mValueType
Definition: setupitem.h:146
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 46 of file setupbuttonitem.cpp.

References mButton, mHorizont, and SetupItem::mWidget.

47 {
48  mHorizont = nullptr;
49  mWidget = nullptr;
50  mButton = nullptr;
51 }
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 89 of file setupbuttonitem.cpp.

90 {
91 }

◆ apply()

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

Reimplemented from SetupItem.

Definition at line 93 of file setupbuttonitem.cpp.

94 {
95 }

◆ cancel()

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

Reimplemented from SetupItem.

Definition at line 57 of file setupbuttonitem.cpp.

58 {
59 }

◆ createControls()

void SetupButtonItem::createControls ( )

Definition at line 69 of file setupbuttonitem.cpp.

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

Referenced by SetupButtonItem().

70 {
71  mHorizont = new HorizontContainer(this, 32, 2);
72 
73  // TRANSLATORS: setup item button
75 
76  mParent->getContainer()->add2(mHorizont, true, 4);
77  mParent->addControl(this);
78 // mWidget->addActionListener(this);
79 }
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 61 of file setupbuttonitem.cpp.

62 {
63 }

◆ fromWidget()

void SetupButtonItem::fromWidget ( )
virtual

Implements SetupItem.

Definition at line 81 of file setupbuttonitem.cpp.

82 {
83 }

◆ rereadValue()

void SetupButtonItem::rereadValue ( )
virtual

Reimplemented from SetupItem.

Definition at line 65 of file setupbuttonitem.cpp.

66 {
67 }

◆ save()

void SetupButtonItem::save ( )
virtual

Reimplemented from SetupItem.

Definition at line 53 of file setupbuttonitem.cpp.

54 {
55 }

◆ toWidget()

void SetupButtonItem::toWidget ( )
virtual

Implements SetupItem.

Definition at line 85 of file setupbuttonitem.cpp.

86 {
87 }

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: