Commit Graph

35 Commits

Author SHA1 Message Date
Léa Saviot
2661032993 [apps/code] Fix Python loading when going in the VarBoxController
The Var box controller deinited python on exit, and the console
controller did not reload python + it made the console controller lose
all its context, such as imported scripts
2018-09-21 11:55:12 +02:00
Émilie Feral
afce751eb7 [code] Get rid of malloc: keep a buffer in Code::App to be used as python heap 2018-09-19 18:20:30 +02:00
Émilie Feral
837e0694d1 [shared] Remove New Function Cell class which is a duplicate of Even Odd
Message Text Cell
2018-06-07 13:46:17 +02:00
Romain Goyet
c0d3b97c6b [apps/code] Fix getopt handling 2018-06-05 13:57:04 +02:00
Émilie Feral
5cfe20ad15 [code] Move ConsoleController from MenuController to App 2018-05-23 10:01:15 +02:00
Léa Saviot
c4b5d4cf40 Merge branch 'SaisieJolieRebase1201' into SaisieJolieMerge10Apr
Change-Id: I802dbb9f7c0eebf75a1b6cd21ddd194e89b53752
2018-04-10 17:21:54 +02:00
Émilie Feral
9289928fff [apps] Code: abort script name editing if MenuController exits responder
chain
2018-04-06 10:14:13 +02:00
Émilie Feral
b0ede47d55 [ion] Change Storage design (former kallax) 2018-03-22 14:01:38 +01: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
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
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
4a3b935e7b [apps] Python: in the menu controller, the editable cells holding the
script names are not responder as long as they are not set as first
responder manually by renameSelectedScript for instance
2018-01-16 13:18:20 +01:00
Émilie Feral
e8793c429c [escher] In textfield: when calling textFieldDidHandleEvent, precise if
there was any modification in the text
2018-01-04 15:48:06 +01:00
Léa Saviot
71bfcbf5d7 [code] Cleaned the prevention of ".py" edition.
Now the MenuController changes the cursor location if needed once the
Textfield has handled the event.

Change-Id: I1ad3202402623dfa9a683866fef90ca33ddd6be0
2017-12-04 17:18:37 +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
37a2def2f1 [code] The maximal number of scripts is stored in the ScriptStore.
It was in the MenuController before.

Change-Id: I5f48465d92b53079dc358feec7a4b713875c7e2d
2017-12-01 12:06:05 +01:00
Léa Saviot
9d57d7f173 [code] Cleaned MenuController.
Change-Id: I499fcaf728a4f60557475b64e371a97e362b558d
2017-11-28 10:27:33 +01:00
Léa Saviot
c543145aae [code] Optimized MenuController's script list scrolling speed.
To know if the AddScript row should be displayed, we need to compute the free
space size of the accordion, which is very slow. We thus memoized a bool
indicating if the AddScript row should be displayed.

Change-Id: Ia3891c0fc8df9b0b8bf2a9ad053be6dfc848c970
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
57633829a9 [code] Split the Menu Controller in two columns.
The scripts names are on the right and open the script edition.
The left cells open the script options.

Change-Id: I3fbab8c3861f3395c3206775c92cda3470963b26
2017-11-17 14:05:23 +01:00
Léa Saviot
4f74b6d849 [code] The addScript button disappears when needed.
When there is already the maximal number of scripts or when the
ScriptStore accordion buffer is full.

Change-Id: I0d43d42626da7f060a2309c66f1806b35a29bf38
2017-11-17 14:05:23 +01:00
Léa Saviot
a19377ad5e [code] Default numbered script names (e.g. script1.py)
When the script name is empty after renaming a script, a default new name is
given. We look for the first available scriptI.py name, with 0<I<100.

Change-Id: If17f1df95c552320c0412ce652e7ae7e0cfd9cbc
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
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
a14cfd0aea [code] Script names are displayed and can be edited.
Change-Id: I5acc468920b66673e78da130bf90a74d0c062211
2017-11-17 11:59:50 +01:00
Léa Saviot
68f368fcde [code] The user can delete scripts.
Change-Id: I1b60a4c79a58efe5213add1b1c5d60cdfe85c1e6
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
f3200fe2e9 [code] Program store that uses an accordeon buffer to store the
programs. The user can now add scripts.
A contextual menu displays various options when clicking on a script,
such as editing.

Change-Id: I124a17f7584b0beedb897e8499ca0a1bb6c13cbe
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
Émilie Feral
304bbf18b9 [apps/code] Split the editor in editor and executor
Change-Id: I862deeb4fd84e8fb77bf880095f80c1a2a4d8c5d
2017-08-17 16:21:22 +02:00
Émilie Feral
8b6dfdc3f9 [apps/code] Add a menu to edit and execute the program
Change-Id: I036e5a32fa6823b25af4ccd742967841579d7639
2017-08-17 16:21:21 +02:00