Files
MuditaOS/module-gui/gui/widgets/Navigation.hpp
pholat 938cbc186a Gui text pr1 utils and fixes (needed for gui::Text rewrite mostly) (#485)
* EGD-3229 [FIX] UTF8 fixed uint32_t range error

* EGD-3229 [util] gui::Item Navigation switch case moved to function

Needed to not copy senslessly NavigationDirection enum switch case
* gui::Item Navigation switch case moved to function
* added NavigationDirection::None enum value
* cleaned up Navigation.hpp/cpp

* EGD-3229 [util] gui: InputEvent - str() for logging added & is...() check methods

* EGD-3229 [util] removed notorious log on unknown glyph

* EGD-3229 [util] InputMode - added is(Mode) method, input Profile added default definition

* is() method addded to check instead of `==` comparison
* added default to Profile instead of `== 0` use

* [FIX] ARM GCC 10.1.0 - build fixed

fixed include in wrong place

* PR style fix

* Review applied
2020-07-01 13:14:07 +02:00

31 lines
826 B
C++

#pragma once
#include "../Common.hpp"
namespace gui
{
class Item;
// Class holds GUI Items for 4 possible directions for navigating using keyboard.
class Navigation
{
protected:
Item *left = nullptr;
Item *up = nullptr;
Item *right = nullptr;
Item *down = nullptr;
public:
/// Sets pointer to the widget that should receive focus after receiving navigation event.
void setDirectionItem(NavigationDirection direction, Item *item);
/// Retrives item from specified durection
Item *getDirectionItem(const NavigationDirection direction) const;
/// Clears Item's pointer for specified direction.
void clearDirection(const NavigationDirection direction);
virtual ~Navigation();
};
} // namespace gui