The Battle for Wesnoth  1.19.5+dev
Public Member Functions | List of all members
gui2::clickable_item Class Referenceabstract

Small concept class. More...

#include <clickable_item.hpp>

Inheritance diagram for gui2::clickable_item:

Public Member Functions

virtual ~clickable_item ()
 
virtual void connect_click_handler (const event::signal &signal)=0
 Connects a signal handler for a 'click' event. More...
 
virtual void disconnect_click_handler (const event::signal &signal)=0
 Disconnects a signal handler for a 'click' event. More...
 

Detailed Description

Small concept class.

Parts of the engine inherit this class so we can have generic clickable items. This is mainly for the button and the repeating button classes.

The reason for having the click functions here is that not all subclasses need to implement the click event in the same way; e.g. the repeating button clicks on the mouse down event and the normal button on the mouse click event.

Common signal handlers:

Definition at line 39 of file clickable_item.hpp.

Constructor & Destructor Documentation

◆ ~clickable_item()

virtual gui2::clickable_item::~clickable_item ( )
inlinevirtual

Definition at line 42 of file clickable_item.hpp.

Member Function Documentation

◆ connect_click_handler()

virtual void gui2::clickable_item::connect_click_handler ( const event::signal signal)
pure virtual

Connects a signal handler for a 'click' event.

What the click is depends on the subclass.

Parameters
signalThe signal to connect.

Implemented in gui2::repeating_button, and gui2::button.

◆ disconnect_click_handler()

virtual void gui2::clickable_item::disconnect_click_handler ( const event::signal signal)
pure virtual

Disconnects a signal handler for a 'click' event.

What the click is depends on the subclass.

Parameters
signalThe signal to disconnect (should be the same as send to the connect call.

Implemented in gui2::repeating_button, and gui2::button.


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