Now have a nice panel to hold all the UI panels we'll use later.
This commit is contained in:
parent
baaf56d4de
commit
9bc9c9007f
12 changed files with 123 additions and 83 deletions
24
panel.cpp
Normal file
24
panel.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "panel.hpp"
|
||||
|
||||
void Panel::resize(int width, int height) {
|
||||
$screen = Screen(width, height);
|
||||
}
|
||||
|
||||
void Panel::set_renderer(std::function< Element()> render) {
|
||||
$component = Renderer(render);
|
||||
}
|
||||
|
||||
Screen &Panel::render() {
|
||||
if($must_clear) $screen.Clear();
|
||||
Render($screen, $component->Render());
|
||||
return $screen;
|
||||
}
|
||||
|
||||
std::wstring Panel::to_string() {
|
||||
std::string screenout = $screen.ToString();
|
||||
return $converter.from_bytes(screenout);
|
||||
}
|
||||
|
||||
Screen &Panel::screen() {
|
||||
return $screen;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue