Post Reply 
DRAWMENU pag.2 [Solved]
12-07-2015, 01:35 PM (This post was last modified: 09-06-2016 11:40 AM by jrozsas.)
Post: #1
DRAWMENU pag.2 [Solved]
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;

Leo

Visit this user's website Find all posts by this user
Quote this message in a reply
12-07-2015, 02:23 PM
Post: #2
RE: DRAWMENU pag.2
With DRAWMENU again. But you need to think a better flow for your program.

My website: erwin.ried.cl
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)