TGUI  0.7.4
tgui::SignalWidgetBase Class Reference

Base class for widgets to enable signal handling. More...

#include <Signal.hpp>

Inheritance diagram for tgui::SignalWidgetBase:
tgui::Widget tgui::ChatBox tgui::ClickableWidget tgui::ComboBox tgui::Container tgui::Knob tgui::ListBox tgui::MenuBar tgui::Scrollbar tgui::Slider tgui::Tab tgui::TextBox

Public Member Functions

 SignalWidgetBase ()=default
 Default constructor.
 
 SignalWidgetBase (const SignalWidgetBase &copy)
 Copy constructor. More...
 
SignalWidgetBaseoperator= (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.
 

Detailed Description

Base class for widgets to enable signal handling.

Constructor & Destructor Documentation

◆ SignalWidgetBase()

tgui::SignalWidgetBase::SignalWidgetBase ( const SignalWidgetBase copy)

Copy constructor.

Parameters
copyInstance to copy

Member Function Documentation

◆ 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
signalNamesName of the signal, or multiple names split by spaces
funcThe function to connect
argsThe 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
signalNameName of the signal, or multiple names split by spaces
funcThe function to connect. This last parameter of the function must be of type "const tgui::Callback&".
argsThe 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
idThe 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
signalNameName of the signal, or multiple names split by spaces, from which you want to disconnect all function handlers

◆ operator=()

SignalWidgetBase& tgui::SignalWidgetBase::operator= ( const SignalWidgetBase right)

Overload of assignment operator.

Parameters
rightInstance to assign
Returns
Reference to itself

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