mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code/tests] Fix issue with toolboxIonKeys
This commit is contained in:
@@ -30,6 +30,7 @@ app_code_test_src = $(addprefix apps/code/,\
|
||||
|
||||
tests_src += $(addprefix apps/code/test/,\
|
||||
variable_box_controller.cpp\
|
||||
toolbox_ion_keys_dummy.cpp \
|
||||
)
|
||||
|
||||
app_code_src += $(app_code_test_src)
|
||||
|
||||
@@ -124,10 +124,6 @@ Toolbox * App::toolboxForInputEventHandler(InputEventHandler * textInput) {
|
||||
return &m_toolbox;
|
||||
}
|
||||
|
||||
Code::toolboxIonKeys * App::toolboxIonKeys() {
|
||||
return &m_toolboxIonKeys;
|
||||
}
|
||||
|
||||
VariableBoxController * App::variableBoxForInputEventHandler(InputEventHandler * textInput) {
|
||||
return &m_variableBoxController;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "python_toolbox.h"
|
||||
#include "variable_box_controller.h"
|
||||
#include "../shared/shared_app.h"
|
||||
#include "toolbox_ion_keys.h"
|
||||
|
||||
namespace Code {
|
||||
|
||||
@@ -78,8 +77,6 @@ public:
|
||||
|
||||
static constexpr int k_pythonHeapSize = 100000;
|
||||
|
||||
Code::toolboxIonKeys * toolboxIonKeys();
|
||||
|
||||
private:
|
||||
/* Python delegate:
|
||||
* MicroPython requires a heap. To avoid dynamic allocation, we keep a working
|
||||
@@ -96,7 +93,6 @@ private:
|
||||
StackViewController m_codeStackViewController;
|
||||
PythonToolbox m_toolbox;
|
||||
VariableBoxController m_variableBoxController;
|
||||
Code::toolboxIonKeys m_toolboxIonKeys;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -495,8 +495,8 @@ bool PythonToolbox::selectLeaf(int selectedRow) {
|
||||
m_selectableTableView.deselectTable();
|
||||
ToolboxMessageTree * node = (ToolboxMessageTree *)m_messageTreeModel->childAtIndex(selectedRow);
|
||||
if(node->insertedText() == I18n::Message::IonSelector){
|
||||
App::app()->toolboxIonKeys()->setSender(sender());
|
||||
Container::activeApp()->displayModalViewController(static_cast<ViewController*>(App::app()->toolboxIonKeys()), 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin);
|
||||
m_ionKeys.setSender(sender());
|
||||
Container::activeApp()->displayModalViewController(static_cast<ViewController*>(&m_ionKeys), 0.f, 0.f, Metric::PopUpTopMargin, Metric::PopUpLeftMargin, 0, Metric::PopUpRightMargin);
|
||||
return true;
|
||||
}
|
||||
const char * editedText = I18n::translate(node->insertedText());
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <escher.h>
|
||||
#include <ion/events.h>
|
||||
#include <kandinsky/font.h>
|
||||
#include "toolbox_ion_keys.h"
|
||||
|
||||
namespace Code {
|
||||
|
||||
@@ -32,6 +33,7 @@ private:
|
||||
void scrollToAndSelectChild(int i);
|
||||
MessageTableCellWithMessage m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
MessageTableCellWithChevron m_nodeCells[k_maxNumberOfDisplayedRows];
|
||||
toolboxIonKeys m_ionKeys;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
27
apps/code/test/toolbox_ion_keys_dummy.cpp
Normal file
27
apps/code/test/toolbox_ion_keys_dummy.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "../toolbox_ion_keys.h"
|
||||
|
||||
namespace Code {
|
||||
toolboxIonKeys::toolboxIonKeys() :
|
||||
ViewController(nullptr),
|
||||
m_view()
|
||||
{
|
||||
}
|
||||
|
||||
bool toolboxIonKeys::handleEvent(Ion::Events::Event e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
toolboxIonKeys::toolboxIonView::toolboxIonView():
|
||||
View()
|
||||
{
|
||||
}
|
||||
|
||||
void toolboxIonKeys::toolboxIonView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
return;
|
||||
}
|
||||
|
||||
View * toolboxIonKeys::view(){
|
||||
return &m_view;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user