From: George H. <geo...@us...> - 2012-01-17 19:50:43
|
Update of /cvsroot/win32forth/win32forth/src/console In directory vz-cvs-4.sog:/tmp/cvs-serv28343 Modified Files: CommandWindow.f NewConsole.f Log Message: Modified c_emit to handle control characters the same as the old console Index: NewConsole.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/console/NewConsole.f,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** NewConsole.f 15 Jun 2010 23:49:20 -0000 1.37 --- NewConsole.f 17 Jan 2012 19:50:41 -0000 1.38 *************** *** 199,203 **** ; ! : c_emit ( c -- ) sp@ 1 c_type drop ; : c_cr ( -- ) cr: cmd ; : c_?cr ( n -- ) ?cr: cmd ; --- 199,214 ---- ; ! : c_emit ( c -- ) ! dup ! case ! $D of getxy swap drop 0 swap gotoxy endof ! $A of getxy 1+ gotoxy endof ! $7 of beep endof ! $9 of BackSpace: cmd endof ! \in-system-ok sp@ 1 c_type ! endcase ! drop ! ; ! : c_cr ( -- ) cr: cmd ; : c_?cr ( n -- ) ?cr: cmd ; Index: CommandWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/console/CommandWindow.f,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** CommandWindow.f 29 May 2009 11:30:57 -0000 1.29 --- CommandWindow.f 17 Jan 2012 19:50:41 -0000 1.30 *************** *** 541,547 **** \ using all the lines of text and updating number of lines DRAWTEXTPARAMS DT_CALCRECT DT_EXPANDTABS or DT_TABSTOP or DT_NOPREFIX or ! \ ScrollRange -1 Text GetHandle: mdc call DrawTextEx VertLine / to lines ScrollRange TextZero Text - Text GetHandle: mdc call DrawTextEx VertLine / to lines ! ScrollRange 8 + @ to ScrollRangeHMax ;M --- 541,547 ---- \ using all the lines of text and updating number of lines DRAWTEXTPARAMS DT_CALCRECT DT_EXPANDTABS or DT_TABSTOP or DT_NOPREFIX or ! \ ScrollRange -1 Text GetHandle: mdc call DrawTextEx VertLine / to lines ScrollRange TextZero Text - Text GetHandle: mdc call DrawTextEx VertLine / to lines ! ScrollRange 8 + @ to ScrollRangeHMax ;M *************** *** 690,695 **** a1 n1 + a1 n + TextZero a1 - n1 - 1+ move n n1 - +to TextZero ! \ a a1 n move ! n 0 ?DO a i + c@ dup 0= IF drop 32 THEN a1 i + c! LOOP \ replace 0 with space ;M --- 690,695 ---- a1 n1 + a1 n + TextZero a1 - n1 - 1+ move n n1 - +to TextZero ! n 0 ?DO a i + c@ ! dup 0= IF drop 32 THEN a1 i + c! LOOP \ replace 0 with space ;M *************** *** 769,773 **** ;M ! :M ?CR: ( n -- ) X + VisibleCols: self > IF CR: self THEN ;M int wrap --- 769,773 ---- ;M ! :M ?CR: ( n -- ) X + VisibleCols: self > IF CR: self THEN ;M int wrap *************** *** 776,783 **** : AdjustCount ( n -- n ) wrap IF wrap 0< IF VisibleCols: self ELSE wrap THEN X - min 0 max THEN ; ! :M OverwriteTextAtXY: ( a n -- ) dup CheckTextBuffer \ one line at a time ! BEGIN dup>r 2dup 2dup 13 scan nip - AdjustCount dup>r OverwriteLineAtXY: self r@ 2r> - \ chars inserted, chars remaining ! \ WHILE CR: self /string 13 skip 10 skip ! WHILE CR: self /string 1 /string 10 skip REPEAT 3drop SCP --- 776,784 ---- : AdjustCount ( n -- n ) wrap IF wrap 0< IF VisibleCols: self ELSE wrap THEN X - min 0 max THEN ; ! :M OverwriteTextAtXY: ( a n -- ) ! dup CheckTextBuffer \ one line at a time ! BEGIN 10 skip dup>r 2dup 2dup 13 scan nip - AdjustCount ! dup>r OverwriteLineAtXY: self r@ 2r> - \ chars inserted, chars remaining ! WHILE CR: self /string 1 /string REPEAT 3drop SCP *************** *** 793,797 **** :M GoToXY: ( X Y -- ) \ add extra lines and lengthen lines with spaces if necessary to Y to X - \ Y dup LastRow - 0max 0 ?DO crlf$ count InsertTextAtEnd: self LOOP to Y Y LastRow - 0max 0 ?DO crlf$ count InsertTextAtEnd: self LOOP Y RowString 2>r --- 794,797 ---- *************** *** 800,804 **** UpdateScrollRange: self scp - \ AutoScroll: self ( best not to scroll every time GOTOXY is used ) XYAddress to XYA ;M --- 800,803 ---- *************** *** 831,834 **** --- 830,840 ---- :M emit: ( c -- ) sp@ InsertTextOnCommandLine: self drop ;M + :M BackSpace: ( -- ) + x y or if + x if y x 1- swap gotoxy: self + else y 1- dup rowlength swap gotoxy: self + then then + ;M + : On_DblClick ( h m w -- h m w ) \ insert double-clicked word in commandline KeysOn not ?shift or ?exit *************** *** 1169,1172 **** --- 1175,1179 ---- :M HandleChar: ( c -- ) Case + 7 of beep endof 8 of DeleteBackward: self endof 9 of 9 emit: self endof |