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

#include <Selector.hh>

Inheritance diagram for Selector:
Collaboration diagram for Selector:

Public Member Functions

 Selector (Plane *plane, const ncselector_options *opts=nullptr)
 
 Selector (Plane &plane, const ncselector_options *opts=nullptr)
 
 ~Selector ()
 
int additem (const ncselector_item *item) const NOEXCEPT_MAYBE
 
int delitem (const char *item) const NOEXCEPT_MAYBE
 
const charprevitem () const noexcept
 
const charnextitem () const noexcept
 
const charget_selected () 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 ncselector_options default_options
 

Additional Inherited Members

- Protected Member Functions inherited from Widget
 Widget (NotCurses *ncinst)
 
void ensure_valid_plane (Plane *plane) const
 
void ensure_valid_plane (Plane &plane) const
 
void take_plane_ownership (Plane *plane) const
 
void take_plane_ownership (Plane &plane) const
 
- 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 Selector.hh.

Constructor & Destructor Documentation

◆ Selector() [1/2]

Selector ( Plane plane,
const ncselector_options opts = nullptr 
)
inlineexplicit

Definition at line 19 of file Selector.hh.

21 {
22 if (plane == nullptr)
23 throw invalid_argument ("'plane' must be a valid pointer");
24
25 ensure_valid_plane (plane);
26 common_init (Utilities::to_ncplane (plane), opts);
28 }
static NotCurses * get_notcurses_cpp(const Root *o) noexcept
static ncplane * to_ncplane(const Plane *plane) noexcept
Widget(NotCurses *ncinst)
Definition Widget.hh:12
void take_plane_ownership(Plane *plane) const
Definition Widget.hh:29
void ensure_valid_plane(Plane *plane) const
Definition Widget.hh:16
const struct ncplane_options * opts
Definition notcurses.h:3483

◆ Selector() [2/2]

Selector ( Plane plane,
const ncselector_options opts = nullptr 
)
inlineexplicit

Definition at line 30 of file Selector.hh.

32 {
33 ensure_valid_plane (plane);
34 common_init (Utilities::to_ncplane (plane), opts);
36 }

◆ ~Selector()

~Selector ( )
inline

Definition at line 38 of file Selector.hh.

39 {
41 ncselector_destroy (selector, nullptr);
42 }
bool is_notcurses_stopped() const noexcept
void ncselector_destroy(ncselector *n, char **item)
Definition selector.c:270
Here is the call graph for this function:

Member Function Documentation

◆ additem()

int additem ( const ncselector_item item) const
inline

Definition at line 44 of file Selector.hh.

45 {
46 return error_guard<int> (ncselector_additem (selector, item), -1);
47 }
static TRet error_guard(TValue ret, TValue error_value)
Definition Root.hh:39
int ncselector_additem(ncselector *n, const struct ncselector_item *item)
Definition selector.c:392
Here is the call graph for this function:

◆ delitem()

int delitem ( const char item) const
inline

Definition at line 49 of file Selector.hh.

50 {
51 return error_guard<int> (ncselector_delitem (selector, item), -1);
52 }
int ncselector_delitem(ncselector *n, const char *item)
Definition selector.c:427
Here is the call graph for this function:

◆ get_plane()

Plane * get_plane ( ) const
noexcept
Here is the call graph for this function:

◆ get_selected()

const char * get_selected ( ) const
inlinenoexcept

Definition at line 64 of file Selector.hh.

65 {
66 return ncselector_selected (selector);
67 }
const char * ncselector_selected(const ncselector *n)
Definition selector.c:474
Here is the call graph for this function:

◆ nextitem()

const char * nextitem ( ) const
inlinenoexcept

Definition at line 59 of file Selector.hh.

60 {
61 return ncselector_nextitem (selector);
62 }
const char * ncselector_nextitem(ncselector *n)
Definition selector.c:500
Here is the call graph for this function:

◆ offer_input()

bool offer_input ( const struct ncinput ni) const
inlinenoexcept

Definition at line 69 of file Selector.hh.

70 {
71 return ncselector_offer_input (selector, ni);
72 }
bool ncselector_offer_input(ncselector *n, const ncinput *nc)
Definition selector.c:523
Here is the call graph for this function:

◆ previtem()

const char * previtem ( ) const
inlinenoexcept

Definition at line 54 of file Selector.hh.

55 {
56 return ncselector_previtem (selector);
57 }
const char * ncselector_previtem(ncselector *n)
Definition selector.c:481
Here is the call graph for this function:

Field Documentation

◆ default_options

ncselector_options default_options
static

Definition at line 16 of file Selector.hh.


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