5748345 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$ cat -n vertsamp.bas
   1: DECLARE SUB VerticalMenu (boxstyle%, fc%, bc%, tr%, lc%, row%)
   2: CLS
   3: PRINT STRING$(2080, 219)
   4: 
   5: VerticalMenu 1, 15, 9, 7, 22, 8
   6: '            ³  ³   ³   ³  ÀÄÄ¿ÀÄÄÄ¿
   7: '  boxstyle%ÄÙ  fc% bc% ÀÄtr% lc%  row%
   8: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
   9: ' Boxstyle:
  10: ' There are five choices of boxstyles (Press F 3 on the Tools Menu
  11: ' to see what they look like.)
  12: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  13: ' Fc%:
  14: ' Foreground color (Pick any color from 1 to 15)
  15: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  16: ' Bc%:
  17: ' Background color (Pick any color from 1 to 15)
  18: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  19: ' Tr%:
  20: ' Location of row for first line of box. (Placing longer menus below
  21: ' rows 12 to 16 will cause them not to properly appear on the screen.)
  22: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  23: ' Lc%:
  24: ' Location of first column for first line of box. (Menus are 25 columns
  25: ' wide, placing them near the edge of the screen at column 66 or greater
  26: ' will cause distortion.)
  27: '          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  28: ' Row%:
  29: ' Row% places the widebar menu selector on the first item of the menu
  30: ' (Row% is always one number larger than tr%)
  31: 
  32: SUB VerticalMenu (boxstyle%, fc%, bc%, tr%, lc%, row%)
  33: DIM menu$(0 TO 11)
  34: COLOR fc%, bc%
  35: SELECT CASE boxstyle%
  36: CASE 1
  37: side$ = "³"
  38: menu$(0) = "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"         'box building elements;
  39: menu$(11) = "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"        'all elements handled
  40: CASE 2                                         'by menu$
  41: side$ = "º"
  42: menu$(0) = "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
  43: menu$(11) = "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
  44: CASE 3
  45: side$ = "º"
  46: menu$(0) = "ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·"
  47: menu$(11) = "ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ"
  48: CASE 4
  49: side$ = "³"
  50: menu$(0) = "ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸"
  51: menu$(11) = "ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;"
  52: CASE 5
  53: side$ = "Û"
  54: menu$(0) = STRING$(25, 219)
  55: menu$(11) = STRING$(25, 219)
  56: END SELECT
  57: menu$(1) = side$ + "     WASHINGTON        " + side$   'MenuMan has already
  58: menu$(2) = side$ + "     LINCOLN           " + side$   'sized each entry to
  59: menu$(3) = side$ + "     JEFFERSON         " + side$   'provide a full length
  60: menu$(4) = side$ + "     ADAMS             " + side$   'widebar selector
  61: menu$(5) = side$ + "     MONROE            " + side$
  62: menu$(6) = side$ + "     KENNEDY           " + side$
  63: menu$(7) = side$ + "     TRUMAN            " + side$
  64: menu$(8) = side$ + "     JOHNSON           " + side$
  65: menu$(9) = side$ + "     ROOSEVELT         " + side$
  66: menu$(10) = side$ + "     EXIT PROGRAM      " + side$
  67: FOR set = 0 TO 11
  68: LOCATE set + tr%, lc%: COLOR fc%, bc%: PRINT menu$(set)
  69: NEXT
  70: row = row%   ' preset for widebar selector
  71: DO
  72: DO
  73: SELECT CASE row
  74: CASE row%: opt$ = "     WASHINGTON        "
  75: CASE row% + 1: opt$ = "     LINCOLN           "  'sizing also preset for
  76: CASE row% + 2: opt$ = "     JEFFERSON         "  'these entries which are
  77: CASE row% + 3: opt$ = "     ADAMS             "  'needed to reprint entries
  78: CASE row% + 4: opt$ = "     MONROE            "  'after widebar selector moves
  79: CASE row% + 5: opt$ = "     KENNEDY           "  'on to next entry
  80: CASE row% + 6: opt$ = "     TRUMAN            "
  81: CASE row% + 7: opt$ = "     JOHNSON           "
  82: CASE row% + 8: opt$ = "     ROOSEVELT         "
  83: CASE row% + 9: opt$ = "     EXIT PROGRAM      "
  84: END SELECT
  85: LOCATE row, lc% + 1, 0: COLOR bc%, fc%: PRINT opt$
  86: 'prints first entry with widebar selector
  87: keys$ = INKEY$
  88: LOOP WHILE keys$ = ""
  89: keymove = ASC(RIGHT$(keys$, 1))   'interprets scancodes
  90: LOCATE row, lc% + 1, 0: COLOR fc%, bc%: PRINT opt$
  91: 'restores previous entry and color
  92: SELECT CASE keymove
  93: CASE 13
  94: IF row = row% THEN END
  95: IF row = row% + 1 THEN END  'this block of IF statements
  96: IF row = row% + 2 THEN END  'will redirect the menu to perform
  97: IF row = row% + 3 THEN END  'any user defined task within the
  98: IF row = row% + 4 THEN END  'user's program
  99: IF row = row% + 5 THEN END
 100: IF row = row% + 6 THEN END  'Edit out "END"
 101: IF row = row% + 7 THEN END
 102: IF row = row% + 8 THEN END
 103: IF row = row% + 9 THEN END
 104: CASE 72: row = row - 1  'moves widebar selector down 1 row
 105: CASE 80: row = row + 1  'moves widebar selector up 1 row
 106: CASE 71: row = row% + 9 'shortcut keys
 107: CASE 79: row = row% + 9 'shortcut keys
 108: END SELECT
 109: IF row < row% THEN row = row% + 9 ELSE IF row > row% + 9 THEN row = row%
 110: 'sets limits for widebar selector
 111: LOOP
 112: END
 113: END SUB
 114: 
5748346 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-05-09 21:10:41