Files
Upsilon/apps/code/sandbox_controller.h
Léa Saviot 4b306791c0 [python/turtle] Turtle::m_drawn is false if sandbox not displayed
This way, Turtle::draw() and erase() are more symetrical and no not
perform themselves if the turtle is already drawn / erased.
2018-12-18 12:05:46 +01:00

33 lines
963 B
C++

#ifndef CODE_SANDBOX_CONTROLLER_H
#define CODE_SANDBOX_CONTROLLER_H
#include <escher/responder.h>
#include <escher/solid_color_view.h>
#include <escher/stack_view_controller.h>
#include <escher/view_controller.h>
#include <python/port/port.h>
namespace Code {
class SandboxController : public ViewController {
public:
SandboxController(Responder * parentResponder, MicroPython::ExecutionEnvironment * executionEnvironment);
StackViewController * stackViewController();
void reset();
// ViewController
View * view() override { return &m_solidColorView; }
void viewWillAppear() override;
void viewDidDisappear() override;
bool handleEvent(Ion::Events::Event event) override;
ViewController::DisplayParameter displayParameter() override { return ViewController::DisplayParameter::WantsMaximumSpace; }
private:
void redrawWindow();
SolidColorView m_solidColorView;
MicroPython::ExecutionEnvironment * m_executionEnvironment;
};
}
#endif