TGUI
=
=
Download
Tutorials
1.x
0.9
0.8
Documentation
1.x
0.9
0.8
Examples
1.x
0.9
0.8
Community
TGUI
1.x-dev
Toggle main menu visibility
Loading...
Searching...
No Matches
include
TGUI
Widgets
CanvasBase.hpp
1
2
//
3
// TGUI - Texus' Graphical User Interface
4
// Copyright (C) 2012-2026 Bruno Van de Velde (vdv_b@tgui.eu)
5
//
6
// This software is provided 'as-is', without any express or implied warranty.
7
// In no event will the authors be held liable for any damages arising from the use of this software.
8
//
9
// Permission is granted to anyone to use this software for any purpose,
10
// including commercial applications, and to alter it and redistribute it freely,
11
// subject to the following restrictions:
12
//
13
// 1. The origin of this software must not be misrepresented;
14
// you must not claim that you wrote the original software.
15
// If you use this software in a product, an acknowledgment
16
// in the product documentation would be appreciated but is not required.
17
//
18
// 2. Altered source versions must be plainly marked as such,
19
// and must not be misrepresented as being the original software.
20
//
21
// 3. This notice may not be removed or altered from any source distribution.
22
//
24
25
#ifndef TGUI_CANVAS_BASE_HPP
26
#define TGUI_CANVAS_BASE_HPP
27
28
#include <TGUI/Widgets/ClickableWidget.hpp>
29
31
32
namespace
tgui
33
{
37
class
TGUI_API CanvasBase :
public
ClickableWidget
38
{
39
public
:
40
using
Ptr
= std::shared_ptr<CanvasBase>;
41
using
ConstPtr
= std::shared_ptr<const CanvasBase>;
42
49
CanvasBase(
const
char
* typeName,
bool
initRenderer);
50
58
TGUI_DEPRECATED(
"Use setIgnoreMouseEvents instead"
) void
ignoreMouseEvents
(
bool
ignore = true);
59
65
TGUI_DEPRECATED(
"Use getIgnoreMouseEvents instead"
) [[nodiscard]]
bool
isIgnoringMouseEvents
() const;
66
73
[[nodiscard]]
bool
canGainFocus
() const override;
74
79
[[nodiscard]]
bool
isMouseOnWidget
(Vector2f pos) const override;
80
82
83
protected:
87
[[nodiscard]] std::unique_ptr<DataIO::Node>
save
(SavingRenderersMap& renderers) const override;
88
92
void
load
(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
93
95
96
private:
97
bool
m_ignoringMouseEvents = false;
// TGUI_NEXT: Remove this property
98
};
99
}
// namespace tgui
100
102
103
#endif
// TGUI_CANVAS_BASE_HPP
tgui::CanvasBase::isMouseOnWidget
bool isMouseOnWidget(Vector2f pos) const override
Returns whether the mouse position (which is relative to the parent widget) lies on top of the widget...
tgui::CanvasBase::ignoreMouseEvents
void ignoreMouseEvents(bool ignore=true)
Sets whether the widget should completely ignore mouse events and let them pass to the widgets behind...
tgui::CanvasBase::save
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.
tgui::CanvasBase::Ptr
std::shared_ptr< CanvasBase > Ptr
Shared widget pointer.
Definition
CanvasBase.hpp:40
tgui::CanvasBase::ConstPtr
std::shared_ptr< const CanvasBase > ConstPtr
Shared constant widget pointer.
Definition
CanvasBase.hpp:41
tgui::CanvasBase::isIgnoringMouseEvents
bool isIgnoringMouseEvents() const
Returns whether the widget is ignoring mouse events and letting them pass to the widgets behind it.
tgui::CanvasBase::canGainFocus
bool canGainFocus() const override
Returns whether the widget can gain focus.
tgui::CanvasBase::load
void load(const std::unique_ptr< DataIO::Node > &node, const LoadingRenderersMap &renderers) override
Loads the widget from a tree of nodes.
tgui
Namespace that contains all TGUI functions and classes.
Definition
AbsoluteOrRelativeValue.hpp:37
Generated on
for TGUI by
1.18.0