REM. Program to demonstrate control tactics with editbox
REM lets do this one snippet at a time
INSTALL @lib$+"WINLIB2"
MODE 22
BS_DEFPUSHBUTTON = &1
CB_ADDSTRING = &143
CB_SETCURSEL = &14E
CBS_DROPDOWNLIST = &3
ES_AUTOHSCROLL = &80
ES_NUMBER = &2000
LB_ADDSTRING = &180
LB_GETCURSEL = &188
UDM_SETRANGE = &465
UDS_ALIGNRIGHT = &4
UDS_AUTOBUDDY = &10
UDS_SETBUDDYINT = &2
WS_CHILD = &40000000
WS_GROUP = &20000
WS_VISIBLE = &10000000
ES_MULTILINE = 500
firsttimeuse$="yes"
PRINT "Type quit to end program"
REPEAT
IF firsttimeuse$="no" THEN activemessage$=$$text%
IF firsttimeuse$="yes" THEN firsttimeuse$="no": activemessage$="FOR X = 1 TO 1000:REM I plan to keep telling you this"
REM this is where your program would look for input and respond. But it initially needs to look for first time use
PROCcycleinput(activemessage$)
UNTIL $$text%="quit"
IF click%=1 THEN PRINT "PROGRAM ENDED:"'
PROC_closedialog(dlg%)
END
DEF PROCcycleinput(whatstring$)
REM ***********namedialog,x,y,amountwide,amountdown (others I dont know yet)
dlg%=FN_newdialog("", 10, 380, 660, 30, 8, 560)
WS_BORDER = &800000
dlg%!16 AND= NOT WS_BORDER
REM *Text box control***************x, y, h ,v
PROC_editbox(dlg%, activemessage$, 101, 0, 10, 600, 12, ES_AUTOHSCROLL)
PROC_showdialog(dlg%)
ON CLOSE PROC_closedialog(dlg%):QUIT
ON ERROR PROC_closedialog(dlg%):PRINT'REPORT$:END
Click%=0
ON SYS Click% = @wparam% : RETURN
REPEAT
WAIT 1
click%=0
SWAP Click%, click%
UNTIL click%=1 OR click%=2 OR !dlg%=0
DIM text% 255
SYS "GetDlgItemText", !dlg%, 101, text%, 255
REM isn't this interesting? the variable text% is being defined as a string and its new name is $$text% and you can use that as your string
PRINT "Text box contained """$$text%""""
ENDPROC
REM. Program to demonstrate control tactics with editbox
REM lets do this one snippet at a time
INSTALL @lib$+"WINLIB2"
MODE 22
BS_DEFPUSHBUTTON = &1
CB_ADDSTRING = &143
CB_SETCURSEL = &14E
CBS_DROPDOWNLIST = &3
ES_AUTOHSCROLL = &80
ES_NUMBER = &2000
LB_ADDSTRING = &180
LB_GETCURSEL = &188
UDM_SETRANGE = &465
UDS_ALIGNRIGHT = &4
UDS_AUTOBUDDY = &10
UDS_SETBUDDYINT = &2
WS_CHILD = &40000000
WS_GROUP = &20000
WS_VISIBLE = &10000000
ES_MULTILINE = 500
firsttimeuse$="yes"
PRINT "Type quit to end program"
REPEAT
IF firsttimeuse$="no" THEN activemessage$=$$text%
IF firsttimeuse$="yes" THEN firsttimeuse$="no": activemessage$="FOR X = 1 TO 1000:REM I plan to keep telling you this"
REM this is where your program would look for input and respond. But it initially needs to look for first time use
PROCcycleinput(activemessage$)
UNTIL $$text%="quit"
IF click%=1 THEN PRINT "PROGRAM ENDED:"'
PROC_closedialog(dlg%)
END
DEF PROCcycleinput(whatstring$)
REM ***********namedialog,x,y,amountwide,amountdown (others I dont know yet)
dlg%=FN_newdialog("", 10, 380, 660, 60, 8, 560)
WS_BORDER = &800000
dlg%!16 AND= NOT WS_BORDER
REM PROC_static(dlg%,text$,id%,x%,y%,cx%,cy%,style%) 'technically this is in the wrong spot.(this is at the bottom of the box) OH WELL
REM id% variable string is 103.. if you made it 101, then the return string would look for it..
PROC_static(dlg%,"THIS AREA HOLDS MY NEXT LINE OF DATA",103,0,35,600,12,0)
REM *Text box control************inputid,x, y, h ,v
PROC_editbox(dlg%, activemessage$, 101, 0, 20, 600, 12, ES_AUTOHSCROLL)
REM PROC_static(dlg%,text$,id%,x%,y%,cx%,cy%,style%) 'technically this is in the wrong spot.(this is at the top of the box) OH WELL
PROC_static(dlg%,"THIS AREA HOLDS MY PEVIOUS LINE OF DATA",102,0,10,600,12,0)
PROC_showdialog(dlg%)
ON CLOSE PROC_closedialog(dlg%):QUIT
ON ERROR PROC_closedialog(dlg%):PRINT'REPORT$:END
Click%=0
ON SYS Click% = @wparam% : RETURN
REPEAT
WAIT 1
click%=0
SWAP Click%, click%
UNTIL click%=1 OR click%=2 OR !dlg%=0
DIM text% 255
SYS "GetDlgItemText", !dlg%, 101, text%, 255
PRINT "Text box contained """$$text%""""
ENDPROC