neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::menu Class Reference

#include <menu.hpp>

Inheritance diagram for neogfx::menu:
neogfx::i_menu neogfx::i_action_container neogfx::menu_bar

Public Member Functions

 define_declared_event (MenuChanged, menu_changed) define_declared_event(ItemAdded
 
item_index define_declared_event (ItemRemoved, item_removed, item_index) define_declared_event(ItemChanged
 
item_index item_index define_declared_event (Opened, opened) define_declared_event(Closed
 
item_index item_index closed define_declared_event (ItemSelected, item_selected, i_menu_item &) define_declared_event(SelectionCleared
 
 menu (i_menu &aParent, std::string const &aTitle=std::string{}, menu_type aType=menu_type::Popup)
 
 menu (std::string const &aTitle=std::string{}, menu_type aType=menu_type::Popup)
 
 ~menu ()
 
const i_widgetas_widget () const override
 
i_widgetas_widget () override
 
bool has_parent () const override
 
i_menuparent () override
 
void set_parent (i_menu &aParent) override
 
menu_type type () const override
 
uuid const & group () const override
 
void set_group (uuid const &aGroup) override
 
i_string const & title () const override
 
void set_title (i_string const &aTitle) override
 
const i_textureimage () const override
 
void set_image (i_string const &aUri) override
 
void set_image (const i_image &aImage) override
 
void set_image (const i_texture &aTexture) override
 
uint32_t count () const override
 
uint32_t ideal_insert_index (uuid const &aGroup) const override
 
const i_menu_itemitem_at (item_index aItemIndex) const override
 
i_menu_itemitem_at (item_index aItemIndex) override
 
void add_sub_menu (i_menu &aSubMenu) override
 
i_menuadd_sub_menu (i_string const &aSubMenuTitle, uuid const &aGroup={}) override
 
i_actionadd_action (i_action &aAction) override
 
i_actionadd_action (i_ref_ptr< i_action > const &aAction) override
 
void add_separator (uuid const &aGroup={}) override
 
void insert_sub_menu_at (item_index aItemIndex, i_menu &aSubMenu) override
 
i_menuinsert_sub_menu_at (item_index aItemIndex, i_string const &aSubMenuText, uuid const &aGroup={}) override
 
void insert_action_at (item_index aItemIndex, i_action &aAction) override
 
void insert_action_at (item_index aItemIndex, i_ref_ptr< i_action > const &aAction) override
 
void insert_separator_at (item_index aItemIndex, uuid const &aGroup={}) override
 
void remove_at (item_index aItemIndex) override
 
item_index find_sub_menu (uuid const &aGroup) const override
 
item_index find (const i_menu_item &aItem) const override
 
item_index find (const i_menu &aSubMenu) const override
 
bool has_selected_item () const override
 
item_index selected_item () const override
 
void select_item_at (item_index aItemIndex, bool aOpenAnySubMenu=true) override
 
void clear_selection () override
 
bool has_available_items () const override
 
bool item_available_at (item_index aItemIndex) const override
 
item_index first_available_item () const override
 
item_index previous_available_item (item_index aCurrentIndex) const override
 
item_index next_available_item (item_index aCurrentIndex) const override
 
bool is_open () const override
 
void open () override
 
void close () override
 
bool is_modal () const override
 
void set_modal (bool aModal) override
 
virtual uint32_t ideal_insert_index (uuid const &aGroup) const=0
 
uint32_t ideal_insert_index (i_action const &aAction) const
 
uint32_t ideal_insert_index (i_menu const &aSubMenu) const
 
- Public Member Functions inherited from neogfx::i_menu
 declare_event (menu_changed) declare_event(item_added
 
item_index declare_event (item_removed, item_index) declare_event(item_changed
 
item_index item_index declare_event (opened) declare_event(closed) declare_event(item_selected
 
item_index item_index i_menu_itemdeclare_event (selection_cleared) declare_event(open_sub_menu
 
virtual ~i_menu ()=default
 
uint32_t ideal_insert_index (i_action const &aAction) const
 
uint32_t ideal_insert_index (i_menu const &aSubMenu) const
 

Public Attributes

item_index item_index closed selection_cleared define_declared_event(OpenSubMenu, open_sub_menu, i_menu &) private typedef std::vector< item_pointer > item_list
 
 item_added
 
item_index item_changed
 

Additional Inherited Members

- Public Types inherited from neogfx::i_menu
typedef uint32_t item_index
 
typedef uint32_t item_index
 

Detailed Description

Definition at line 31 of file menu.hpp.

Constructor & Destructor Documentation

◆ menu() [1/2]

neogfx::menu::menu ( i_menu aParent,
std::string const &  aTitle = std::string{},
menu_type  aType = menu_type::Popup 
)

◆ menu() [2/2]

neogfx::menu::menu ( std::string const &  aTitle = std::string{},
menu_type  aType = menu_type::Popup 
)

◆ ~menu()

neogfx::menu::~menu ( )

Member Function Documentation

◆ add_action() [1/2]

i_action & neogfx::menu::add_action ( i_action aAction)
overridevirtual

◆ add_action() [2/2]

i_action & neogfx::menu::add_action ( i_ref_ptr< i_action > const &  aAction)
overridevirtual

◆ add_separator()

void neogfx::menu::add_separator ( uuid const &  aGroup = {})
overridevirtual

Implements neogfx::i_menu.

◆ add_sub_menu() [1/2]

void neogfx::menu::add_sub_menu ( i_menu aSubMenu)
overridevirtual

Implements neogfx::i_menu.

◆ add_sub_menu() [2/2]

i_menu & neogfx::menu::add_sub_menu ( i_string const &  aSubMenuTitle,
uuid const &  aGroup = {} 
)
overridevirtual

Implements neogfx::i_menu.

◆ as_widget() [1/2]

const i_widget & neogfx::menu::as_widget ( ) const
overridevirtual

Implements neogfx::i_menu.

Reimplemented in neogfx::menu_bar.

◆ as_widget() [2/2]

i_widget & neogfx::menu::as_widget ( )
overridevirtual

Implements neogfx::i_menu.

Reimplemented in neogfx::menu_bar.

◆ clear_selection()

void neogfx::menu::clear_selection ( )
overridevirtual

Implements neogfx::i_menu.

◆ close()

void neogfx::menu::close ( )
overridevirtual

Implements neogfx::i_menu.

◆ count()

uint32_t neogfx::menu::count ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ define_declared_event() [1/4]

item_index neogfx::menu::define_declared_event ( ItemRemoved  ,
item_removed  ,
item_index   
)

◆ define_declared_event() [2/4]

item_index item_index closed neogfx::menu::define_declared_event ( ItemSelected  ,
item_selected  ,
i_menu_item  
)

◆ define_declared_event() [3/4]

neogfx::menu::define_declared_event ( MenuChanged  ,
menu_changed   
)

◆ define_declared_event() [4/4]

item_index item_index neogfx::menu::define_declared_event ( Opened  ,
opened   
)

◆ find() [1/2]

item_index neogfx::menu::find ( const i_menu aSubMenu) const
overridevirtual

Implements neogfx::i_menu.

Reimplemented in neogfx::menu_bar.

◆ find() [2/2]

item_index neogfx::menu::find ( const i_menu_item aItem) const
overridevirtual

Implements neogfx::i_menu.

Reimplemented in neogfx::menu_bar.

◆ find_sub_menu()

item_index neogfx::menu::find_sub_menu ( uuid const &  aGroup) const
overridevirtual

Implements neogfx::i_menu.

◆ first_available_item()

item_index neogfx::menu::first_available_item ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ group()

uuid const & neogfx::menu::group ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ has_available_items()

bool neogfx::menu::has_available_items ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ has_parent()

bool neogfx::menu::has_parent ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ has_selected_item()

bool neogfx::menu::has_selected_item ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ ideal_insert_index() [1/4]

uint32_t neogfx::i_menu::ideal_insert_index ( i_action const &  aAction) const
inline

Definition at line 109 of file i_menu.hpp.

◆ ideal_insert_index() [2/4]

uint32_t neogfx::i_menu::ideal_insert_index ( i_menu const &  aSubMenu) const
inline

Definition at line 113 of file i_menu.hpp.

◆ ideal_insert_index() [3/4]

uint32_t neogfx::menu::ideal_insert_index ( uuid const &  aGroup) const
overridevirtual

Implements neogfx::i_menu.

◆ ideal_insert_index() [4/4]

virtual uint32_t neogfx::i_menu::ideal_insert_index ( uuid const &  aGroup) const
virtual

Implements neogfx::i_menu.

◆ image()

const i_texture & neogfx::menu::image ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ insert_action_at() [1/2]

void neogfx::menu::insert_action_at ( item_index  aItemIndex,
i_action aAction 
)
overridevirtual

Implements neogfx::i_menu.

◆ insert_action_at() [2/2]

void neogfx::menu::insert_action_at ( item_index  aItemIndex,
i_ref_ptr< i_action > const &  aAction 
)
overridevirtual

Implements neogfx::i_menu.

◆ insert_separator_at()

void neogfx::menu::insert_separator_at ( item_index  aItemIndex,
uuid const &  aGroup = {} 
)
overridevirtual

Implements neogfx::i_menu.

◆ insert_sub_menu_at() [1/2]

void neogfx::menu::insert_sub_menu_at ( item_index  aItemIndex,
i_menu aSubMenu 
)
overridevirtual

Implements neogfx::i_menu.

◆ insert_sub_menu_at() [2/2]

i_menu & neogfx::menu::insert_sub_menu_at ( item_index  aItemIndex,
i_string const &  aSubMenuText,
uuid const &  aGroup = {} 
)
overridevirtual

Implements neogfx::i_menu.

◆ is_modal()

bool neogfx::menu::is_modal ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ is_open()

bool neogfx::menu::is_open ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ item_at() [1/2]

const i_menu_item & neogfx::menu::item_at ( item_index  aItemIndex) const
overridevirtual

Implements neogfx::i_menu.

◆ item_at() [2/2]

i_menu_item & neogfx::menu::item_at ( item_index  aItemIndex)
overridevirtual

Implements neogfx::i_menu.

◆ item_available_at()

bool neogfx::menu::item_available_at ( item_index  aItemIndex) const
overridevirtual

Implements neogfx::i_menu.

◆ next_available_item()

item_index neogfx::menu::next_available_item ( item_index  aCurrentIndex) const
overridevirtual

Implements neogfx::i_menu.

◆ open()

void neogfx::menu::open ( )
overridevirtual

Implements neogfx::i_menu.

◆ parent()

i_menu & neogfx::menu::parent ( )
overridevirtual

Implements neogfx::i_menu.

◆ previous_available_item()

item_index neogfx::menu::previous_available_item ( item_index  aCurrentIndex) const
overridevirtual

Implements neogfx::i_menu.

◆ remove_at()

void neogfx::menu::remove_at ( item_index  aItemIndex)
overridevirtual

Implements neogfx::i_menu.

◆ select_item_at()

void neogfx::menu::select_item_at ( item_index  aItemIndex,
bool  aOpenAnySubMenu = true 
)
overridevirtual

Implements neogfx::i_menu.

◆ selected_item()

item_index neogfx::menu::selected_item ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ set_group()

void neogfx::menu::set_group ( uuid const &  aGroup)
overridevirtual

Implements neogfx::i_menu.

◆ set_image() [1/3]

void neogfx::menu::set_image ( const i_image aImage)
overridevirtual

Implements neogfx::i_menu.

◆ set_image() [2/3]

void neogfx::menu::set_image ( const i_texture aTexture)
overridevirtual

Implements neogfx::i_menu.

◆ set_image() [3/3]

void neogfx::menu::set_image ( i_string const &  aUri)
overridevirtual

Implements neogfx::i_menu.

◆ set_modal()

void neogfx::menu::set_modal ( bool  aModal)
overridevirtual

Implements neogfx::i_menu.

◆ set_parent()

void neogfx::menu::set_parent ( i_menu aParent)
overridevirtual

Implements neogfx::i_menu.

◆ set_title()

void neogfx::menu::set_title ( i_string const &  aTitle)
overridevirtual

Implements neogfx::i_menu.

◆ title()

i_string const & neogfx::menu::title ( ) const
overridevirtual

Implements neogfx::i_menu.

◆ type()

menu_type neogfx::menu::type ( ) const
overridevirtual

Implements neogfx::i_menu.

Member Data Documentation

◆ item_added

neogfx::menu::item_added

Definition at line 35 of file menu.hpp.

◆ item_changed

item_index neogfx::menu::item_changed

Definition at line 37 of file menu.hpp.

◆ item_list

item_index item_index closed selection_cleared define_declared_event (OpenSubMenu, open_sub_menu, i_menu&) private typedef std::vector<item_pointer> neogfx::menu::item_list

Definition at line 45 of file menu.hpp.


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