TGUI  0.8-dev
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::Tabs tgui::TextBox

Public Member Functions

virtual ~SignalWidgetBase ()
 Virtual destructor.
 
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)
 Disconnects all connections from a certain signal. More...
 
void disconnectAll ()
 Disconnects all connections from a all signals.
 

Detailed Description

Base class for widgets to enable signal handling.

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)

Disconnects 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

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