mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code/python] Fixed the Kandinsky module in Python.
User can draw on the 320*220 drawing screen. Change-Id: I25034b05f21aacc35608358fdb7a4d9924dd22e8
This commit is contained in:
@@ -11,15 +11,31 @@ extern "C" {
|
||||
|
||||
namespace Code {
|
||||
|
||||
|
||||
ConsoleController::ContentView::ContentView(SelectableTableView * selectabletableView) :
|
||||
m_selectableTableView(selectabletableView)
|
||||
{
|
||||
}
|
||||
|
||||
void ConsoleController::ContentView::layoutSubviews() {
|
||||
m_selectableTableView->setFrame(bounds());
|
||||
}
|
||||
|
||||
void ConsoleController::ContentView::markAsDirty() {
|
||||
markRectAsDirty(bounds());
|
||||
}
|
||||
|
||||
ConsoleController::ConsoleController(Responder * parentResponder, ScriptStore * scriptStore) :
|
||||
ViewController(parentResponder),
|
||||
SelectableTableViewDataSource(),
|
||||
TextFieldDelegate(),
|
||||
MicroPython::ExecutionEnvironment(),
|
||||
m_rowHeight(KDText::charSize(k_fontSize).height()),
|
||||
m_selectableTableView(this, this, 0, 1, 0, Metric::CommonRightMargin, 0, Metric::TitleBarExternHorizontalMargin, this, this, true, true, KDColorWhite),
|
||||
m_editCell(this, this),
|
||||
m_pythonHeap(nullptr),
|
||||
m_scriptStore(scriptStore)
|
||||
m_scriptStore(scriptStore),
|
||||
m_view(&m_selectableTableView)
|
||||
{
|
||||
for (int i = 0; i < k_numberOfLineCells; i++) {
|
||||
m_cells[i].setParentResponder(&m_selectableTableView);
|
||||
@@ -254,6 +270,10 @@ void ConsoleController::printText(const char * text, size_t length) {
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleController::redraw() {
|
||||
m_view.markAsDirty();
|
||||
}
|
||||
|
||||
void ConsoleController::autoImportScriptAtIndex(int index) {
|
||||
const char * importCommand1 = "from ";
|
||||
const char * importCommand2 = " import *";
|
||||
|
||||
Reference in New Issue
Block a user