Softmenu - DrawMenu wrapper - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Softmenu - DrawMenu wrapper (/thread-2562.html) |
Softmenu - DrawMenu wrapper - Angus - 12-05-2014 10:47 AM For convenience with my user keyboard I ended up with the Softmenu function. Many might use something similar, but somebody might find the following helpful. In the example I use the different assignments CR Haeger suggested in the plotting from cas thread to SHIFT+D. Code: [/quote] Quick and dirty, I know. but I do use this kind a lot. Personally I am happy with the results - if we got some kind of autoexecute for the returned Strings (think about rpn) I would be pleased. In an other thread I asked if it is possible to distinguish between cas and home: I still could not figure out how that is done. RE: Softmenu - DrawMenu wrapper - Giancarlo - 12-08-2014 09:11 AM Hello Angus, i use pretty much the same code to display a menu. I only added a STARTVIEW(-1); before the DRAWMENU command. i like to see the home screen when displaying the menus and not see the list of programs. My 2 cents, Giancarlo RE: Softmenu - DrawMenu wrapper - Angus - 12-08-2014 11:50 AM The way I use the DRAWMENU command is with the user keyboard. The View Button is abused to display the Softmenu for a specific key. So I had no need to switch to home view. As stated before I would love to be able to 'autoexecute' anything on the entry line. That would solve many aspects and, correct me if I am wrong, it sounds realizable. RE: Softmenu - DrawMenu wrapper - Giancarlo - 12-08-2014 01:15 PM Hello, Unfortunately i don't remember the name of each program i write hence i always go to the program list and then click on the run soft button. This doesn't means that i like the way the programs are listed. If the menu directories like the hp48 won't be available, i'd like to have them anyway separated by subject or domain. At the moment i write one program, test it and once completed i paste it in another program which contains all the procedures written for the same argument. This is not very efficent but it prevent me from having dozens of programs mixed up... Thanks Giancarlo RE: Softmenu - DrawMenu wrapper - Snorre - 12-08-2014 02:22 PM Hello Giancarlo, just a suggestion: put special (to You) comments on top of each program and also above some EXPORTed functions/variables defining a menu location (e.g. //!menu: category subcategory ...) and/or some descriptive help text (e.g. //!purpose: hello world prog). Then write a starter program which uses these lines by utilizing the Programs() variable: 1. get all program names, 2. read each program's source and search for your special comments, 3. build an appropriate menu structure (with menus, submenus, ..., help texts), 4. let the user select an item and return the program.function name (with additional "()" if in non-rpn mode) Let a user key execute your starter. If the parsing takes too long, save the once built structure in a program-local variable and rebuild only if manually requested. |