25#ifndef TGUI_CANVAS_BASE_HPP
26#define TGUI_CANVAS_BASE_HPP
28#include <TGUI/Widgets/ClickableWidget.hpp>
32TGUI_MODULE_EXPORT
namespace tgui
37 class TGUI_API CanvasBase :
public ClickableWidget
41 using Ptr = std::shared_ptr<CanvasBase>;
42 using ConstPtr = std::shared_ptr<const CanvasBase>;
50 CanvasBase(
const char* typeName,
bool initRenderer);
59 TGUI_DEPRECATED(
"Use setIgnoreMouseEvents instead") void
ignoreMouseEvents(
bool ignore = true);
88 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers) const override;
93 void load(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
98 bool m_ignoringMouseEvents = false;
37 class TGUI_API CanvasBase :
public ClickableWidget {
…};
bool isMouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
void ignoreMouseEvents(bool ignore=true)
Sets whether the widget should completely ignore mouse events and let them pass to the widgets behind...
std::unique_ptr< DataIO::Node > save(SavingRenderersMap &renderers) const override
Saves the widget as a tree node in order to save it to a file.
std::shared_ptr< CanvasBase > Ptr
Shared widget pointer.
Definition CanvasBase.hpp:41
std::shared_ptr< const CanvasBase > ConstPtr
Shared constant widget pointer.
Definition CanvasBase.hpp:42
bool isIgnoringMouseEvents() const
Returns whether the widget is ignoring mouse events and letting them pass to the widgets behind it.
bool canGainFocus() const override
Returns whether the widget can gain focus.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38