From: Rod O. <rod...@us...> - 2008-08-04 09:04:12
|
Update of /cvsroot/win32forth/win32forth/src/console In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv438 Modified Files: CommandWindow.f Log Message: Rod: fixed problems with caret in WinEd - the new console was setting the caret position even when it was hidden. Also some changes for KeySave to work. Index: CommandWindow.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/console/CommandWindow.f,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CommandWindow.f 21 Jul 2008 20:16:22 -0000 1.7 --- CommandWindow.f 4 Aug 2008 09:04:06 -0000 1.8 *************** *** 21,24 **** --- 21,25 ---- defer HandleChar defer HandleKeyDown + defer LogKeyStrokes *************** *** 399,405 **** CaretPos.top CaretPos.left call SetCaretPos drop ShowCaret: self ;M ! :M DestroyCaret: ( -- ) HideCaret: self call DestroyCaret drop ;M :M SetCaret: ( w h -- ) --- 400,407 ---- CaretPos.top CaretPos.left call SetCaretPos drop ShowCaret: self + true to cursor-on? ;M ! :M DestroyCaret: ( -- ) HideCaret: self call DestroyCaret drop false to cursor-on? ;M :M SetCaret: ( w h -- ) *************** *** 413,419 **** :M SmallCursor: ( -- ) 1 VertLine SetCaret: self ;M ! :M On_SetFocus: ( h m w l -- ) CreateCaret: self ;M ! :M On_KillFocus: ( h m w l -- ) DestroyCaret: self ;M : ColRow>xy ( col row -- x y ) \ needs dc --- 415,421 ---- :M SmallCursor: ( -- ) 1 VertLine SetCaret: self ;M ! :M On_SetFocus: ( h m w l -- ) CreateCaret: self true to have-focus? ;M ! :M On_KillFocus: ( h m w l -- ) DestroyCaret: self false to have-focus? ;M : ColRow>xy ( col row -- x y ) \ needs dc *************** *** 428,432 **** SelEndX SelEndY ScrollAdjust \ as long as SetSelectionStart is done first dup VertLine + width swap SetRect: CaretPos ! CaretPos.top CaretPos.left call SetCaretPos drop ; --- 430,434 ---- SelEndX SelEndY ScrollAdjust \ as long as SetSelectionStart is done first dup VertLine + width swap SetRect: CaretPos ! cursor-on? IF CaretPos.top CaretPos.left call SetCaretPos drop THEN ; *************** *** 1077,1083 **** :M WM_CHAR ( h m w l -- res ) ! over KeysOn IF HandleChar: self ! ELSE dup 27 = IF true to Abort? THEN PutKey: self THEN \ drop false to Abort? --- 1079,1088 ---- :M WM_CHAR ( h m w l -- res ) ! over \ if CTRL and Shift pressed add in shift bits ! VK_CONTROL call GetKeyState 32768 and IF VK_SHIFT call GetKeyState 32768 and IF 0x80000 or THEN THEN ! LogKeyStrokes \ deferred, ' menukey-more is LogKeyStrokes for KeySave ! KeysOn IF HandleChar: self ! ELSE dup 27 = IF true to Abort? THEN dup 256 < IF PutKey: self ELSE SetVirtualKey: self THEN THEN \ drop false to Abort? *************** *** 1098,1106 **** ( default case) dup 0 rot ENDCASE ! 0 -rot ?dup IF hWnd send-window ELSE HandleKeyDown 2drop THEN ;M :M WM_KEYDOWN ( h m w l -- res ) ! over KeysOn IF HandleKeyDown: self 0 THEN Case \ these are the codes specified in keyboard.cpp VK_F1 of 0x10001 endof --- 1103,1111 ---- ( default case) dup 0 rot ENDCASE ! ?dup IF 0 -rot hWnd send-window ELSE HandleKeyDown THEN ;M :M WM_KEYDOWN ( h m w l -- res ) ! over KeysOn IF dup HandleKeyDown: self THEN Case \ these are the codes specified in keyboard.cpp VK_F1 of 0x10001 endof *************** *** 1128,1131 **** --- 1133,1138 ---- VK_PRIOR of 0x20010 endof VK_NEXT of 0x20011 endof + \ VK_SHIFT of 0x00000 endof + \ VK_CONTROL of 0x00000 endof ( default ) 0 swap EndCase *************** *** 1135,1138 **** --- 1142,1146 ---- VK_SHIFT call GetKeyState 32768 and IF 0x80000 or THEN THEN + dup IF LogKeyStrokes THEN to VirtualKey 0 ;M *************** *** 1182,1186 **** :M On_Init: ( -- ) MaxText malloc to text text MaxText 45 fill 0 text c! \ text MaxText erase ! CommandFont SetFont: self CS_DBLCLKS GCL_STYLE hWnd Call SetClassLong drop WHITE_BRUSH Call GetStockObject GCL_HBRBACKGROUND hWnd Call SetClassLong drop --- 1190,1195 ---- :M On_Init: ( -- ) MaxText malloc to text text MaxText 45 fill 0 text c! \ text MaxText erase ! CommandFont SetFont: self \ this creates a caret in BigCursor: self ! DestroyCaret: self \ no caret until command window gets the focus CS_DBLCLKS GCL_STYLE hWnd Call SetClassLong drop WHITE_BRUSH Call GetStockObject GCL_HBRBACKGROUND hWnd Call SetClassLong drop |