Rose
Public Member Functions | Protected Member Functions | List of all members
rose::TabBody Class Reference

A TabBody manages a number of TabPages. More...

#include <Tab.h>

Inheritance diagram for rose::TabBody:
Inheritance graph
[legend]
Collaboration diagram for rose::TabBody:
Collaboration graph
[legend]

Public Member Functions

 TabBody (TabBody &&)=delete
 
 TabBody (const TabBody &)=delete
 
TabBodyoperator= (TabBody &&)=delete
 
TabBodyoperator= (const TabBody &)=delete
 
void initializeComposite () override
 See Widget::initializeComposite()
 
void draw (sdl::Renderer &renderer, Rectangle parentRect) override
 See Widget::draw()
 
Rectangle widgetLayout (sdl::Renderer &renderer, Rectangle available, uint layoutStage) override
 See Widget::widgetLayout()
 
bool mouseButtonEvent (const Position &mousePos, int button, bool down, int modifiers) override
 Handle a mouse button event (default implementation: propagate to children)
 
bool mouseMotionEvent (const Position &cursorPosition, const Position &rel, int button, int modifiers) override
 Handle a mouse motion event (default implementation: propagate to children)
 
bool mouseDragEvent (const Position &p, const Position &rel, int button, int modifiers) override
 Handle a mouse drag event (default implementation: do nothing)
 
bool mouseEnterEvent (const Position &p, bool enter) override
 Handle a mouse enter/leave event (default implementation: record this fact, but do nothing)
 
bool scrollEvent (const Position &p, int32_t x, int32_t y) override
 Handle a mouse scroll event (default implementation: propagate to children)
 
bool focusEvent (bool focused) override
 Handle a focus change event (default implementation: record the focus status, but do nothing)
 
bool keyboardCharacterEvent (unsigned int codepoint) override
 Handle text input (UTF-32 format) (default implementation: do nothing)
 
std::shared_ptr< WidgetfindWidget (const Position &pos) override
 Find the Widget which uniquely contains the position. More...
 
std::shared_ptr< WidgetfindWidget (const Id &id) override
 Find a Widget with the specified Id. More...
 
- Public Member Functions inherited from rose::Container
std::string_view nodeId () const noexcept override
 
virtual void add (const std::shared_ptr< Node > &node)
 
void remove (const std::shared_ptr< Node > &node)
 
- Public Member Functions inherited from rose::Node
 Node (const std::shared_ptr< Container > &container)
 Create a node and add it to a Container. More...
 
void setId (const Id &nodeId) noexcept
 Set Id.
 
std::string_view getId () const
 Get Id.
 
IdPath getIdPath () const
 Get the Id Path.
 
virtual void addedToContainer ()
 Called when a Node is added to a Container. More...
 
std::shared_ptr< Containercontainer ()
 
std::shared_ptr< Containercontainer () const
 
template<typename C >
std::shared_ptr< C > containerAs ()
 
template<typename C >
std::shared_ptr< C > containerAs () const
 
std::shared_ptr< const NodegetNode () const
 Get a const std::shared_ptr to this node. More...
 
std::shared_ptr< NodegetNode ()
 Get a std::shared_ptr to this node. More...
 
template<typename NodeType >
std::shared_ptr< const NodegetNode () const
 Get a std::shared_ptr<const NodeType> to this node. More...
 
template<typename NodeType >
std::shared_ptr< NodeType > getNode ()
 Get a std::shared_ptr<NodeType> to this node. More...
 
std::shared_ptr< Noderemove ()
 

Protected Member Functions

template<class WidgetType >
std::shared_ptr< WidgetType > activeChild ()
 Find the active TabPage. More...
 

Additional Inherited Members

- Public Types inherited from rose::Node
using NodePtr = std::shared_ptr< Node >
 
- Static Public Member Functions inherited from rose::Node
template<typename NodeType >
static std::shared_ptr< NodeType > create ()
 Create a Node with no arguments. More...
 
template<typename NodeType , typename ... Args>
static std::shared_ptr< NodeType > create (Args ... args)
 Create a Node with arguments. More...
 
template<typename NodeType , typename ContainerType , typename ... Args>
static std::shared_ptr< NodeType > add (ContainerType container, Args ... args)
 Create a Node with arguments and add to a Container. More...
 
- Static Public Attributes inherited from rose::Container
static constexpr std::string_view id = "Container"
 
- Static Public Attributes inherited from rose::Node
static constexpr std::string_view id = "Node"
 
- Protected Attributes inherited from rose::Node
std::weak_ptr< ContainermContainer {}
 The Container that holds the Node. More...
 
Id mId {}
 

Detailed Description

A TabBody manages a number of TabPages.

Member Function Documentation

◆ activeChild()

template<class WidgetType >
std::shared_ptr<WidgetType> rose::TabBody::activeChild ( )
inlineprotected

Find the active TabPage.

First this method finds that active child TabPage. It is then returned after casting to WidgetType.

Template Parameters
WidgetTypeThe desired return type.
Returns
std::shared_ptr<WidgetType> If there is an active child TabPage and it is derived from WidgetType.

◆ findWidget() [1/2]

std::shared_ptr< Widget > rose::TabBody::findWidget ( const Position pos)
override

Find the Widget which uniquely contains the position.

Parameters
posthe position the Widget must contain.
Returns
A reference to the Widget found, if any.

◆ findWidget() [2/2]

std::shared_ptr< Widget > rose::TabBody::findWidget ( const Id id)
override

Find a Widget with the specified Id.

The Widget tree is searched top down, front to back for the first Widget marked with the specified Id.

Parameters
idThe Id to search for.
Returns
a std::shared_ptr<Widget>, empty if the Id is not found.

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