Skip to content
Snippets Groups Projects
Unverified Commit eedaa2ad authored by Leon Dietrich's avatar Leon Dietrich
Browse files

fix: virtual described constructor now implemented

parent c2f7f771
No related branches found
No related tags found
No related merge requests found
Pipeline #
#include "event.hpp"
#include "ui/event.hpp"
namespace rmrf::ui {
event::event(std::shared_ptr<ui_context> sender) {
......
......@@ -3,7 +3,7 @@
#include <memory>
#include <string>
#include "ui_context.hpp"
#include "ui/ui_context.hpp"
namespace rmrf::ui {
......
#include "lib/ncurses/ncurses.hpp"
#include "ui/view.hpp"
namespace rmrf::ui {
display::display() : m{} {
initscr();
view::view(std::shared_ptr<view> parent) {
this->parent = parent;
}
display::~display() {
endwin();
std::shared_ptr<view> view::get_parent() {
return this->parent;
}
}
......@@ -43,6 +43,8 @@ public:
* This abstract class implements a view page.
*/
class view : ui_context {
private:
std::shared_ptr<view> parent;
public:
/**
* This method will be called when an operation is taking place. It may add
......@@ -63,12 +65,18 @@ public:
* @return True if rerendering is required or otherwise false.
*/
virtual bool update(std::shared_ptr<display> display, std::shared_ptr<event> event);
/**
* Use this method in order to retrieve the parent of this view.
* @warn Keep in mind that this might be null.
* @return The parent
*/
std::shared_ptr<view> get_parent();
/**
* This constructor shall be capable of creating the view.
*
* @param parent The parent view of this view. This may be null if there is none.
*/
virtual view(std::shared_ptr<view> parent);
view(std::shared_ptr<view> parent);
virtual ~view();
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment