mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[code] Python console that stores and displays commands that are
entered. Change-Id: I0343c38b60f4bbea6dfab173e2b5f46f66b83251
This commit is contained in:
35
apps/code/console_edit_cell.cpp
Normal file
35
apps/code/console_edit_cell.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "console_edit_cell.h"
|
||||
#include <escher/app.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace Code {
|
||||
|
||||
ConsoleEditCell::ConsoleEditCell(Responder * parentResponder, TextFieldDelegate * delegate) :
|
||||
HighlightCell(),
|
||||
Responder(parentResponder),
|
||||
m_textField(this, m_textBuffer, m_draftTextBuffer, TextField::maxBufferSize(), delegate)
|
||||
{
|
||||
}
|
||||
|
||||
int ConsoleEditCell::numberOfSubviews() const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
View * ConsoleEditCell::subviewAtIndex(int index) {
|
||||
assert(index == 0);
|
||||
return &m_textField;
|
||||
}
|
||||
|
||||
void ConsoleEditCell::layoutSubviews() {
|
||||
m_textField.setFrame(bounds());
|
||||
}
|
||||
|
||||
void ConsoleEditCell::didBecomeFirstResponder() {
|
||||
app()->setFirstResponder(&m_textField);
|
||||
}
|
||||
|
||||
void ConsoleEditCell::setEditing(bool isEditing) {
|
||||
m_textField.setEditing(isEditing);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user