From 13bf8c2d62f9577ced3ead304f604c2c1482abad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Tue, 31 Oct 2017 16:42:29 +0100 Subject: [PATCH] [code] Python toolbox. Change-Id: I4028b05c662cae04a5ac3af5021f3438bb22dcd0 --- apps/code/Makefile | 13 + apps/code/app.cpp | 21 +- apps/code/app.h | 8 + apps/code/catalog.de.i18n | 74 +++++ apps/code/catalog.en.i18n | 74 +++++ apps/code/catalog.es.i18n | 74 +++++ apps/code/catalog.fr.i18n | 74 +++++ apps/code/catalog.pt.i18n | 74 +++++ apps/code/catalog.universal.i18n | 79 ++++++ apps/code/console_controller.cpp | 7 +- apps/code/console_controller.h | 5 +- apps/code/editor_controller.cpp | 6 + apps/code/editor_controller.h | 2 +- apps/code/helpers.cpp | 1 + apps/code/script_template.h | 26 +- apps/code/toolbox.cpp | 264 ++++++++++++++++++ apps/code/toolbox.de.i18n | 4 + apps/code/toolbox.en.i18n | 4 + apps/code/toolbox.es.i18n | 4 + apps/code/toolbox.fr.i18n | 4 + apps/code/toolbox.h | 36 +++ apps/code/toolbox.pt.i18n | 4 + apps/code/toolbox.universal.i18n | 45 +++ apps/i18n.py | 12 +- apps/math_toolbox.cpp | 16 +- apps/shared/Makefile | 1 + apps/shared/toolbox_helpers.cpp | 44 +++ apps/shared/toolbox_helpers.h | 25 ++ escher/include/escher/metric.h | 1 + escher/include/escher/responder.h | 2 +- escher/include/escher/table_cell.h | 1 - escher/include/escher/text_area.h | 2 +- .../src/message_table_cell_with_message.cpp | 4 + escher/src/responder.cpp | 4 - escher/src/table_cell.cpp | 3 +- escher/src/text_area.cpp | 19 +- escher/src/text_field.cpp | 6 +- escher/src/toolbox.cpp | 7 +- 38 files changed, 1001 insertions(+), 49 deletions(-) create mode 100644 apps/code/catalog.de.i18n create mode 100644 apps/code/catalog.en.i18n create mode 100644 apps/code/catalog.es.i18n create mode 100644 apps/code/catalog.fr.i18n create mode 100644 apps/code/catalog.pt.i18n create mode 100644 apps/code/catalog.universal.i18n create mode 100644 apps/code/toolbox.cpp create mode 100644 apps/code/toolbox.de.i18n create mode 100644 apps/code/toolbox.en.i18n create mode 100644 apps/code/toolbox.es.i18n create mode 100644 apps/code/toolbox.fr.i18n create mode 100644 apps/code/toolbox.h create mode 100644 apps/code/toolbox.pt.i18n create mode 100644 apps/code/toolbox.universal.i18n create mode 100644 apps/shared/toolbox_helpers.cpp create mode 100644 apps/shared/toolbox_helpers.h diff --git a/apps/code/Makefile b/apps/code/Makefile index 536375719..0c5e82383 100644 --- a/apps/code/Makefile +++ b/apps/code/Makefile @@ -14,6 +14,7 @@ app_objs += $(addprefix apps/code/,\ script_parameter_controller.o\ script_store.o\ script_template.o\ + toolbox.o\ ) i18n_files += $(addprefix apps/code/,\ @@ -23,6 +24,18 @@ i18n_files += $(addprefix apps/code/,\ base.fr.i18n\ base.pt.i18n\ base.universal.i18n\ + catalog.de.i18n\ + catalog.en.i18n\ + catalog.es.i18n\ + catalog.fr.i18n\ + catalog.pt.i18n\ + catalog.universal.i18n\ + toolbox.de.i18n\ + toolbox.en.i18n\ + toolbox.es.i18n\ + toolbox.fr.i18n\ + toolbox.pt.i18n\ + toolbox.universal.i18n\ ) app_images += apps/code/code_icon.png diff --git a/apps/code/app.cpp b/apps/code/app.cpp index b2d836cee..ffc1c6803 100644 --- a/apps/code/app.cpp +++ b/apps/code/app.cpp @@ -1,6 +1,7 @@ #include "app.h" #include "../apps_container.h" #include "code_icon.h" +#include "../shared/toolbox_helpers.h" #include "../i18n.h" namespace Code { @@ -38,7 +39,25 @@ App::App(Container * container, Snapshot * snapshot) : ::App(container, snapshot, &m_codeStackViewController, I18n::Message::Warning), m_listFooter(&m_codeStackViewController, &m_menuController, &m_menuController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey), m_menuController(&m_listFooter, snapshot->scriptStore(), &m_listFooter), - m_codeStackViewController(&m_modalViewController, &m_listFooter) + m_codeStackViewController(&m_modalViewController, &m_listFooter), + m_toolboxActionForTextArea([](void * sender, const char * text) { + TextArea * textArea = static_cast