EMath++
Classes for mathematical concepts
Loading...
Searching...
No Matches
efc::OWindow Class Reference

Window class extension for output. More...

+ Inheritance diagram for efc::OWindow:
+ Collaboration diagram for efc::OWindow:

Public Member Functions

 OWindow () noexcept
 Default constructor.
 
const unsigned int & get_scroll_index () const noexcept
 Gets if the scroll index.
 
const ::std::vector<::std::string > & get_data () const noexcept
 Gets the data vector.
 
const unsigned int get_data_size () const noexcept
 Gets the data vector size.
 
const unsigned int get_title_y () const noexcept override
 Gets the title y coordinate.
 
const unsigned int get_title_x () const noexcept override
 Gets the title x coordinate.
 
void set_data (::std::vector<::std::string > &&data) noexcept
 Sets the data vector.
 
void scroll_up () noexcept
 Scrolls up, internally substracts from the scroll index within certain bounds.
 
void scroll_down () noexcept
 Scrolls down, internally adds to the scroll index within certain bounds.
 
 ~OWindow () noexcept=default
 Default destructor.
 
- Public Member Functions inherited from efc::Window
 Window () noexcept
 Generic constructor with default values.
 
const char * get_title () const noexcept
 Returns the c_str() const char pointer of the title std::string.
 
const unsigned int & get_y () const noexcept
 Returns the y coordinate.
 
const unsigned int & get_x () const noexcept
 Returns the x coordinate.
 
const unsigned int & get_height () const noexcept
 Returns the height value.
 
const unsigned int & get_width () const noexcept
 Returns the width value.
 
const unsigned int get_title_size () const noexcept
 Returns the title size.
 
void set_title (const ::std::string &&title) noexcept
 Sets the title.
 
void set_coords (const unsigned int y, const unsigned int x) noexcept
 Sets the y and x coordinates.
 
void set_size (const unsigned int h, const unsigned int w) noexcept
 Sets the size.
 
void set_active (const bool active) noexcept
 Sets the active boolean to the provided value.
 
virtual const unsigned int get_title_y () const noexcept
 Gets the title y coordinate.
 
virtual const unsigned int get_title_x () const noexcept
 Gets the title x coordinate.
 
const bool needs_update () noexcept
 Gets if the window needs a redraw.
 
const bool is_active () const noexcept
 Gets if the window is active/focused.
 
void place ()
 Deletes the WINDOW pointer and creates a new WINDOW at the class coordinates.
 
virtual ~Window () noexcept
 Calls curses delwin() function on the curses WINDOW object and returns.
 

Additional Inherited Members

- Public Attributes inherited from efc::Window
WINDOW * o
 Pointer to the curses WINDOW object.
 
- Protected Attributes inherited from efc::Window
bool c
 Two booleans: c for knowing if contents changed, and a for knowing if window is active.
 
bool a
 
::std::string t
 String t: window title.
 
unsigned int y
 Four unsigned ints: x and y for the coordinates relative to the console window, w and h for the size of the window.
 
unsigned int x
 
unsigned int h
 
unsigned int w
 

Detailed Description

Window class extension for output.

Window class implementation that focuses on showin data. Comes with the ability to scroll through an std::vector of std::string

Definition at line 169 of file interface.cpp.

Constructor & Destructor Documentation

◆ OWindow()

efc::OWindow::OWindow ( )
inlinenoexcept

Default constructor.

Definition at line 183 of file interface.cpp.

Member Function Documentation

◆ get_data()

const ::std::vector<::std::string > & efc::OWindow::get_data ( ) const
inlinenoexcept

Gets the data vector.

Returns
(const ::std::vector<::std::string>&) The data vector as a const ::std::vector<::std::string>&

Definition at line 193 of file interface.cpp.

◆ get_data_size()

const unsigned int efc::OWindow::get_data_size ( ) const
inlinenoexcept

Gets the data vector size.

Returns
(const unsigned int) The data vector size as a const unsigned int

Definition at line 198 of file interface.cpp.

◆ get_scroll_index()

const unsigned int & efc::OWindow::get_scroll_index ( ) const
inlinenoexcept

Gets if the scroll index.

Returns
(const unsigned int&) The scroll index as a const unsigned int&

Definition at line 188 of file interface.cpp.

◆ get_title_x()

const unsigned int efc::OWindow::get_title_x ( ) const
inlineoverridevirtualnoexcept

Gets the title x coordinate.

Returns
(const unsigned int) The title x coordinate as a const unsigned int

Reimplemented from efc::Window.

Definition at line 208 of file interface.cpp.

References efc::Window::t.

◆ get_title_y()

const unsigned int efc::OWindow::get_title_y ( ) const
inlineoverridevirtualnoexcept

Gets the title y coordinate.

Returns
(const unsigned int) The title y coordinate as a const unsigned int

Reimplemented from efc::Window.

Definition at line 203 of file interface.cpp.

◆ scroll_down()

void efc::OWindow::scroll_down ( )
inlinenoexcept

Scrolls down, internally adds to the scroll index within certain bounds.

Definition at line 221 of file interface.cpp.

References efc::Window::c.

◆ scroll_up()

void efc::OWindow::scroll_up ( )
inlinenoexcept

Scrolls up, internally substracts from the scroll index within certain bounds.

Definition at line 217 of file interface.cpp.

References efc::Window::c.

◆ set_data()

void efc::OWindow::set_data ( ::std::vector<::std::string > &&  data)
inlinenoexcept

Sets the data vector.

Parameters
dataThe data vector to replace with

Definition at line 213 of file interface.cpp.

References efc::Window::c.


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