From: Brian S. <xue...@us...> - 2007-07-29 16:15:24
|
Update of /cvsroot/popfile/windows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2839 Modified Files: Tag: b0_22_2 pfidbstatus.nsi Log Message: Take the size of the details view window into account when scrolling to bring the important part of the results into view. Index: pfidbstatus.nsi =================================================================== RCS file: /cvsroot/popfile/windows/test/pfidbstatus.nsi,v retrieving revision 1.3.2.7 retrieving revision 1.3.2.8 diff -C2 -d -r1.3.2.7 -r1.3.2.8 *** pfidbstatus.nsi 5 May 2007 12:28:07 -0000 1.3.2.7 --- pfidbstatus.nsi 29 Jul 2007 16:15:21 -0000 1.3.2.8 *************** *** 157,161 **** ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.5" ; see 'VIProductVersion' comment below for format details !define C_OUTFILE "pfidbstatus.exe" --- 157,161 ---- ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.6" ; see 'VIProductVersion' comment below for format details !define C_OUTFILE "pfidbstatus.exe" *************** *** 946,949 **** --- 946,951 ---- !define C_LVM_GETTOPINDEX 0x1027 + !define C_LVM_COUNTPERPAGE 0x1028 + #-------------------------------------------------------------------------- # Installer Function: GetDetailViewItemCount *************** *** 1025,1057 **** Function HideFinalTimestamp ! !define L_TEMP $R9 ! !define L_TOPROW $R8 Push ${L_TEMP} Push ${L_TOPROW} ! ; The final timestamp block uses 3 lines so we want to scroll up 3 lines to bring ; more important lines back into view at the top of the list. The LVM_SCROLL message ; uses a pixel-based vertical scroll value instead of an item-based value so we take ; an easier approach: find the item index of the currently visible top row and then ! ; make visible the item which is 3 rows before that. (The item index is zero based so ! ; we must ensure we never supply a negative item index) ! FindWindow ${L_TOPROW} "#32770" "" $HWNDPARENT ! GetDlgItem ${L_TOPROW} ${L_TOPROW} 0x3F8 ; This is the Control ID of the details view ! SendMessage ${L_TOPROW} ${C_LVM_GETTOPINDEX} 0 0 ${L_TOPROW} - IntOp ${L_TOPROW} ${L_TOPROW} - 3 IntCmp ${L_TOPROW} 0 scrollup 0 scrollup StrCpy ${L_TOPROW} 0 scrollup: ! FindWindow ${L_TEMP} "#32770" "" $HWNDPARENT ! GetDlgItem ${L_TEMP} ${L_TEMP} 0x3F8 ; This is the Control ID of the details view ! SendMessage ${L_TEMP} ${C_LVM_ENSUREVISIBLE} ${L_TOPROW} 0 Pop ${L_TOPROW} Pop ${L_TEMP} !undef L_TEMP !undef L_TOPROW --- 1027,1080 ---- Function HideFinalTimestamp ! !define L_DLG_ITEM $R9 ; the dialog item we are going to manipulate ! !define L_SCROLLUP $R8 ; number of lines to scroll up ! !define L_TEMP $R7 ! !define L_TOPROW $R6 ; index of the row to appear at the top + Push ${L_DLG_ITEM} + Push ${L_SCROLLUP} Push ${L_TEMP} Push ${L_TOPROW} ! ; The final timestamp block uses several lines so we scroll up a few lines to bring ; more important lines back into view at the top of the list. The LVM_SCROLL message ; uses a pixel-based vertical scroll value instead of an item-based value so we take ; an easier approach: find the item index of the currently visible top row and then ! ; make visible the item which is a few rows before that. ! FindWindow ${L_DLG_ITEM} "#32770" "" $HWNDPARENT ! GetDlgItem ${L_DLG_ITEM} ${L_DLG_ITEM} 0x3F8 ; This is the Control ID of the details view ! ! ; Check how many lines can be shown in the details view ! ! SendMessage ${L_DLG_ITEM} ${C_LVM_COUNTPERPAGE} 0 0 ${L_TEMP} ! ! StrCpy ${L_SCROLLUP} 4 ; hide the three-line timestamp plus the blank line before it ! IntCmp ${L_TEMP} 10 findtop findtop ! StrCpy ${L_SCROLLUP} 3 ; hide the timestamp, leaving a blank line before & after the important lines ! ! findtop: ! ! ; Get the index of the row currently shown at the top of the details view ! ! SendMessage ${L_DLG_ITEM} ${C_LVM_GETTOPINDEX} 0 0 ${L_TOPROW} ! ! IntOp ${L_TOPROW} ${L_TOPROW} - ${L_SCROLLUP} ! ! ; The item index is zero based so we must ensure we never supply a negative item index IntCmp ${L_TOPROW} 0 scrollup 0 scrollup StrCpy ${L_TOPROW} 0 scrollup: ! SendMessage ${L_DLG_ITEM} ${C_LVM_ENSUREVISIBLE} ${L_TOPROW} 0 Pop ${L_TOPROW} Pop ${L_TEMP} + Pop ${L_SCROLLUP} + Pop ${L_DLG_ITEM} + !undef L_DLG_ITEM + !undef L_SCROLLUP !undef L_TEMP !undef L_TOPROW |