home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
dnalib7a.zip
/
DBLBOX.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-05-14
|
4KB
|
156 lines
DECLARE SUB LineEdit(Allow$,Text$,Mouse%,MouseRow%,MouseCol%,Fill%,Row%,Col%,EditKey%,Attr%)
DECLARE SUB Popwind(Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%,Shadow%,Border%)
DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
DECLARE SUB HideCursor()
DECLARE SUB ShowCursor()
SUB DoubleBox(PromptOne$,PromptTwo$,TextOne$,TextTwo$,Allow$,Mouse%,Editkey%,Fill%,Location%,ButtonAttr%,TextAttr%,Attr%,Shadow%,Border%)PUBLIC
$CODE SEG "DNASEG1"
CalcByte Attr%,FGround%,BGround%
CalcByte ButtonAttr%,BtFG%,BtBG%
IF Mouse% THEN HideCursor
IF LEN(PromptOne$) > LEN(PromptTwo$) THEN
Prompt$ = PromptOne$
ELSE
Prompt$ = PromptTwo$
END IF
Finished% = 0
LeftColumn% = 40 - ((LEN(Prompt$) + LEN(TextOne$) + 5) \ 2)
RightColumn% = LeftColumn% + (LEN(Prompt$) + LEN(TextOne$) + 4)
SaveScreen DbScreen$,Location%,LeftColumn%,Location% + 7,RightColumn%,Shadow%
Popwind Title$,Location%,LeftColumn%,Location% + 7,RightColumn%,Attr%,Shadow%,Border%
COLOR FGround%,BGround%
LOCATE Location% + 1,LeftColumn% + 2,0
PRINT PromptOne$;
LOCATE Location% + 3,LeftColumn% + 2,0
PRINT PromptTwo$;
Row% = Location% + 5
Col% = LeftColumn% + 3
IF Mouse% THEN
COLOR FGround%,BGround%
LOCATE Location%,LeftColumn% + 1,0
PRINT CHR$(91,254,93);
END IF
COLOR BtFG%,BtBG%
LOCATE Row%, Col%,0
PRINT " Ok ";
COLOR 0,BGround%
LOCATE Row%, Col% + 4,0
PRINT "▄";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 1,0
PRINT "▀▀▀▀";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 9,0
PRINT " Esc ";
COLOR 0,BGround%
LOCATE Row%,Col% + 14,0
PRINT "▄";
COLOR 0,BGround%
LOCATE Row% + 1,Col% + 10,0
PRINT "▀▀▀▀▀"
DO
MouseRow% = 0
MouseCol% = 0
LineEdit Allow$,TextOne$,Mouse%,MouseRow%,MouseCol%,Fill%,Location% + 1,LeftColumn% + LEN(Prompt$) + 3,EditKey%,TextAttr%
IF Mouse% THEN
IF Editkey% = -255 THEN
IF MouseRow% <> (Location% + 3) THEN GOTO CheckMouse
END IF
END IF
IF Editkey% = 27 THEN GOTO KeyExit
MouseRow% = 0
MouseCol% = 0
LineEdit Allow$,TextTwo$,Mouse%,MouseRow%,MouseCol%,Fill%,Location% + 3,LeftColumn% + LEN(Prompt$) + 3,EditKey%,TextAttr%
CheckMouse:
IF Editkey% = 255 THEN Editkey% = 0
IF Mouse% THEN 'stop here and check if exit was with mouse
ShowCursor
IF Row% = MouseRow% THEN
SELECT CASE MouseCol%
CASE Col% TO Col% + 3
Editkey% = 13
Finished% = 1
CASE Col% + 9 TO Col% + 13
Editkey% = 27
Finished% = 1
END SELECT
ELSEIF Location% = MouseRow% THEN
IF MouseCol% = LeftColumn% + 2 THEN
Editkey% = 27
Finished% = 1
END IF
ELSE
IF Editkey% = 13 OR Editkey% = 27 THEN
Finished% = 1
END IF
END IF
ELSE
IF Editkey% = 13 OR Editkey% = 27 THEN Finished% = 1
END IF
LOOP UNTIL Finished%
KeyExit:
SELECT CASE Editkey%
CASE 13 'Ok
IF Mouse% THEN HideCursor
COLOR FGround%,BGround%
LOCATE Row%,Col%,0
PRINT " ";
LOCATE Row% + 1,Col% + 1,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 1,0
PRINT " Ok "
CASE 27 'Esc
IF Mouse% THEN HideCursor
COLOR FGround%,BGround%
LOCATE Row%,Col% + 9,0
PRINT " ";
LOCATE Row% + 1,Col% + 10,0
PRINT " ";
COLOR BtFG%,BtBG%
LOCATE Row%,Col% + 10,0
PRINT " Esc "
END SELECT
IF Mouse% THEN ShowCursor
DELAY .5
IF Mouse% THEN HideCursor
RestoreScreen DbScreen$,Location%,LeftColumn%
END SUB