Commit Graph

98 Commits

Author SHA1 Message Date
Émilie Feral
da8286d3f7 [code] Escaping the input loop on a 'home' event should be handled by
the code app instead of the console controller to ensure to escape the
input loop even when the toolbox (or any modal) is displayed
2018-05-23 10:01:15 +02:00
Léa Saviot
3b582a2e46 Merge branch 'SaisieJolie30Apr' into SaisieJolie8May
Change-Id: Ia4196119fc56c5bc3423aea752b49f3f7ba39499
2018-05-08 15:17:51 +02:00
Romain Goyet
84561a929f [escher] Clean the ScrollView, TableView and SelectableTableView constructors 2018-04-18 18:08:07 +02:00
Léa Saviot
c4b5d4cf40 Merge branch 'SaisieJolieRebase1201' into SaisieJolieMerge10Apr
Change-Id: I802dbb9f7c0eebf75a1b6cd21ddd194e89b53752
2018-04-10 17:21:54 +02:00
Émilie Feral
b714d9242e [apps] Code: when in input loop, handle 'up' event 2018-04-09 14:42:26 +02:00
Émilie Feral
9cadc49264 [apps] Code: Fix autoImportScript to avoid corrupting stack 2018-03-28 10:03:36 +02:00
Émilie Feral
f1ddf1dbf4 Valgrind: uninitialized value, memory leak 2018-03-28 10:02:09 +02:00
Émilie Feral
19ca0f0640 [apps] Code: use the FileSystem to store the scripts instead of an
accordion
2018-03-22 14:01:38 +01:00
Émilie Feral
3db86a8111 [apps] Code: merge actions for text input in ConsoleController and
EditorController
2018-03-22 13:12:12 +01:00
Émilie Feral
aade7cb2fe [escher] Create a class TextInput (from which derived TextField,
TextArea)
2018-03-22 13:12:12 +01:00
Émilie Feral
576caa039f [apps][escher] Add methods 'handleEventWithText' in TextField and
TextArea to fix bug in probability (adding a toolbox text from the
calculations controller)
2018-03-22 13:12:12 +01:00
Émilie Feral
c5e525ddb7 Enable to give options at run-time 2018-03-22 11:58:56 +01:00
Romain Goyet
fd7516f8ac [python] "input" now displays the provided prompt 2018-02-01 14:10:26 +01:00
Romain Goyet
0682d21a32 [python] Implement ExecutionEnvironment::input
By using a re-entrant RunLoop call
2018-02-01 14:10:26 +01:00
Romain Goyet
651d5715e4 [python] Adding mp_hal_input 2018-02-01 14:10:26 +01:00
Léa Saviot
a2c0eaa20b [apps/escher] Remove textFieldDidAbortEditing const char * argument.
Also removed the same argument in scrollableExpressionViewWithCursorDidAbortEditing.

Change-Id: Iadc6b708cfc0fab44b9fd4edb980cb759d41e8d0
2018-01-23 10:28:02 +01:00
Émilie Feral
077a95197e [escher] SelectableTableView handles setting the ccell as first
responder if needed
2017-12-20 17:17:41 +01:00
Léa Saviot
dcd5d05537 [code] Fixed selection bug in the console history.
When clearing the console history, the previously selected cell was not
unhighlighted. This sometimes caused a random cell to be highlighted when
adding new commands.

Change-Id: I393446527fc06d7ae075c21124cb78e09d63ef99
2017-12-05 11:28:23 +01:00
Léa Saviot
56ac5071f2 [code] Fixed table reload when executing one script.
Before, the history would not redraw itself properly when selecting
"Execute Script" from a script's options.

Change-Id: Ibefd920eb038165a81ddb464dbf889047ad1f370
2017-12-04 13:51:38 +01:00
Léa Saviot
b27551ce4f [code] Fixed bug when importing scripts that draw on screen.
The drawing should happen after the ConsoleController is pushed on the
screen. This means that the importation of scripts should be done at the
ConsoleController's viewWillAppear.

Change-Id: I756ac9de30f339dc4f6aa8d3995abea0a46d03b5
2017-12-04 12:11:00 +01:00
Léa Saviot
d05ca726b6 [code] Delete specific lines in the console history with backspace.
Change-Id: I9ed4709937f35c67aea0b958fabbad145b8c0c80
2017-12-01 16:18:34 +01:00
Léa Saviot
7c4e5ec583 [code] Color the console history in grey when unloading Python.
Change-Id: I7f802ee5858e6a9944fd3f2455fac58106e2adeb
2017-12-01 16:11:31 +01:00
Léa Saviot
d732bce90f [code] The user can clear the console history.
Change-Id: Ice8143f9c424764f6729feab0d73d39d91f896fd
2017-12-01 13:46:31 +01:00
Léa Saviot
53d2ae2c46 [code] Rename Code::Toolbox in Code::PythonToolbox for more clarity.
Change-Id: I3729fedd8a26531edcd17105ed5fc177c06a8fcb
2017-12-01 13:19:30 +01:00
Léa Saviot
dd1fe77832 [code] Fixed Execute Script bug.
When disabling a script auto-import parameter, it would not import
itself when executing it from its script parameters menu.

Change-Id: If58f6fe1be4792b551ad3b462f1f43e8b82e8148
2017-12-01 13:19:30 +01:00
Léa Saviot
6ab9a36472 [code] The console history is not emptied when reloading Python.
Change-Id: I5dedcfc8279f5f4fe9846419f6861c7d7cb3f973
2017-12-01 13:19:30 +01:00
Léa Saviot
e43bbd38f2 [escher] Fixed TextField bug.
The Statistics apps crashed when navigating the Data table.
 -> Check that the textfield is editing before calling
