FifeGUI 0.3.0
A C++ GUI library designed for games.
tab.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_WIDGETS_TAB_HPP_
6#define INCLUDE_FIFECHAN_WIDGETS_TAB_HPP_
7
8// Standard library includes
9#include <map>
10#include <string>
11
12// Platform config include
13#include "fifechan/platform.hpp"
14
15// Project headers (subdirs before local)
16#include "fifechan/listeners/mouselistener.hpp"
17#include "fifechan/widgets/container.hpp"
18
19namespace fcn
20{
21 class TabbedArea;
22
30 class FIFEGUI_API Tab : public MouseListener, public Container
31 {
32 public:
33 Tab();
34
35 ~Tab() override;
36
37 Tab(Tab const &) = delete;
38 Tab& operator=(Tab const &) = delete;
39 Tab(Tab&&) = delete;
40 Tab& operator=(Tab&&) = delete;
41
48 void setTabbedArea(TabbedArea* tabbedArea);
49
57
58 // Inherited from Widget
59
64 void adjustSize() override;
65
66 Rectangle getChildrenArea() override;
67
68 void draw(Graphics* graphics) override;
69
70 // Inherited from MouseListener
71
72 void mouseEntered(MouseEvent& mouseEvent) override;
73
74 void mouseExited(MouseEvent& mouseEvent) override;
75
76 protected:
80 bool mHasMouse{false};
81
86 };
87} // namespace fcn
88
89#endif // INCLUDE_FIFECHAN_WIDGETS_TAB_HPP_
Container()
Constructor.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
Definition graphics.hpp:58
Represents a mouse event.
MouseListener(MouseListener const &)=default
Copy constructor.
Represents a rectangular area (X, Y, Width, Height).
Definition rectangle.hpp:22
Rectangle getChildrenArea() override
Gets the area of the widget occupied by the widget's children.
Definition tab.cpp:42
bool mHasMouse
True if the tab has the mouse, false otherwise.
Definition tab.hpp:80
void mouseExited(MouseEvent &mouseEvent) override
Called when the mouse has exited the widget area.
Definition tab.cpp:104
void setTabbedArea(TabbedArea *tabbedArea)
Sets the tabbed area the tab should be a part of.
Definition tab.cpp:32
void adjustSize() override
Adjusts the size of the tab to fit the caption.
Definition tab.cpp:24
void mouseEntered(MouseEvent &mouseEvent) override
Called when the mouse has entered into the widget area.
Definition tab.cpp:99
TabbedArea * mTabbedArea
Holds the tabbed area the tab is a part of.
Definition tab.hpp:85
TabbedArea * getTabbedArea()
Gets the tabbed are the tab is a part of.
Definition tab.cpp:37
void draw(Graphics *graphics) override
Draws the widget.
Definition tab.cpp:52
A container organizing content into selectable tabs.
Used replacement tokens by configure_file():