26#ifndef TGUI_CANVAS_BASE_HPP
27#define TGUI_CANVAS_BASE_HPP
29#include <TGUI/Widgets/ClickableWidget.hpp>
33TGUI_MODULE_EXPORT
namespace tgui
42 using Ptr = std::shared_ptr<CanvasBase>;
43 using ConstPtr = std::shared_ptr<const CanvasBase>;
51 CanvasBase(
const char* typeName,
bool initRenderer);
89 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
94 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
99 bool m_ignoringMouseEvents =
false;
This class is used as base class for the backend-specific canvas widgets.
Definition CanvasBase.hpp:39
void ignoreMouseEvents(bool ignore=true)
Sets whether the widget should completely ignore mouse events and let them pass to the widgets behind...
TGUI_NODISCARD bool isIgnoringMouseEvents() const
Returns whether the widget is ignoring mouse events and letting them pass to the widgets behind it.
std::shared_ptr< CanvasBase > Ptr
Shared widget pointer.
Definition CanvasBase.hpp:42
std::shared_ptr< const CanvasBase > ConstPtr
Shared constant widget pointer.
Definition CanvasBase.hpp:43
TGUI_NODISCARD 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.
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
TGUI_NODISCARD bool canGainFocus() const override
Returns whether the widget can gain focus.
TGUI_NODISCARD bool isMouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39