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 285 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 598 of file setupitem.cpp.

601  :
602  SetupItem(text, description, "", parent, "", "", MainConfig_true),
603  mLabel(nullptr),
604  mIsSeparator(separator)
605 {
606  mValueType = VNONE;
607  createControls();
608 }
Separator mIsSeparator
Definition: setupitem.h:309
void createControls()
Definition: setupitem.cpp:616
Label * mLabel
Definition: setupitem.h:308
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_true
Definition: mainconfig.h:30

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

◆ ~SetupItemLabel()

SetupItemLabel::~SetupItemLabel ( )

Definition at line 610 of file setupitem.cpp.

611 {
612  mWidget = nullptr;
613  mLabel = nullptr;
614 }
Widget * mWidget
Definition: setupitem.h:143

References mLabel, and SetupItem::mWidget.

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 645 of file setupitem.cpp.

646 {
647 }

◆ apply()

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

Reimplemented from SetupItem.

Definition at line 649 of file setupitem.cpp.

650 {
651 }

◆ createControls()

void SetupItemLabel::createControls ( )

Definition at line 616 of file setupitem.cpp.

617 {
619  {
620  const std::string str(" \342\200\225\342\200\225\342\200\225"
621  "\342\200\225\342\200\225 ");
622  mLabel = new Label(this, std::string(str).append(mText).append(str));
623  }
624  else
625  {
626  mLabel = new Label(this, mText);
627  }
629 
630  mWidget = mLabel;
631  mParent->getContainer()->add1(mWidget, -1);
632  mParent->addControl(this);
633  mParent->addActionListener(this);
634  mWidget->addActionListener(this);
635 }
Definition: label.h:91
SetupTabScroll * mParent
Definition: setupitem.h:135
std::string mDescription
Definition: setupitem.h:131
std::string mText
Definition: setupitem.h:129
void addControl(SetupItem *const widget)
VertContainer * getContainer() const
void setToolTip(const std::string &str)
void add1(Widget *const widget, const int spacing)
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:252
const bool Separator_true
Definition: separator.h:30

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

Referenced by SetupItemLabel().

◆ fromWidget()

void SetupItemLabel::fromWidget ( )
virtual

Implements SetupItem.

Definition at line 637 of file setupitem.cpp.

638 {
639 }

◆ toWidget()

void SetupItemLabel::toWidget ( )
virtual

Implements SetupItem.

Definition at line 641 of file setupitem.cpp.

642 {
643 }

Field Documentation

◆ mIsSeparator

Separator SetupItemLabel::mIsSeparator
protected

Definition at line 309 of file setupitem.h.

Referenced by createControls().

◆ mLabel

Label* SetupItemLabel::mLabel
protected

Definition at line 308 of file setupitem.h.

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


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