Base class for widgets to enable signal handling.
More...
#include <TGUI/Signal.hpp>
|
| SignalWidgetBase ()=default |
| Default constructor.
|
|
| SignalWidgetBase (const SignalWidgetBase ©) |
| Copy constructor. More...
|
|
SignalWidgetBase & | operator= (const SignalWidgetBase &right) |
| Overload of assignment operator. More...
|
|
template<typename Func , typename... Args> |
unsigned int | connect (const std::string &signalNames, Func func, Args... args) |
| Connects a signal handler function to one or more signals. More...
|
|
template<typename Func , typename... Args> |
unsigned int | connectEx (const std::string &signalName, Func func, Args... args) |
| Connects a signal handler function to one or more signals. More...
|
|
void | disconnect (unsigned int id) |
| Disconnects a connection. More...
|
|
void | disconnectAll (const std::string &signalName) |
| Disconnect all connections from a certain signal. More...
|
|
void | disconnectAll () |
| Disconnect all connections from a all signals.
|
|
Base class for widgets to enable signal handling.
◆ SignalWidgetBase()
Copy constructor.
- Parameters
-
◆ connect()
template<typename Func , typename... Args>
unsigned int tgui::SignalWidgetBase::connect |
( |
const std::string & |
signalNames, |
|
|
Func |
func, |
|
|
Args... |
args |
|
) |
| |
|
inline |
Connects a signal handler function to one or more signals.
- Parameters
-
signalNames | Name of the signal, or multiple names split by spaces |
func | The function to connect |
args | The arguments that should be bound to the function |
- Returns
- Id of this connection, which you need if you want to disconnect it later
◆ connectEx()
template<typename Func , typename... Args>
unsigned int tgui::SignalWidgetBase::connectEx |
( |
const std::string & |
signalName, |
|
|
Func |
func, |
|
|
Args... |
args |
|
) |
| |
|
inline |
Connects a signal handler function to one or more signals.
- Parameters
-
signalName | Name of the signal, or multiple names split by spaces |
func | The function to connect. This last parameter of the function must be of type "const tgui::Callback&". |
args | The arguments that should be bound to the function. The amount of arguments should be exactly one less than the function needs. |
- Returns
- Id of this connection, which you need if you want to disconnect it later
◆ disconnect()
void tgui::SignalWidgetBase::disconnect |
( |
unsigned int |
id | ) |
|
Disconnects a connection.
- Parameters
-
id | The id that was returned by the connect function when this connection was made |
◆ disconnectAll()
void tgui::SignalWidgetBase::disconnectAll |
( |
const std::string & |
signalName | ) |
|
Disconnect all connections from a certain signal.
- Parameters
-
signalName | Name of the signal, or multiple names split by spaces, from which you want to disconnect all function handlers |
◆ operator=()
Overload of assignment operator.
- Parameters
-
- Returns
- Reference to itself
The documentation for this class was generated from the following file: