home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / dnalib7a.zip / DBLBOX.BAS < prev    next >
BASIC Source File  |  1994-05-14  |  4KB  |  156 lines

  1. DECLARE SUB LineEdit(Allow$,Text$,Mouse%,MouseRow%,MouseCol%,Fill%,Row%,Col%,EditKey%,Attr%)
  2. DECLARE SUB Popwind(Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%,Shadow%,Border%)
  3. DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
  4. DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
  5. DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
  6. DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
  7. DECLARE SUB HideCursor()
  8. DECLARE SUB ShowCursor()
  9.  
  10. SUB DoubleBox(PromptOne$,PromptTwo$,TextOne$,TextTwo$,Allow$,Mouse%,Editkey%,Fill%,Location%,ButtonAttr%,TextAttr%,Attr%,Shadow%,Border%)PUBLIC
  11.  
  12. $CODE SEG "DNASEG1"
  13.  
  14. CalcByte Attr%,FGround%,BGround%
  15. CalcByte ButtonAttr%,BtFG%,BtBG%
  16.  
  17. IF Mouse% THEN HideCursor
  18.  
  19. IF LEN(PromptOne$) > LEN(PromptTwo$) THEN
  20.   Prompt$ = PromptOne$
  21. ELSE
  22.   Prompt$ = PromptTwo$
  23. END IF
  24.  
  25. Finished% = 0
  26.  
  27. LeftColumn% = 40 - ((LEN(Prompt$) + LEN(TextOne$) + 5) \ 2)
  28. RightColumn% = LeftColumn% + (LEN(Prompt$) + LEN(TextOne$) + 4)
  29.  
  30. SaveScreen DbScreen$,Location%,LeftColumn%,Location% + 7,RightColumn%,Shadow%
  31.  
  32. Popwind Title$,Location%,LeftColumn%,Location% + 7,RightColumn%,Attr%,Shadow%,Border%
  33.  
  34. COLOR FGround%,BGround%
  35. LOCATE Location% + 1,LeftColumn% + 2,0
  36. PRINT PromptOne$;
  37. LOCATE Location% + 3,LeftColumn% + 2,0
  38. PRINT PromptTwo$;
  39.  
  40. Row% = Location% + 5
  41. Col% = LeftColumn% + 3
  42.  
  43. IF Mouse% THEN
  44.   COLOR FGround%,BGround%
  45.   LOCATE Location%,LeftColumn% + 1,0
  46.   PRINT CHR$(91,254,93);
  47. END IF
  48.  
  49.  COLOR BtFG%,BtBG%
  50.  LOCATE Row%, Col%,0
  51.  PRINT " Ok ";
  52.  COLOR 0,BGround%
  53.  LOCATE Row%, Col% + 4,0
  54.  PRINT "▄";
  55.  COLOR 0,BGround%
  56.  LOCATE Row% + 1,Col% + 1,0
  57.  PRINT "▀▀▀▀";
  58.  
  59.  COLOR BtFG%,BtBG%
  60.  LOCATE Row%,Col% + 9,0
  61.  PRINT " Esc ";
  62.  COLOR 0,BGround%
  63.  LOCATE Row%,Col% + 14,0
  64.  PRINT "▄";
  65.  COLOR 0,BGround%
  66.  LOCATE Row% + 1,Col% + 10,0
  67.  PRINT "▀▀▀▀▀"
  68.  
  69. DO
  70.  
  71. MouseRow% = 0
  72. MouseCol% = 0
  73.  
  74. LineEdit Allow$,TextOne$,Mouse%,MouseRow%,MouseCol%,Fill%,Location% + 1,LeftColumn% + LEN(Prompt$) + 3,EditKey%,TextAttr%
  75.  
  76. IF Mouse% THEN
  77.   IF Editkey% = -255 THEN
  78.     IF MouseRow% <> (Location% + 3) THEN GOTO CheckMouse
  79.   END IF
  80. END IF
  81.  
  82. IF Editkey% = 27 THEN GOTO KeyExit
  83.  
  84. MouseRow% = 0
  85. MouseCol% = 0
  86.  
  87. LineEdit Allow$,TextTwo$,Mouse%,MouseRow%,MouseCol%,Fill%,Location% + 3,LeftColumn% + LEN(Prompt$) + 3,EditKey%,TextAttr%
  88.  
  89. CheckMouse:
  90.  
  91. IF Editkey% = 255 THEN Editkey% = 0
  92.  
  93. IF Mouse% THEN  'stop here and check if exit was with mouse
  94.   ShowCursor
  95.   IF Row% = MouseRow% THEN
  96.     SELECT CASE MouseCol%
  97.  
  98.       CASE Col% TO Col% + 3
  99.         Editkey% = 13
  100.         Finished% = 1
  101.  
  102.       CASE Col% + 9 TO Col% + 13
  103.         Editkey% = 27
  104.         Finished% = 1
  105.  
  106.     END SELECT
  107.   ELSEIF Location% = MouseRow% THEN
  108.     IF MouseCol% = LeftColumn% + 2 THEN
  109.       Editkey% = 27
  110.       Finished% = 1
  111.     END IF
  112.   ELSE
  113.    IF Editkey% = 13 OR Editkey% = 27 THEN
  114.      Finished% = 1
  115.    END IF
  116.   END IF
  117. ELSE
  118.   IF Editkey% = 13 OR Editkey% = 27 THEN Finished% = 1
  119. END IF
  120.  
  121. LOOP UNTIL Finished%
  122.  
  123. KeyExit:
  124.  
  125. SELECT CASE Editkey%
  126.  
  127.     CASE 13 'Ok
  128.           IF Mouse% THEN HideCursor
  129.           COLOR FGround%,BGround%
  130.           LOCATE Row%,Col%,0
  131.           PRINT " ";
  132.           LOCATE Row% + 1,Col% + 1,0
  133.           PRINT "    ";
  134.       COLOR BtFG%,BtBG%
  135.           LOCATE Row%,Col% + 1,0
  136.           PRINT " Ok "
  137.  
  138.     CASE 27 'Esc
  139.           IF Mouse% THEN HideCursor
  140.           COLOR FGround%,BGround%
  141.           LOCATE Row%,Col% + 9,0
  142.           PRINT " ";
  143.           LOCATE Row% + 1,Col% + 10,0
  144.           PRINT "      ";
  145.       COLOR BtFG%,BtBG%
  146.           LOCATE Row%,Col% + 10,0
  147.           PRINT " Esc "
  148.  
  149. END SELECT
  150.  
  151. IF Mouse% THEN ShowCursor
  152. DELAY .5
  153. IF Mouse% THEN HideCursor
  154. RestoreScreen DbScreen$,Location%,LeftColumn%
  155.  
  156. END SUB