Post Reply 
CSTMENU: multilevel custom menu with soft keys
01-08-2021, 05:15 PM (This post was last modified: 01-18-2021 04:01 PM by ramon_ea1gth.)
Post: #1
CSTMENU: multilevel custom menu with soft keys
Feel the power of the customized soft keys of the HP Prime. CSTMENU is a compact and elegant program that allows the customization of the soft keys in a consistent manner, whether for the global environment or for each Prime app. Now it is possible to have at any entry window your preferred characters or commands, e.g., Greek characters for scientific writing, preferred units for fast unit conversion or fast access commands with customized entry. Menus are swiftly managed with the four ways of the directional pad (left/right/up/down).

Example of creation of a simple custom menu:
+ Download CSTMENU.hpprgm to the HP Prime
+ Create the two required variables, CSTpos and CST with your custom menu:
{1,1}▶CSTpos
{{“A”,”B”,”ALOG()”,”α”,”β”,”1”,”2”,”3”}}▶CST
(notice the double curly brackets {{ in CST)
+ Switch to User mode: [SHIFT][USER][SHIFT][USER]

Now, your menu is ready. Press the Menu key. Use the directional pad (left/right) to navigate the menu. Press the desired softkey to output it. Each time you press the Menu key, you return to the last menu used.

Multiple menu levels:
CST can include multiple menu levels, e.g., for two levels: {{“1”,”2”,”3”,”4”,”5”,”6”,”7”,”8”}{“A”,”B”,”C”,”D”}}▶CST
To navigate the levels, use the up/down arrows of the directional pad.

Soft key labels different to the output:
CST can include pairs of {“label”,“output_text”} to create a different output than the soft key label, e.g., for fast unit conversion with the [STO>] soft key you can prepare this menu:
{{{“m”,”_(m)”},{“cm”,”_(cm)”},”Hello”,{“ALOG”,”ALOG()”}}}▶CST

A custom menu per app:
CSTMENU is very flexible, so you can prepare one customized menu per app if you use app variables, e.g.:
{1,1}▶AVars(“CSTpos”)
{{“A”,”B”,”ALOG()”,”α”,”β”,”1”,”2”,”3”}}▶AVars("CST")

And for you, the programmers, you can feel the flexibility of CSTMENU, so other programs can take advantage of it. Play with it to discover its power and have a customized HP Prime!


Attached File(s) Thumbnail(s)
   

.hpprgm  CSTMENU.hpprgm (Size: 6.41 KB / Downloads: 46)

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
01-09-2021, 11:16 AM
Post: #2
RE: CSTMENU: multilevel custom menu with soft keys
I just detected a small typo in the first version posted last January 8th, but with negligible impact. It is an input syntax check. However, the program has been updated in the main first post.
For those curious, the typo was in line 28. Originally it was written:
Code:
   IF TYPE(menuTMP(1))==2 AND TYPE(menuTMP(2)) THEN
    menuBAR(n):=menuTMP(1);
    menuCMD(n):=menuTMP(2);
   ELSE
    RETURN "Error in CST var format";
   END;

The correct writing is:
Code:
   IF TYPE(menuTMP(1))==2 AND TYPE(menuTMP(2))==2 THEN
    menuBAR(n):=menuTMP(1);
    menuCMD(n):=menuTMP(2);
   ELSE
    RETURN "Error in CST var format";
   END;

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
01-09-2021, 03:05 PM
Post: #3
RE: CSTMENU: multilevel custom menu with soft keys
Hi,

Thank for sharing.

KUDOS !

Gérard.
Find all posts by this user
Quote this message in a reply
01-09-2021, 08:43 PM
Post: #4
RE: CSTMENU: multilevel custom menu with soft keys
Great! Enjoy it!

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
01-31-2021, 09:42 AM
Post: #5
RE: CSTMENU: multilevel custom menu with soft keys
Bonjour

Je viens d'essayer ce programme rapidement, il me semble très
pratique et je trouve que c'est une excellente idée.
je vais tester plus sérieusement, merci pour ce programme.

Hello

I have just tried this program quickly, it seems to me very
practical and I think it's a great idea.
I will test more seriously, thank you for this program

Sorry for my english
Find all posts by this user
Quote this message in a reply
02-01-2021, 08:28 PM
Post: #6
RE: CSTMENU: multilevel custom menu with soft keys
Merci! J'espère que ça vous plait. C'est une application très simple mais très puissante!

Thank you! I hope you like it. It is a very simple but very powerful application!
;-)

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
02-28-2021, 01:03 AM (This post was last modified: 02-28-2021 01:19 AM by CharlieF.)
Post: #7
RE: CSTMENU: multilevel custom menu with soft keys
GREAT!!! Masterly!!

Thank you very much, Ramón!!

All the best.

Carlos
Madrid, Spain
Casio ClassPad II, HP17BII, HP48GX, HP50g, HP Prime G2
Find all posts by this user
Quote this message in a reply
03-20-2021, 11:53 AM (This post was last modified: 03-20-2021 12:47 PM by FrankP.)
Post: #8
RE: CSTMENU: multilevel custom menu with soft keys
Hi Ramon,
your really smart CST solution was for me missing a kind of title for sub menus. So I added a title to your CST syntax:
Code:

CST :=
 { { "menu1_title", {   "menu1_displ_and_out1"          ,
                        "menu1_displ_and_out2"          ,
                        ""                              ,
                      { "menu1_displ3" , "menu1_out3" } ,
                      { "menu1_displ4" , "menu1_out4" }
                    } 
   } ,
   { "menu2_title", {   "menu2_displ_and_out1"          ,
                      { "menu2_displ2" , "menu2_out2" } ,
                    }
 };
In addition I added information on the actual menu and page to the displayed title:
"m.<act_menu_num>/<all_menus_in_CST> p.<act_page_num>/<all_pages_in_act_menu>"

   

.zip  CstMenu.zip (Size: 7.69 KB / Downloads: 12)

---------

For another approach (needing even some lines of code less) refer to the following program 'menu'.
   
It makes use of a choice popup dialog for CST menu display. For longer texts to display a bit more beautiful, I think. Unfortunately <left> and <right> directional pad keys are not supported (failed hooking into choice command, only supporting <up> and <down>).
Menu list syntax in this prog expects each entry on the main menu have a seperate display and output text, whereas entries in submenus are always display and output the same string:
Code:

menuList :=
 { { "disp_text1",   "out_text1" },
   { "disp_text2",   "out_text2" },
   { "submenu1"  , { "menu1_disp_and_out1",
                     "menu1_disp_and_out2",
                     "menu1_disp_and_out3"
                   }
   },
   { "submenu2"  , { "menu2_disp_and_out1",
                     "menu2_disp_and_out2"
                   }
   }
 };


.zip  menu.zip (Size: 6.47 KB / Downloads: 9)
Find all posts by this user
Quote this message in a reply
04-08-2021, 09:09 PM
Post: #9
RE: CSTMENU: multilevel custom menu with soft keys
Great to see variations/improvements of CSTMENU! And of course, anyone can use it to create whatever kind of new program :-)

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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