Public Member Functions | Protected Attributes
GuiTableActionListener Class Reference

#include <guitableactionlistener.h>

Inheritance diagram for GuiTableActionListener:

Public Member Functions

 GuiTableActionListener (GuiTable *const table, Widget *const widget, const int row, const int column)
 ~GuiTableActionListener ()
void action (const ActionEvent &actionEvent)
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()

Protected Attributes

int mRow
int mColumn

Additional Inherited Members

- Protected Member Functions inherited from ActionListener
 ActionListener ()

Detailed Description

Definition at line 33 of file guitableactionlistener.h.

Constructor & Destructor Documentation

◆ GuiTableActionListener()

GuiTableActionListener::GuiTableActionListener ( GuiTable *const  table,
Widget *const  widget,
const int  row,
const int  column 

Definition at line 30 of file guitableactionlistener.cpp.

33  :
35  mTable(table),
36  mRow(row),
37  mColumn(column),
38  mWidget(widget)
39 {
40  if ((widget != nullptr) && (table != nullptr))
41  {
42  widget->addActionListener(this);
43  widget->setParent(table);
44  widget->setWindow(table->getWindow());
45  }
46 }
virtual void setWindow(Widget *const window)
Definition: widget2.h:97
Widget * getWindow() const
Definition: widget2.h:92
virtual void setParent(Widget *parent)
Definition: widget.h:626
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:252

◆ ~GuiTableActionListener()

GuiTableActionListener::~GuiTableActionListener ( )

Definition at line 48 of file guitableactionlistener.cpp.

49 {
50  if (mWidget != nullptr)
51  {
53  mWidget->setWindow(nullptr);
54  mWidget->setParent(nullptr);
55  }
56 }
void removeActionListener(ActionListener *const actionListener)
Definition: widget.cpp:257

References mWidget, Widget::removeActionListener(), Widget::setParent(), and Widget2::setWindow().

Member Function Documentation

◆ action()

void GuiTableActionListener::action ( const ActionEvent actionEvent)

Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.

actionEventThe event of the action.

Implements ActionListener.

Definition at line 58 of file guitableactionlistener.cpp.

59 {
60  if (mTable != nullptr)
61  {
64  }
65 }
void setSelected(const int row, const int column)
Definition: guitable.cpp:125
void distributeActionEvent()
Definition: widget.cpp:493

References Widget::distributeActionEvent(), mColumn, mRow, mTable, and GuiTable::setSelected().

Field Documentation

◆ mColumn

int GuiTableActionListener::mColumn

Definition at line 50 of file guitableactionlistener.h.

Referenced by action().

◆ mRow

int GuiTableActionListener::mRow

Definition at line 49 of file guitableactionlistener.h.

Referenced by action().

◆ mTable

GuiTable* GuiTableActionListener::mTable

Definition at line 48 of file guitableactionlistener.h.

Referenced by action().

◆ mWidget

Widget* GuiTableActionListener::mWidget

Definition at line 51 of file guitableactionlistener.h.

Referenced by ~GuiTableActionListener().

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