DRAWMENU pag.2 [Solved] - 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: DRAWMENU pag.2 [Solved] (/thread-5289.html) |
DRAWMENU pag.2 [Solved] - jrozsas - 12-07-2015 01:35 PM Hi! In this example we have designed a menu on the screen. How to make choosing NEXT option a second menu to appear? CODE: EXPORT EC(x) BEGIN // CAS Custom Menu // EWS 2014-04-20 LOCAL m,m1,mx,my; WHILE MOUSE(1)≥0 DO END; RECT; TEXTOUT_P("Choose the function.",1,1,4); TEXTOUT_P("head: 1st element of a list",1,18,4); TEXTOUT_P("tail: all elements of a list except the 1st",1,35,4); TEXTOUT_P("l2norm: L-2 norm of a vector",1,52,4); TEXTOUT_P("ker: kernel of a matrix",1,69,4); TEXTOUT_P("SPECRAD: spectral radius of a matrix",1,86,4); TEXTOUT_P("Next: is the next DRAWMENU",1,103,4); DRAWMENU("head","tail","l2norm","ker","SPECRAD","Next"); REPEAT m:=MOUSE; m1:=m(1); UNTIL SIZE(m1)>0; mx:=m1(1); my:=m1(2); IF my≥220 AND my≤239 THEN IF mx≥0 AND mx≤51 THEN RETURN SUB(x,1,1); END; IF mx≥53 AND mx≤104 THEN RETURN SUB(x,2,SIZE(x)); END; IF mx≥106 AND mx≤157 THEN RETURN exact(ABS(x)); END; IF mx≥159 AND mx≤210 THEN RETURN ker(x); END; IF mx≥212 AND mx≤263 THEN RETURN CAS.SPECNORM(x); END; IF mx≥265 AND mx≤319 THEN //NEXT MENU???? END; END; END; RE: DRAWMENU pag.2 - eried - 12-07-2015 02:23 PM With DRAWMENU again. But you need to think a better flow for your program. |