From: Rod O. <rod...@us...> - 2005-11-06 10:43:27
|
Update of /cvsroot/win32forth/win32forth/apps/ProMgr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12182/apps/ProMgr Modified Files: HexViewer.f Log Message: Rod: scroll the window contents - smoother than repainting Index: HexViewer.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/ProMgr/HexViewer.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HexViewer.f 5 Nov 2005 22:22:30 -0000 1.2 --- HexViewer.f 6 Nov 2005 10:43:15 -0000 1.3 *************** *** 27,33 **** last-line# 20 - to last-top-line# ;m - :m home: ( -- ) - first-line# to cur-first-line paint: self ;m - : set-params ( -- ) temprect GetClientrect: self --- 27,30 ---- *************** *** 52,69 **** size cell+ malloc to buff-ptr ; - : hex-view ( a1 n1 -- ) - dup to buff-len alloc-buffptr \ keep my own copy, just in case - buff-ptr buff-len move - hwnd 0= ?exit - buff-len bytes/line /mod swap - if 1+ - then to last-line# - buff-ptr buff-len + to eob-ptr - set-params - home: self ; - - :M Dump: ( addr cnt -- ) - hex-view ;M - :M On_Init: ( -- ) On_Init: super --- 49,52 ---- *************** *** 121,125 **** 16 +loop drop TheBuffer ; ! :m on_paint: ( -- ) 0 0 GetSize: self WHITE FillArea: dc buff-ptr 0= ?exitm --- 104,108 ---- 16 +loop drop TheBuffer ; ! :M on_paint: ( -- ) 0 0 GetSize: self WHITE FillArea: dc buff-ptr 0= ?exitm *************** *** 134,138 **** loop RestoreDC: dc ! ;m :M WindowStyle: ( -- style ) \ return the window style --- 117,121 ---- loop RestoreDC: dc ! ;M :M WindowStyle: ( -- style ) \ return the window style *************** *** 141,156 **** ;M ! :m vposition: ( n -- ) \ move to position n ! 0max last-top-line# min ! to cur-first-line paint: self ;m ! :m vscroll: ( n -- ) \ move n lines up or down ! cur-first-line + vposition: self ;m ! :m end: ( -- ) \ move to end, in this case it's 100 bytes down to pad ! last-top-line# to cur-first-line paint: self ;m ! :m vpage: ( n -- ) \ down or up n pages ! screen-rows 1- * vscroll: self ;m :M WM_VSCROLL ( h m w l -- res ) --- 124,144 ---- ;M ! :M VPosition: ( n -- ) \ move to position n ! cur-first-line swap \ save previous cur-first-line on stack ! 0max last-top-line# min to cur-first-line ! cur-first-line - char-height * 0 swap Scroll: self \ scroll rather than repaint ! set-scrollpos ;M ! :M VScroll: ( n -- ) \ move n lines up or down ! cur-first-line + VPosition: self ;M ! :M Home: ( -- ) ! first-line# VPosition: self ;M ! :M End: ( -- ) \ move to end, in this case it's 100 bytes down to pad ! last-top-line# VPosition: self ;M ! ! :M VPage: ( n -- ) \ down or up n pages ! screen-rows 1- * VScroll: self ;M :M WM_VSCROLL ( h m w l -- res ) *************** *** 166,173 **** SB_THUMBTRACK of r@ VPosition: self endof ENDCASE r>drop - \ position the vertical button in the scroll bar - set-scrollpos 0 ;M :m on_done: ( -- ) release-buffptr --- 154,174 ---- SB_THUMBTRACK of r@ VPosition: self endof ENDCASE r>drop 0 ;M + : hex-view ( a1 n1 -- ) + dup to buff-len alloc-buffptr \ keep my own copy, just in case + buff-ptr buff-len move + hwnd 0= ?exit + buff-len bytes/line /mod swap + if 1+ + then to last-line# + buff-ptr buff-len + to eob-ptr + set-params + home: self + paint: self ; + + :M Dump: ( addr cnt -- ) + hex-view ;M + :m on_done: ( -- ) release-buffptr *************** *** 177,181 **** :M AutoSize: ( -- ) tempRect.AddrOf GetClientRect: Parent ! 0 0 Right: tempRect Bottom: tempRect \ x,y,h,w Move: self ;M --- 178,182 ---- :M AutoSize: ( -- ) tempRect.AddrOf GetClientRect: Parent ! 0 0 Right: tempRect Bottom: tempRect \ x,y,w,h Move: self ;M |