textFieldShouldFinishEditing.
 -> Changed textLength() to draftTextLength().

Change-Id: Id373a7cd50438303f470abc5bcee7a795c33926a
2017-12-01 13:19:30 +01:00
Léa Saviot
1ce6f36651 [code] Fixed the wait for user input after drawing using Python.
A SandboxController is now pushed on the StackViewController and sets the
KDIonContext::sharedContext before drawing, sets a white background and handles
user input after the Python computation to dismiss the drawing screen.

Change-Id: I51b0474365a85e845227379a16d090541fa8ded7
2017-12-01 13:19:28 +01:00
Léa Saviot
e6b4d07cb6 [code] Dynamic toolbox that displays script functions and variables.
Change-Id: Id1494580b3832540633d3aefaf04710d21e0a44c
2017-12-01 12:06:05 +01:00
Léa Saviot
9d82804ff3 [code/emscripten] On emscripten, fixed waiting after a Python drawing.
The user can now push OK or Back to remove a Python drawing.

Change-Id: I293064a9458f8c0c6d0da5351500600fd9e82706
2017-12-01 12:06:05 +01:00
Léa Saviot
a9f4da92c0 [code/python] Fixed the Kandinsky module in Python.
User can draw on the 320*220 drawing screen.

Change-Id: I25034b05f21aacc35608358fdb7a4d9924dd22e8
2017-11-21 17:12:38 +01:00
Léa Saviot
c8a5f4dbe2 [code] Fixed bug in console history copy-paste.
The ConsoleController also tried to copy-paste the edit textfield.

Change-Id: Ib1e8d003a9c4793c0666d489f4b4278759eff484
2017-11-17 14:05:23 +01:00
Léa Saviot
6baaa8547a [code] Execute a script from the script options.
A button in the options opens the console, with only the current script
imported.

Change-Id: Ia3053534d6fdb2bd1340ce3c42b7249510c97bbc
2017-11-17 14:05:23 +01:00
Léa Saviot
414e537969 [code] Empty console commands are not accepted.
Change-Id: Ie6affec97669312566c1b360bb2220f2c8723219
2017-11-17 14:05:23 +01:00
Léa Saviot
4194165217 [apps] Fixed size_t / int comparison warnings.
Change-Id: I08bae0d687a52d708053c4279f68b42c5bb5d180
2017-11-17 11:59:50 +01:00
Léa Saviot
13bf8c2d62 [code] Python toolbox.
Change-Id: I4028b05c662cae04a5ac3af5021f3438bb22dcd0
2017-11-17 11:59:50 +01:00
Léa Saviot
2456c7eeba [code] Improved console command editing.
When the user scrolls the history, the draft command is not erased.
When pasting a previous command, the text is inserted at the cursor
location.

Change-Id: I1cd9645de74f34fad4ed0898203e05bd3352456a
2017-11-17 11:59:50 +01:00
Léa Saviot
59d0e6dabf [code] Left/right navigation in the console history.
Change-Id: Ibbd534aa80f2f8dcb41d10e38f4abfcc7dbfd4a7
2017-11-17 11:59:50 +01:00
Léa Saviot
ce51228ca8 [escher/code] Changed Console and TitleBar margins.
Change-Id: I8ac4d84da84e0194122f34bb6259a1a7b6a1c81e
2017-11-17 11:59:50 +01:00
Léa Saviot
fbdf6379d8 [code] Script editor and Console are stacked.
Before, they appeared in modal views.

Change-Id: I42ea742370cd3cf0854965f67fc44b43db4cc309
2017-11-17 11:59:50 +01:00
Léa Saviot
6ee47d6168 [code] Prevent script name extension edition.
Change-Id: I4ac8d032fd88b853670afeebaecc8d6fd5ef981d
2017-11-17 11:59:50 +01:00
Léa Saviot
b7baec4a40 [code] Keyboard events translation, for script or command edition.
For instance, the "power" event should insert "**" in the text, not "^".
Added a universal i18n file in apps/code.

Change-Id: I5d067b0c5b86590af95aa98856522d54e42acba6
2017-11-17 11:59:50 +01:00
Léa Saviot
239e702d37 [code] Navigation in the console history.
The user can copy previous commands or results, into the clipboard or in
the console prompt.

Change-Id: I280fff2d4937f4d17ab6c8907d6e5c359a322372
2017-11-17 11:59:50 +01:00
Léa Saviot
35520fb3d4 [code] Scripts can be automatically imported when the console is opened.
Editing, renaming, deleting or changing the auto-importation of a script
triggers the reloading of the console (the history is cleared, Python
restarted and the scripts re-imported).

Change-Id: If8b933cc077ecd36cab09214b5e7a181aa3ae030
2017-11-17 11:59:50 +01:00
Léa Saviot
5de4b5cd67 [code] Each script has a name, stored in the accordeon buffer.
A script can now be imported in the console.
Moved all the MicroPython functions to python/port files.

Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7
2017-11-17 11:59:50 +01:00
Léa Saviot
adabf95b59 [code] The interface is a list with a button at the bottom to
start the console.

Change-Id: I4a4a432db2d4cdc72e9a0ad7aa5904c1ded3c0e1
2017-11-17 11:59:50 +01:00
Léa Saviot
c57f9cf8b1 [code] The Python console compiles and executes commands entered.
It stores and displays the result in the console store.
An empty line returned at the end of the execution is deleted.

Change-Id: Ic90e02e2d91d0a0033413da0588032d9450aefd0
2017-11-17 11:59:50 +01:00
Léa Saviot
493cef0d4d [code] Python console that stores and displays commands that are
entered.

Change-Id: I0343c38b60f4bbea6dfab173e2b5f46f66b83251
2017-11-17 11:59:50 +01:00