fb:porticula NoPaste
Text-basierte Benutzeroberfläche - Textbox
Uploader: | Sebastian |
Datum/Zeit: | 05.04.2008 15:37:46 |
SUB DrawTextbox (ByVal X As Integer, ByVal Y As Integer, ByVal Breite As Integer, _
ByVal Hoehe As Integer, ByVal Value As String)
DIM AS INTEGER i,maxlen
DIM AS STRING t
COLOR 0,7
LOCATE Y,X: PRINT CHR(218)
LOCATE Y,X+1: PRINT STRING(Breite-2,CHR(196))
COLOR 15,7
LOCATE Y,X+Breite-1: PRINT CHR(191)
COLOR 0,7
FOR i = Y+1 TO Y+Hoehe-2
LOCATE i,X: PRINT CHR(179)
NEXT i
LOCATE Y+Hoehe-1,X: PRINT CHR(192)
COLOR 15,7
LOCATE Y+Hoehe-1,X+1: PRINT STRING(Breite-2,CHR(196))
LOCATE Y+Hoehe-1,X+Breite-1: PRINT CHR(217)
FOR i = Y+1 TO Y+Hoehe-2
LOCATE i,X+Breite-1: PRINT CHR(179)
NEXT i
COLOR 0
maxlen=breite-2
If LEN(Value) > maxlen Then
t = LEFT(Value,maxlen)
ELSE
t = Value
END IF
LOCATE Y+1,X+1: PRINT t; STRING(maxlen-LEN(t),32)
END SUB
SCREEN 12
CLS
DrawTextbox 10,10,16,3,"Hallo"
SLEEP: END