From: Rod O. <rod...@us...> - 2005-11-07 20:18:30
|
Update of /cvsroot/win32forth/win32forth/apps/ProMgr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27830/apps/ProMgr Modified Files: HexViewer.f Log Message: Rod: changed to use proportional scrollbar Index: HexViewer.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/ProMgr/HexViewer.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HexViewer.f 6 Nov 2005 10:43:15 -0000 1.3 --- HexViewer.f 7 Nov 2005 20:18:19 -0000 1.4 *************** *** 18,41 **** Font fdFont ! :m classinit: ( -- ) ! classinit: super ! NextID to ID ! 0 to buff-ptr ! 0 to buff-len ! 0 to eob-ptr ! 200 to last-line# ! last-line# 20 - to last-top-line# ;m ! : set-params ( -- ) ! temprect GetClientrect: self ! temprect.right to width ! temprect.bottom to height ! width char-width / to screen-cols ! height char-height / to screen-rows ! last-line# screen-rows - 0max to last-top-line# ! \ set the vertical scroll limits ! false last-top-line# first-line# SB_VERT ! GetHandle: self Call SetScrollRange drop ; ! : release-buffptr ( -- ) --- 18,55 ---- Font fdFont ! Record: ScrollInfo ! int cbSize ! int fMask ! int nMin ! int nMax ! int nPage ! int nPos ! int nTrackPos ! ;RecordSize: sizeof(ScrollInfo) ! :M classinit: ( -- ) ! classinit: super ! sizeof(ScrollInfo) to cbSize ! SIF_ALL to fMask ! NextID to ID ! 0 to buff-ptr ! 0 to buff-len ! 0 to eob-ptr ! 200 to last-line# ! last-line# 20 - to last-top-line# ! ;M ! ! : set-scrollinfo ( -- ) ! screen-rows to nPage ! cur-first-line to nPos ! last-line# 1- to nMax first-line# to nMin ! true ScrollInfo SB_VERT hWnd Call SetScrollInfo drop ! ; ! ! : set-params ( -- ) ! width char-width / to screen-cols ! height char-height / to screen-rows ! last-line# screen-rows - 0max to last-top-line# ! ; : release-buffptr ( -- ) *************** *** 58,69 **** ;M - : set-scrollpos ( -- ) \ position the vertical button in the scroll bar - TRUE cur-first-line SB_VERT GetHandle: self Call SetScrollPos drop ; - - :m on_size: ( -- ) - set-params - set-scrollpos - ;m - :m startpos: 0 0 ;m --- 72,75 ---- *************** *** 128,132 **** 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 --- 134,138 ---- 0max last-top-line# min to cur-first-line cur-first-line - char-height * 0 swap Scroll: self \ scroll rather than repaint ! set-scrollinfo ;M :M VScroll: ( n -- ) \ move n lines up or down *************** *** 176,179 **** --- 182,191 ---- on_done: super ;m + :M on_size: ( -- ) + set-params + set-scrollinfo + cur-first-line last-top-line# > IF -1 VScroll: self THEN + ;M + :M AutoSize: ( -- ) tempRect.AddrOf GetClientRect: Parent *************** *** 186,188 **** ;class - \s --- 198,199 ---- |