ManaPlus
Public Member Functions | Protected Attributes
SetupItemLabel Class Reference

#include <setupitem.h>

Inheritance diagram for SetupItemLabel:
SetupItem ActionListener Widget2

Public Member Functions

 SetupItemLabel (const std::string &text, const std::string &description, SetupTabScroll *const parent, const Separator separator)
 
 ~SetupItemLabel ()
 
void createControls ()
 
void fromWidget ()
 
void toWidget ()
 
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

LabelmLabel
 
Separator mIsSeparator
 
- 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 284 of file setupitem.h.

Constructor & Destructor Documentation

◆ SetupItemLabel()

SetupItemLabel::SetupItemLabel ( const std::string &  text,
const std::string &  description,
SetupTabScroll *const  parent,
const Separator  separator 
)

Definition at line 597 of file setupitem.cpp.

References createControls(), SetupItem::mValueType, and SetupItem::VNONE.

600  :
601  SetupItem(text, description, "", parent, "", "", MainConfig_true),
602  mLabel(nullptr),
603  mIsSeparator(separator)
604 {
605  mValueType = VNONE;
606  createControls();
607 }
int mValueType
Definition: setupitem.h:146
Separator mIsSeparator
Definition: setupitem.h:308
const bool MainConfig_true
Definition: mainconfig.h:29
Label * mLabel
Definition: setupitem.h:307
void createControls()
Definition: setupitem.cpp:615
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

◆ ~SetupItemLabel()

SetupItemLabel::~SetupItemLabel ( )

Definition at line 609 of file setupitem.cpp.

References mLabel, and SetupItem::mWidget.

610 {
611  mWidget = nullptr;
612  mLabel = nullptr;
613 }
Widget * mWidget
Definition: setupitem.h:142
Label * mLabel
Definition: setupitem.h:307

Member Function Documentation

◆ action()

void SetupItemLabel::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.

Reimplemented from SetupItem.

Definition at line 644 of file setupitem.cpp.

645 {
646 }

◆ apply()

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

Reimplemented from SetupItem.

Definition at line 648 of file setupitem.cpp.

649 {
650 }

◆ createControls()

void SetupItemLabel::createControls ( )

Definition at line 615 of file setupitem.cpp.

References VertContainer::add1(), Widget::addActionListener(), SetupTabScroll::addControl(), SetupTabScroll::getContainer(), SetupItem::mDescription, mIsSeparator, mLabel, SetupItem::mParent, SetupItem::mText, SetupItem::mWidget, Separator_true, ToolTipListener::setToolTip(), and ServerCommandType::str.

Referenced by SetupItemLabel().

616 {
618  {
619  const std::string str(" \342\200\225\342\200\225\342\200\225"
620  "\342\200\225\342\200\225 ");
621  mLabel = new Label(this, std::string(str).append(mText).append(str));
622  }
623  else
624  {
625  mLabel = new Label(this, mText);
626  }
628 
629  mWidget = mLabel;
630  mParent->getContainer()->add1(mWidget, -1);
631  mParent->addControl(this);
632  mParent->addActionListener(this);
633  mWidget->addActionListener(this);
634 }
void addControl(SetupItem *const widget)
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:251
std::string mDescription
Definition: setupitem.h:130
VertContainer * getContainer() const
Separator mIsSeparator
Definition: setupitem.h:308
void add1(Widget *const widget, const int spacing)
Definition: label.h:87
Widget * mWidget
Definition: setupitem.h:142
SetupTabScroll * mParent
Definition: setupitem.h:134
const bool Separator_true
Definition: separator.h:29
Label * mLabel
Definition: setupitem.h:307
void setToolTip(const std::string &str)
std::string mText
Definition: setupitem.h:128

◆ fromWidget()

void SetupItemLabel::fromWidget ( )
virtual

Implements SetupItem.

Definition at line 636 of file setupitem.cpp.

637 {
638 }

◆ toWidget()

void SetupItemLabel::toWidget ( )
virtual

Implements SetupItem.

Definition at line 640 of file setupitem.cpp.

641 {
642 }

Field Documentation

◆ mIsSeparator

Separator SetupItemLabel::mIsSeparator
protected

Definition at line 308 of file setupitem.h.

Referenced by createControls().

◆ mLabel

Label* SetupItemLabel::mLabel
protected

Definition at line 307 of file setupitem.h.

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


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