Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Menu Class Reference

#include <Menu.hh>

Inheritance diagram for Menu:
Collaboration diagram for Menu:

Public Member Functions

 Menu (const ncmenu_options *opts=nullptr, NotCurses *ncinst=nullptr)
 
 ~Menu ()
 
bool unroll (int sectionidx) const NOEXCEPT_MAYBE
 
bool rollup () const NOEXCEPT_MAYBE
 
bool nextsection () const NOEXCEPT_MAYBE
 
bool prevsection () const NOEXCEPT_MAYBE
 
bool nextitem () const NOEXCEPT_MAYBE
 
bool previtem () const NOEXCEPT_MAYBE
 
bool item_set_status (const char *section, const char *item, bool status) const NOEXCEPT_MAYBE
 
const charget_selected (ncinput *ni=nullptr) const noexcept
 
const charget_mouse_selected (const struct ncinput *click, struct ncinput *ni) const noexcept
 
bool offer_input (const struct ncinput *ni) const noexcept
 
Planeget_plane () const noexcept
 
- Public Member Functions inherited from Root
notcursesget_notcurses () const
 
NotCursesget_notcurses_cpp () const
 

Static Public Attributes

static ncmenu_options default_options
 

Additional Inherited Members

- Protected Member Functions inherited from Root
 Root (NotCurses *ncinst)
 
bool is_notcurses_stopped () const noexcept
 
- Static Protected Member Functions inherited from Root
template<typename TRet = bool, typename TValue = int>
static TRet error_guard (TValue ret, TValue error_value)
 
template<typename TRet = bool, typename TValue = int>
static TRet error_guard_cond (TValue ret, bool error_value)
 
- Static Protected Attributes inherited from Root
static constexpr char ncpp_invalid_state_message [] = "notcurses++ is in an invalid state (already stopped?)"
 

Detailed Description

Definition at line 13 of file Menu.hh.

Constructor & Destructor Documentation

◆ Menu()

Menu ( const ncmenu_options opts = nullptr,
NotCurses ncinst = nullptr 
)
inlineexplicit

Definition at line 19 of file Menu.hh.

20 : Root (ncinst)
21 {
23 if (menu == nullptr)
24 throw init_error ("Notcurses failed to create a new menu");
25 }
static ncmenu_options default_options
Definition Menu.hh:16
notcurses * get_notcurses() const
Root(NotCurses *ncinst)
Definition Root.hh:34
static TRet error_guard(TValue ret, TValue error_value)
Definition Root.hh:39
ncmenu * ncmenu_create(ncplane *n, const ncmenu_options *opts)
Definition menu.c:377
ncplane * notcurses_stdplane(notcurses *nc)
Definition notcurses.c:699
const struct ncplane_options * opts
Definition notcurses.h:3483
Here is the call graph for this function:

◆ ~Menu()

~Menu ( )
inline

Definition at line 27 of file Menu.hh.

28 {
30 ncmenu_destroy (menu);
31 }
bool is_notcurses_stopped() const noexcept
void ncmenu_destroy(ncmenu *n)
Definition menu.c:825
Here is the call graph for this function:

Member Function Documentation

◆ get_mouse_selected()

const char * get_mouse_selected ( const struct ncinput click,
struct ncinput ni 
) const
inlinenoexcept

Definition at line 73 of file Menu.hh.

74 {
75 return ncmenu_mouse_selected (menu, click, ni);
76 }
const char * ncmenu_mouse_selected(const ncmenu *n, const ncinput *click, ncinput *ni)
Definition menu.c:673
Here is the call graph for this function:

◆ get_plane()

Plane * get_plane ( ) const
noexcept

◆ get_selected()

const char * get_selected ( ncinput ni = nullptr) const
inlinenoexcept

Definition at line 68 of file Menu.hh.

69 {
70 return ncmenu_selected (menu, ni);
71 }
const char * ncmenu_selected(const ncmenu *n, ncinput *ni)
Definition menu.c:635
Here is the call graph for this function:

◆ item_set_status()

bool item_set_status ( const char section,
const char item,
bool  status 
) const
inline

Definition at line 63 of file Menu.hh.

64 {
66 }
int ncmenu_item_set_status(ncmenu *n, const char *section, const char *item, bool enabled)
Definition menu.c:784
Here is the call graph for this function:

◆ nextitem()

bool nextitem ( ) const
inline

Definition at line 53 of file Menu.hh.

54 {
55 return error_guard (ncmenu_nextitem (menu), -1);
56 }
int ncmenu_nextitem(ncmenu *n)
Definition menu.c:593
Here is the call graph for this function:

◆ nextsection()

bool nextsection ( ) const
inline

Definition at line 43 of file Menu.hh.

44 {
45 return error_guard (ncmenu_nextsection (menu), -1);
46 }
int ncmenu_nextsection(ncmenu *n)
Definition menu.c:563
Here is the call graph for this function:

◆ offer_input()

bool offer_input ( const struct ncinput ni) const
inlinenoexcept

Definition at line 78 of file Menu.hh.

79 {
80 return ncmenu_offer_input (menu, ni);
81 }
bool ncmenu_offer_input(ncmenu *n, const ncinput *nc)
Definition menu.c:707
Here is the call graph for this function:

◆ previtem()

bool previtem ( ) const
inline

Definition at line 58 of file Menu.hh.

59 {
60 return error_guard (ncmenu_previtem (menu), -1);
61 }
int ncmenu_previtem(ncmenu *n)
Definition menu.c:614
Here is the call graph for this function:

◆ prevsection()

bool prevsection ( ) const
inline

Definition at line 48 of file Menu.hh.

49 {
50 return error_guard (ncmenu_prevsection (menu), -1);
51 }
int ncmenu_prevsection(ncmenu *n)
Definition menu.c:578
Here is the call graph for this function:

◆ rollup()

bool rollup ( ) const
inline

Definition at line 38 of file Menu.hh.

39 {
40 return error_guard (ncmenu_rollup (menu), -1);
41 }
int ncmenu_rollup(ncmenu *n)
Definition menu.c:554
Here is the call graph for this function:

◆ unroll()

bool unroll ( int  sectionidx) const
inline

Definition at line 33 of file Menu.hh.

34 {
35 return error_guard (ncmenu_unroll (menu, sectionidx), -1);
36 }
int ncmenu_unroll(ncmenu *n, int sectionidx)
Definition menu.c:452
Here is the call graph for this function:

Field Documentation

◆ default_options

ncmenu_options default_options
static

Definition at line 16 of file Menu.hh.


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