Post Reply 
DRAWMENU function.
02-11-2014, 02:50 PM (This post was last modified: 02-11-2014 06:40 PM by Damien.)
Post: #5
RE: DRAWMENU function.
Hi, Giancarlo

This code based on yours should work:
Code:

EXPORT Prova_mn()
 BEGIN
 RECT_P();
 DRAWMENU("uno","due","tre","quatro","cinco","SEI");
 local mx,my,m,l;
 WHILE 1 do
  l:=WAIT(-1);// wait for a user input
  IF TYPE(l)==6 THEN // verify that we have a list corresponding to a mouse down...
   IF l(1)>0 THEN // is the list empty or not
    mx:=B→R(l(2));my:=B→R(l(3)); // x and y for the click zone
     IF my>220 then // in the menu zone
     CASE
      IF   0 <= mx <=  51 THEN m:= 1; END;
      IF  53 <= mx <= 104 THEN m:= 2; END;
      IF 106 <= mx <= 157 THEN m:= 3; END;
      IF 159 <= mx <= 210 THEN m:= 4; END;
      IF 212 <= mx <= 263 THEN m:= 5; END;
      IF 265 <= mx <= 319 THEN m:= 6; END;
      DEFAULT m:=-2; // if it's right in between menu options
     END; // end_of_case
    END;  // end_of_if_my>220
    RETURN m;
   END;
  END;
 // end_of_if_type
 END; 
// end_of_while
END;  // end_of everything

Regards.

Damien.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DRAWMENU function. - veeblefester - 02-07-2014, 11:10 AM
RE: DRAWMENU function. - Marcus von Cube - 02-09-2014, 02:49 PM
RE: DRAWMENU function. - dg1969 - 02-09-2014, 06:31 PM
RE: DRAWMENU function. - Giancarlo - 02-11-2014, 07:14 AM
RE: DRAWMENU function. - Han - 02-11-2014, 06:17 PM
RE: DRAWMENU function. - Damien - 02-11-2014 02:50 PM
RE: DRAWMENU function. - Giancarlo - 02-11-2014, 08:40 PM



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