Post Reply 
A program to calc leasing
05-21-2015, 10:33 AM
Post: #5
RE: A program to calc leasing
(05-20-2015 10:58 PM)salvomic Wrote:  <<<
DRAWMENU would be better, but for now I'm not so able to make one.
Please, help me to make one for the program!
Salvo
>>>

There may be several ways to approach this, but I keep a skeleton menu framework (program) in my "master program catalog," expressly for this. To use, just put routines (or subroutines) in between the (otherwise empty) IF END constructs, that relate to the soft buttons, as set up in DRAWMENU(). An example: the "Exit" soft button, (btn 6), and it's associated routine. Rename it to your program, and embellish as needed.

I hope you can find this useful, I know I sure have. One day, (maybe), I will take the time to try to work out how to do submenu popups, from DRAWMENU(). I started to do that once, but it quickly got to be a larger task than I wanted to deal with at that time. That is an exercise, as they say, left to the reader!

Grobs, using graphics commands, work well for creating dynamic, or interactive screen applications, made more useful when driven by soft menu selection on screen, from DRAWMENU(). Here's the code I use for this framework:

Code:

EXPORT menu()
BEGIN

  LOCAL m,m1,mx,my; // Mouse vars
  RECT();           // Clear Screen
  DRAWMENU("Btn1","Btn2","Btn3","Btn4","Btn5","Exit");     // Menu labels

  //Main loop 
  While 1 DO
    WHILE MOUSE(1)>=0 DO END;  // get mouse XY coordinates

    //Selection loop
    REPEAT
      m:=MOUSE;
      m1:=m(1);
    UNTIL SIZE(m1)>0;
      
    mx:=m1(1);
    my:=m1(2);
  
    // query softbuttons
    IF my>=220 AND my<=239 THEN

      // "Btn1" Menu button 1      
      IF mx>=0 AND mx<=51 THEN
     
      END;  //"Btn1" Btn 1

      // "Btn2" Menu button 2 
      IF mx>=53 AND mx<=104 THEN

      END;  //  "Btn2" btn 2

      // "Btn3" Menu button 3 
      IF mx>=106 AND mx<=157 THEN              

      END;    //  "Btn3" btn 3
    
      // "Btn" menu button 4
      IF mx>=159 AND mx<=210 THEN        
              
      END;   //  "Btn4" btn 4

      //"Btn5" menu button 5
      IF mx>=212 AND mx<=263 THEN  
       
      END;   //  "Match" btn 5

      // menu button 6 Exit
      IF mx>=265 AND mx<=316 THEN
        RETURN "Exit" ;
      END;   //  Menu btn 6
      
    END;  // Selection loop
  
  END;  // Main loop

END;  // program
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
A program to calc leasing - salvomic - 05-20-2015, 10:35 PM
RE: A program to calc leasing - DrD - 05-20-2015, 10:51 PM
RE: A program to calc leasing - salvomic - 05-20-2015, 10:58 PM
RE: A program to calc leasing - DrD - 05-21-2015 10:33 AM
RE: A program to calc leasing - salvomic - 05-21-2015, 10:47 AM
RE: A program to calc leasing - DrD - 05-21-2015, 03:45 PM
RE: A program to calc leasing - salvomic - 05-21-2015, 03:57 PM
RE: A program to calc leasing - salvomic - 05-21-2015, 08:47 AM
RE: A program to calc leasing - salvomic - 05-21-2015, 02:32 PM
RE: A program to calc leasing - salvomic - 05-23-2015, 05:15 PM



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