Skip to content

Class evab::CompositeBase

ClassList > evab > CompositeBase

Abstract base class for composite elements that can manage child focus. More...

  • #include <evabCompositeBase.h>

Inherits the following classes: evab::ElementBase

Public Functions

Type Name
ElementBase * GetFocused () const
Gets the current (focused) child.
bool IsFocused (ElementBase * aChild)
Checks if a child is currently focused.
virtual bool OnKey (Keys aKey) override
Handles key events by forwarding to focused child.

Public Functions inherited from evab::ElementBase

See evab::ElementBase

Type Name
void Draw (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused)
Draws the element on the specified screen.
void Freeze ()
Make element insensitive to redraw method.
virtual bool OnKey (Keys aKey)
Handles key events for the element.

Protected Functions

Type Name
void focusChild (ElementBase * aChild)
Sets the focused child element.

Protected Functions inherited from evab::ElementBase

See evab::ElementBase

Type Name
virtual void drawer (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) = 0
Pure virtual method for drawing the element.
virtual void freezer ()
Virtual method for freezing the element.
bool isFrozen ()
Checks if the element is currently freezed.
void redraw ()
Redraws the element on the current screen.

Detailed Description

Provides focus management and key event routing for container elements.

Public Functions Documentation

function GetFocused

Gets the current (focused) child.

ElementBase * evab::CompositeBase::GetFocused () const

Returns:

Pointer to current child, or nullptr if none


function IsFocused

Checks if a child is currently focused.

bool evab::CompositeBase::IsFocused (
    ElementBase * aChild
) 

Parameters:

  • aChild Child element to check

Returns:

true if the child is focused


function OnKey

Handles key events by forwarding to focused child.

virtual bool evab::CompositeBase::OnKey (
    Keys aKey
) override

Parameters:

  • aKey OnKey code to process

Returns:

true if the key was handled, false otherwise

Implements evab::ElementBase::OnKey


Protected Functions Documentation

function focusChild

Sets the focused child element.

void evab::CompositeBase::focusChild (
    ElementBase * aChild
) 

Parameters:

  • aChild Child element to focus


The documentation for this class was generated from the following file src/evabCompositeBase.h