mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 16:57:31 +01:00
[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.
This commit is contained in:
@@ -30,7 +30,7 @@ ConsoleController::ConsoleController(Responder * parentResponder, App * pythonDe
|
||||
m_selectableTableView(this, this, this, this),
|
||||
m_editCell(this, pythonDelegate, this),
|
||||
m_scriptStore(scriptStore),
|
||||
m_sandboxController(this),
|
||||
m_sandboxController(this, this),
|
||||
m_inputRunLoopActive(false)
|
||||
#if EPSILON_GETOPT
|
||||
, m_locked(lockOnConsole)
|
||||
@@ -105,7 +105,6 @@ const char * ConsoleController::inputText(const char * prompt) {
|
||||
|
||||
void ConsoleController::viewWillAppear() {
|
||||
loadPythonEnvironment();
|
||||
m_sandboxIsDisplayed = false;
|
||||
if (m_importScriptsWhenViewAppears) {
|
||||
m_importScriptsWhenViewAppears = false;
|
||||
autoImport();
|
||||
@@ -257,13 +256,12 @@ bool ConsoleController::textFieldDidFinishEditing(TextField * textField, const c
|
||||
return false;
|
||||
}
|
||||
runAndPrintForCommand(text);
|
||||
if (m_sandboxIsDisplayed) {
|
||||
return true;
|
||||
if (!sandboxIsDisplayed()) {
|
||||
m_selectableTableView.reloadData();
|
||||
m_editCell.setEditing(true);
|
||||
textField->setText("");
|
||||
m_selectableTableView.selectCellAtLocation(0, m_consoleStore.numberOfLines());
|
||||
}
|
||||
m_selectableTableView.reloadData();
|
||||
m_editCell.setEditing(true);
|
||||
textField->setText("");
|
||||
m_selectableTableView.selectCellAtLocation(0, m_consoleStore.numberOfLines());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -290,15 +288,14 @@ bool ConsoleController::textFieldDidAbortEditing(TextField * textField) {
|
||||
}
|
||||
|
||||
void ConsoleController::displaySandbox() {
|
||||
if (m_sandboxIsDisplayed) {
|
||||
if (sandboxIsDisplayed()) {
|
||||
return;
|
||||
}
|
||||
m_sandboxIsDisplayed = true;
|
||||
stackViewController()->push(&m_sandboxController);
|
||||
}
|
||||
|
||||
void ConsoleController::resetSandbox() {
|
||||
if (!m_sandboxIsDisplayed) {
|
||||
if (!sandboxIsDisplayed()) {
|
||||
return;
|
||||
}
|
||||
m_sandboxController.reset();
|
||||
|
||||
Reference in New Issue
Block a user