Post Reply 
Choose Funktion in an Choose Funktion
05-17-2015, 07:54 PM
Post: #7
RE: Choose Funktion in an Choose Funktion
(05-17-2015 07:26 PM)kharpster Wrote:  
(05-17-2015 07:10 PM)petaks01 Wrote:  Where did you get the screenshot from?
I guess the code behind it has some hints...

That looks like a system menu/sub menu and not a choose command. In so far I can tell we do not yet have the ability to create submenus in our programs.

Sub menus can be created, but not in the cascaded style in the screenshot. I created a custom choose box popup menu with sub menus where the sub menu replaces the parent menu on the screen. I use it to consolidate some of my most used programs.
That isn't the cascaded style but probably the next best thing.

------------------------------------------------------------
lastunit:={0,0};

KEY K_Space()
BEGIN
local list1:={"Electrical Eng",
"Geometry","Deg2Rad",
"Rad2Deg",
"atan2","DTAG",
"Slope"};
local list2:={{"Parallel_Resistance",
"Coulomb","in"},
{"Area_circle",
"Vol_sphere",
"Area_cyl"}};
local c1,c2;
if lastunit(1) OR lastunit(2) then
c1:=lastunit(1); c2:=lastunit(2);
choose(c2,list1(c1),list2(c1));
else
c1:=0; c2:=0;
end;

if c2==0 then
repeat
choose(c1,"User Functions",list1);
if c1<3 then
choose(c2,list1(c1),list2(c1));
else

RETURN list1(c1);
end;
until c1==0 OR c2;
lastunit:={c1,c2};
end;

if c2 then
return(list2(c1,c2));
end;
END;
----------------------------------------------------------
This program is based on example that I believe Han posted a while back to a similar question that I had about nested popup menus.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Choose Funktion in an Choose Funktion - John Colvin - 05-17-2015 07:54 PM



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