Post Reply 
Custom Menus on High-End RPL Machines
04-04-2019, 05:22 PM (This post was last modified: 04-05-2019 02:02 AM by Claudio L..)
Post: #25
RE: Custom Menus on High-End RPL Machines
Back to the original topic: it's a really nice write-up about the menu systems. Thanks!

Just wanted to chime in and comment on the next iteration of this menu system (present in newRPL).

Code:

+------------+--------------------------------------------------------------+
| ENTRY MODE | PRESSING [id] W/O SHIFT:                                     |
+------------+--------------------------------------------------------------+
| IMMEDIATE  | (If a command line is present, executes it, then) executes   |
|            | the contents of the global variable named id. (*)            |
|            |                                                              |
| ALGEBRAIC  | Echoes the string "id" (without quotes) to the command line. |
|            |                                                              |
| PROGRAM    | Echoes the string "id" (without quotes) to the command line, |
|            | surrounded by spaces.                                        |
|            |                                                              |
| ALG + PRG  | --- same as in ALGEBRAIC mode ---                            |
+------------+--------------------------------------------------------------+

The entry modes remained unaltered, the main change is that menu entries that refer to directories are executed transparently (the directory is made current) without ever leaving the command line. For the same reason, UPDIR and HOME will change directory allowing full directory navigation while the command line is active.
Also, a minor thing is that commands that are valid functions in algebraic expressions will be inserted including a pair of parenthesis when in ALGEBRAIC mode.(EDIT: Nothing new about this, thanks Giuseppe!)
Finally, a press and hold on any menu key brings up the help for that key. If it's a variable it shows a preview of the contents.

Code:

+------------+--------------------------------------------------------------+
| ENTRY MODE | PRESSING LEFT SHIFT + [id]:                                  |
+------------+--------------------------------------------------------------+
| IMMEDIATE  | (If a command line is present, executes it, then) stores the |
|            | object on stack level 1 in the global variable named id. (*) |
|            |                                                              |
| ALGEBRAIC  | --- same as in IMMEDIATE mode ---                            |
|            |                                                              |
| PROGRAM    | Echoes the string "'id' STO" (without double quotes) to the  |
|            | command line, surrounded by spaces.                          |
|            |                                                              |
| ALG + PRG  | --- same as in PROGRAM mode ---                              |
+------------+--------------------------------------------------------------+

This remains largely unaltered.

Code:

+------------+--------------------------------------------------------------+
| ENTRY MODE | PRESSING RIGHT SHIFT + [id]:                                 |
+------------+--------------------------------------------------------------+
| IMMEDIATE  | (If a command line is present, executes it, then) recalls    |
|            | the contents of the global variable named id.                |
|            |                                                              |
| ALGEBRAIC  | --- same as in IMMEDIATE mode ---                            |
|            |                                                              |
| PROGRAM    | Echoes the string "'id' RCL" (without double quotes) to the  |
|            | command line, surrounded by spaces.                          |
|            |                                                              |
| ALG + PRG  | --- same as in PROGRAM mode ---                              |
+------------+--------------------------------------------------------------+

In ALGEBRAIC mode, Right-Shift+id just types the name of the variable in the command line, same as without a shift. With Right-Shift(hold)+id it will decompile the contents of the variable and insert it as text in the command line (transparent RCL, then insert as text). This works both in ALGEBRAIC and PROGRAM mode.

Perhaps the biggest change in the menu system is the use of 2 menus. Both are active at all times, one of them can be hidden temporarily (but its keys will be still active and can be used). This allows to have helpful commands in one menu, while keeping your variables in the second, which incidentally works quite well with the transparent directory navigation.

As far as customization, there was an improvement in that area as well: each menu key has various objects:
Display
Action
Help

They may or may not be the same object, and any of the objects can be a program.
The default behavior for the Display object is to decompile and display the object (or display the bitmap if it's a bitmap). If it's a program it executes the program first, and then decompiles and displays the result of the program (which may also be a bitmap).
The Action object can be a single object or a list of objects (representing the different shift planes). The default behavior is to execute the object (or program).
The Help object will:
* If it's a single command, get a help message from the library.
* If it's a variable, preview its contents.
* If it's a program, it runs and then display the results.
* Any other object will be decompiled and displayed.

Finally, any program can be a "normal" RPL program << >> or a secondary type program :: ; which will be executed transparently if there's a command line open (so it works like TakeOver without sysRPL).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Custom Menus on High-End RPL Machines - Claudio L. - 04-04-2019 05:22 PM



User(s) browsing this thread: 1 Guest(s)