BBS: Inland Empire Archive Date: 12-26-92 (00:06) Number: 376 From: SCOTT MAYFIELD Refer#: NONE To: JEFF JOHNSTON Recvd: NO Subj: PULLDOWN PT 2/2 Conf: (2) Quik_Bas
FUNCTION AltKeyPressed% DEF SEG = 0 Tmp% = PEEK(1047) AND 8 SELECT CASE Tmp% CASE 0: AltKeyPressed% = FALSE CASE 8: AltKeyPressed% = TRUE END SELECT DEF SEG END FUNCTION SUB DropMenu (MenuIndex%) ' This section I've left to you. There are many approaches to drawing ' the menus, and then adding the ability to control how the user selects ' each item (i.e. a highlite bar moving with cursor keys, hot keys, ' both, etc). SELECT CASE MenuIndex% CASE 1: ' Draw file menu... ' Get user choice from menu... SELECT CASE Choice% CASE 1: ' Perform some action... CASE 2: ' Perform some action... END SELECT ' Erase menu CASE 2: ' Draw edit menu... ' Get user choice from menu... SELECT CASE Choice% CASE 1: ' Perform some action... CASE 2: ' Perform some action... END SELECT ' Erase menu ' ----------------------------------------------------------------- ' CASE statements for MenuIndex% = 3,4,5,6,7,8 have been ommited to ' shorten the post...They are identical in form. ' ----------------------------------------------------------------- END SELECT END SUB SUB HideMenu Row% = CSRLIN Col% = POS(x) LOCATE 1, 1 PRINT SPACE$(80); LOCATE Row%, Col% END SUB DEFSNG A-Z SUB InitMenu (Menu$(), MenuBar$) Menu$(1) = " File " Menu$(2) = " Edit " Menu$(3) = " View " Menu$(4) = " Search " Menu$(5) = " Run " Menu$(6) = " Debug " Menu$(7) = " Calls " Menu$(8) = " Options " MenuBar$ = "" FOR I% = 1 TO MENUITEMS MenuBar$ = MenuBar$ + Menu$(I%) NEXT I% MenuBar$ = MenuBar$ + SPACE$(80 - LEN(MenuBar$)) END SUB DEFINT A-Z SUB ShowMenu (MenuBar$) Row% = CSRLIN Col% = POS(x) COLOR 0, 7 LOCATE 1, 1 PRINT MenuBar$; LOCATE Row%, Col% COLOR 7, 0 END SUB --- TMail v1.31 * Origin: Toledo's TBBS, 4+ gigs, 50,000 files 313-854-6001 (1:234/2)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET