From: Ezra B. <ezr...@us...> - 2010-02-01 01:32:39
|
Update of /cvsroot/win32forth/win32forth/src/lib In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17440 Modified Files: FolderView.f ScintillaControl.f Log Message: Updates.EAB Index: ScintillaControl.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/ScintillaControl.f,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ScintillaControl.f 3 Aug 2008 11:08:51 -0000 1.9 --- ScintillaControl.f 1 Feb 2010 01:32:31 -0000 1.10 *************** *** 1689,1692 **** --- 1689,1700 ---- swap SCI_STYLESETFONT SendMessage:Self drop ;M + :M SetFont: { TheFont -- } + STYLE_DEFAULT GetFaceName: TheFont asciiz StyleSetFont: self + GetDC: self >r + LOGPIXELSY r@ Call GetDeviceCaps >r + GetHeight: TheFont 72 * r> / abs STYLE_DEFAULT SCI_STYLESETSIZE SendMessage:SelfDrop + GetWeight: TheFont 700 = STYLE_DEFAULT SCI_STYLESETBOLD SendMessage:SelfDrop + GetItalic: TheFont STYLE_DEFAULT SCI_STYLESETITALIC SendMessage:SelfDrop + r> ReleaseDc: self ;M \ ----------------------------------------------------------------------------- Index: FolderView.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/FolderView.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FolderView.f 10 Apr 2009 16:24:33 -0000 1.3 --- FolderView.f 1 Feb 2010 01:32:31 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- needs listview.f needs quiksort.f + needs statusbar.f \- ?exitm macro ?exitm " if exitm then" *************** *** 25,74 **** Endbar - \ #IFNDEF compareia - \ - \ code compareia ( adr1 len1 adr2 len2 -- n ) - \ sub ebp, # 8 - \ mov 0 [ebp], edi - \ mov 4 [ebp], esi - \ pop eax \ eax = adr2 - \ pop ecx \ ecx = len1 - \ pop esi \ esi = adr1 - \ add esi, edi \ absolute address - \ add edi, eax \ edi = adr2 (abs) - \ sub eax, eax \ default is 0 (strings match) - \ cmp ecx, ebx \ compare lengths - \ je short @@2 - \ ja short @@1 - \ dec eax \ if len1 < len2, default is -1 - \ jmp short @@2 - \ @@1: - \ inc eax \ if len1 > len2, default is 1 - \ mov ecx, ebx \ and use shorter length - \ @@2: - \ mov bl, BYTE [esi] - \ mov bh, BYTE [edi] - \ inc esi - \ inc edi - \ cmp bx, # $2F2F \ skip chars beteen 0 and 2F ( now lower case ) - \ jle short @@7 - \ or bx, # $2020 \ May 21st, 2003 or is better then xor - \ @@7: - \ cmp bh, bl - \ loopz @@2 - \ - \ je short @@4 \ if equal, return default - \ jnb short @@3 \ ** jnb for an unsigned test ( was jns ) - \ mov eax, # 1 \ if str1 > str2, return 1 - \ jmp short @@4 - \ @@3: - \ mov eax, # -1 \ if str1 < str2, return -1 - \ @@4: - \ mov ebx, eax - \ mov edi, 0 [ebp] - \ mov esi, 4 [ebp] - \ add ebp, # 8 - \ next c; - \ #ENDIF - INTERNAL EXTERNAL --- 26,29 ---- *************** *** 100,103 **** --- 55,111 ---- MODULE + \ ************************************************************************* + \ Simple no frills wildcard (* and ?) pattern matching of files, emulates API I think. + create filespec-name 100 allot filespec-name off + create filespec-ext 100 allot filespec-ext off + create filebuf max-path allot + create filebuf-ext 100 allot + + : ?*-in-name { buf -- } \ first cell of buffer stores flag for * check + buf cell+ count tuck '*' scan nip dup>r - buf cell+ c! + r> buf ! ; + + : parse-filespecs { addr cnt -- } + addr cnt "minus-ext" filespec-name cell+ place + addr cnt ".ext-only" 1 /string filespec-ext cell+ place + filespec-name ?*-in-name + filespec-ext ?*-in-name ; + + : parse-filename { addr cnt -- } + addr cnt "minus-ext" filebuf place + addr cnt ".ext-only" 1 /string filebuf-ext place ; + + : compare-buf { specname bufname \ speclen buflen specflag -- f } + specname cell+ c@ to speclen + specname @ to specflag + bufname c@ to buflen + speclen 0= specflag 0<> and ?dup ?exit \ assume single * in spec + false \ default result + speclen buflen > ?exit \ filespec greater so fail + speclen 0 + ?do specname cell+ 1+ i + c@ dup '?' <> + if upc bufname 1+ i + c@ upc <> + if unloop exit \ comparison failed + then + else drop + then + loop speclen 0= buflen 0<> and ?exit \ no specs so leave as false + \ comparison should be successful only if both buffers are = in length + \ OR if they are not equal but an * is specified in the specs + \ ( if they are not equal at this point specs is shorter of two ) + speclen buflen = ( -- res f ) \ two buffers are equal + dup not ( -- res f -f ) \ they are not equal + specflag 0<> and \ but we have an * + or or ; \ or to default flag + + : match-specs? { specname speccnt fname fcnt -- f } + specname speccnt s" *.*" str= ?dup ?exit \ special case + fname fcnt parse-filename + specname speccnt parse-filespecs + filespec-name filebuf compare-buf dup 0= ?exit + filespec-ext filebuf-ext compare-buf and ; + + \ ************************************************************************** + :Class FindFile <Super Object *************** *** 122,126 **** :M GetFileSize: ( -- d ) ! get-file-size ;M --- 130,134 ---- :M GetFileSize: ( -- d ) ! _win32-find-data 7 cells+ 2@ ;M *************** *** 131,140 **** ;M ! : .or..? ( -- f ) \ is found file directories . or ..? ! GetFileName: self drop c@ '.' = ; :M IsDirectory?: ( -- f ) \ exclude . and .. ! GetFileAttributes: self FILE_ATTRIBUTE_DIRECTORY and 0<> ! .or..? not and ;M --- 139,148 ---- ;M ! :M .or..?: ( -- f ) \ is found file directories . or ..? ! GetFileName: self drop c@ '.' = ;M :M IsDirectory?: ( -- f ) \ exclude . and .. ! GetFileAttributes: self FILE_ATTRIBUTE_DIRECTORY and ! \ .or..? not and ;M *************** *** 172,176 **** :Class FolderItem <super Object ! max-path 1+ bytes itemname int iconhandle int itemhandle \ parent handle --- 180,184 ---- :Class FolderItem <super Object ! max-path cell+ bytes itemname int iconhandle int itemhandle \ parent handle *************** *** 206,214 **** :M GetFileSize: ( -- d ) ! FileSizeLow ;M ! : .or..? ( -- f ) \ is found file directories . or ..? ! GetFileName: self drop c@ '.' = ; :M IsFile?: ( -- f ) --- 214,222 ---- :M GetFileSize: ( -- d ) ! FileSizeLow FileSizeHigh ;M ! :M .or..?: ( -- f ) \ is found file directories . or ..? ! GetFileName: self drop c@ '.' = ;M :M IsFile?: ( -- f ) *************** *** 217,230 **** :M IsDirectory?: ( -- f ) \ exclude . and .. ! IsFile?: self not ! .or..? not and ;M :M Classinit: ( -- ) Classinit: super ! Win32_Find_Data sizeof(Win32_Find_Data) erase 0 to iconhandle 0 to itemhandle ! -1 index ! ;M --- 225,237 ---- :M IsDirectory?: ( -- f ) \ exclude . and .. ! GetFileAttributes: self FILE_ATTRIBUTE_DIRECTORY and ;M :M Classinit: ( -- ) Classinit: super ! \ Win32_Find_Data sizeof(Win32_Find_Data) erase 0 to iconhandle 0 to itemhandle ! 0 index ! ;M *************** *** 233,245 **** :M setup: ( addr cnt -- ) \ assumes name is set for FindFirstFile, FindNextFile etc. ! itemname max-path erase ! max-path min 0max itemname swap move \ transfer the info ! _Win32-Find-Data Win32_Find_Data sizeof(Win32_Find_Data) move index itemname itemhandle Call ExtractAssociatedIcon to iconhandle ;M :M GetName: ( -- addrz ) ! itemname ;M :M GetName$: ( -- addr cnt ) --- 240,253 ---- :M setup: ( addr cnt -- ) \ assumes name is set for FindFirstFile, FindNextFile etc. ! \ itemname max-path erase ! max-path min 0max dup>r itemname swap cmove ! itemname r> + off \ transfer the info ! _Win32-Find-Data Win32_Find_Data sizeof(Win32_Find_Data) cmove index itemname itemhandle Call ExtractAssociatedIcon to iconhandle ;M :M GetName: ( -- addrz ) ! itemname ;M :M GetName$: ( -- addr cnt ) *************** *** 252,255 **** --- 260,270 ---- to itemhandle ;M + \ Windows API say the following isn't necessary but it is + :M ~: ( -- ) + iconhandle ?dup + if Call DestroyIcon drop + 0 to iconhandle + then ;M + ;Class *************** *** 269,273 **** ;M ! :M total: ( -- n ) Data@: self if #links: self --- 284,288 ---- ;M ! :M Total: ( -- n ) Data@: self if #links: self *************** *** 276,281 **** :M GetItem: { n -- obj | -1 } ! -1 total: self 0= ?exitm ! n 1 total: self between not ?exitm drop n >Link#: self Data@: self ;M --- 291,296 ---- :M GetItem: { n -- obj | -1 } ! -1 Total: self 0= ?exitm ! n 1 Total: self between not ?exitm drop n >Link#: self Data@: self ;M *************** *** 299,302 **** --- 314,318 ---- int itemindex int FolderList + int DirList int ThisItem \ temp pointer to new item int hwndSmallIcons \ handle to imagelist for small icons *************** *** 311,321 **** int #dirs \ number of directories found when updating int #fls \ ditto files int hwndlabel \ handle to window to display path int popup? \ number of files shown is limited only by available memory \ however only first 4k will be sorted. Of course the buffer size could always be increased ! 16 1024 * constant recbuffer-size ! recbuffer-size cell / constant max-recs \ about 4000 files and directories for sorting ! int recbuffer \ pointer to memory used for sorting max-path 1+ bytes Treepath --- 327,340 ---- int #dirs \ number of directories found when updating int #fls \ ditto files + dint total-size \ size of all files found int hwndlabel \ handle to window to display path int popup? + StatusBar ViewStatusBar + \ number of files shown is limited only by available memory \ however only first 4k will be sorted. Of course the buffer size could always be increased ! 16 1024 * constant RecBuffer-size ! RecBuffer-size cell / constant max-recs \ about 4000 files and directories for sorting ! int RecBuffer \ pointer to memory used for sorting max-path 1+ bytes Treepath *************** *** 328,338 **** pathstr cnt + 1- c@ ':' = ; ! : free-recbuffer ( -- ) ! recbuffer ?dup if release ! 0 to recbuffer then ; : InitTheViewColumns ( -- ) LVCF_FMT LVCF_WIDTH LVCF_TEXT LVCF_SUBITEM or or or Setmask: lvc --- 347,373 ---- pathstr cnt + 1- c@ ':' = ; + : RecBuffer() ( n -- addr ) + RecBuffer +cells ; ! : free-RecBuffer ( -- ) ! RecBuffer ?dup if release ! 0 to RecBuffer then ; + : ReadRecBuffer { list -- } \ load temporary buffer with record pointers + >FirstLink: List + Total: List max-recs min 0max 0 + ?do Data@: List i RecBuffer() ! + >NextLink: List + loop ; + + : writeRecBuffer { list -- } \ rewrite records to database + >FirstLink: List + Total: List max-recs min 0max 0 + ?do i RecBuffer() @ Data!: List + >NextLink: List + loop ; + : InitTheViewColumns ( -- ) LVCF_FMT LVCF_WIDTH LVCF_TEXT LVCF_SUBITEM or or or Setmask: lvc *************** *** 359,368 **** 80 Setcx: lvc z" Time" SetpszText: lvc ! Addr: lvc swap 1+ InsertColumn: TheView drop ! ! ; : CreateSmallImageList ( -- ) \ create small image list for list control ! total: folderlist \ maximum images dup \ number of images to use ILC_COLOR16 \ color depth --- 394,401 ---- 80 Setcx: lvc z" Time" SetpszText: lvc ! Addr: lvc swap 1+ InsertColumn: TheView drop ; : CreateSmallImageList ( -- ) \ create small image list for list control ! Total: FolderList Total: DirList + \ maximum images dup \ number of images to use ILC_COLOR16 \ color depth *************** *** 371,379 **** Call ImageList_Create to hwndSmallIcons \ do the following BEFORE adding any icons ! Color: WHITE hwndSmallIcons Call ImageList_SetBkColor drop ! ; : CreateLargeImageList ( -- ) \ create large image list for listview control ! total: folderlist \ maximum images dup \ number of images to use ILC_COLOR16 \ color depth --- 404,411 ---- Call ImageList_Create to hwndSmallIcons \ do the following BEFORE adding any icons ! Color: WHITE hwndSmallIcons Call ImageList_SetBkColor drop ; : CreateLargeImageList ( -- ) \ create large image list for listview control ! Total: FolderList Total: DirList + \ maximum images dup \ number of images to use ILC_COLOR16 \ color depth *************** *** 382,387 **** Call ImageList_Create to hwndLargeIcons \ do the following BEFORE adding any icons ! Color: WHITE hwndLargeIcons Call ImageList_SetBkColor drop ! ; : DestroyImageLists ( -- ) --- 414,418 ---- Call ImageList_Create to hwndLargeIcons \ do the following BEFORE adding any icons ! Color: WHITE hwndLargeIcons Call ImageList_SetBkColor drop ; : DestroyImageLists ( -- ) *************** *** 394,416 **** then ; ! : add-small-icons { \ item -- } \ add icon for each file CreateSmallImageList - total: folderlist 1+ 1 - ?do i >Link#: FolderList - Data@: FolderList to item - IconHandle: item ?dup if - hwndSmallIcons Call ImageList_AddIcon drop then - loop ; - - : add-large-icons { \ item -- } \ add icon for each file CreateLargeImageList ! total: folderlist 1+ 1 ! ?do i >Link#: FolderList ! Data@: FolderList to item ! IconHandle: item ?dup if ! hwndLargeIcons Call ImageList_AddIcon drop then loop ; - : AddFile ( str cnt -- ) Data@: FolderList --- 425,447 ---- then ; ! : add-icons { \ item -- } CreateSmallImageList CreateLargeImageList ! DirList ReadRecBuffer ! Total: DirList 0 ! ?do i RecBuffer() @ to item ! IconHandle: item ?dup ! if dup hwndLargeIcons Call ImageList_AddIcon drop ! hwndSmallIcons Call ImageList_AddIcon drop ! then ! loop FolderList ReadRecBuffer ! Total: FolderList 0 ! ?do i RecBuffer() @ to item ! IconHandle: item ?dup ! if dup hwndLargeIcons Call ImageList_AddIcon drop ! hwndSmallIcons Call ImageList_AddIcon drop ! then loop ; : AddFile ( str cnt -- ) Data@: FolderList *************** *** 420,423 **** --- 451,461 ---- ( str cnt ) SetUp: ThisItem ; + : AddDir ( str cnt -- ) + Data@: DirList + if AddLink: DirList + then New> FolderItem dup Data!: DirList to ThisItem + hwnd SetHandle: ThisItem + ( str cnt ) SetUp: ThisItem ; + : get-date-and-time ( obj -- timestr cnt datestr cnt ) GetModifiedTime: [ ] *************** *** 432,437 **** ; ! : AddViewItem { ndx \ obj -- } ! ndx 1+ GetItem: FolderList to obj \ first add the name LVIF_TEXT LVIF_PARAM or LVIF_IMAGE or SetMask: LvItem --- 470,478 ---- ; ! : AddViewItem { list ndx \ obj -- } ! ndx 1+ GetItem: List to obj ! list FolderList = show-dirs? and \ #dirs 0<> and ! if #dirs +to ndx \ offset for files ! then \ first add the name LVIF_TEXT LVIF_PARAM or LVIF_IMAGE or SetMask: LvItem *************** *** 439,443 **** obj SetlParam: LvItem ndx SetIImage: Lvitem ! GetFileName: obj drop SetpszText: LvItem Addr: LvItem InsertItem: TheView drop \ now we add subitems. --- 480,484 ---- obj SetlParam: LvItem ndx SetIImage: Lvitem ! GetFileName: obj drop SetpszText: LvItem Addr: LvItem InsertItem: TheView drop \ now we add subitems. *************** *** 447,451 **** 1 SetiSubItem: LVItem IsFile?: obj ! if GetFileSize: obj 0 (ud,.) asciiz else z" " \ show no size for directories then SetpszText: LvItem --- 488,492 ---- 1 SetiSubItem: LVItem IsFile?: obj ! if GetFileSize: obj (ud,.) asciiz else z" " \ show no size for directories then SetpszText: LvItem *************** *** 464,486 **** 3 SetiSubItem: LVItem ( time ) asciiz SetpszText: LvItem ! Addr: LvItem ndx SetItemText: TheView drop ! ! ; : show-files ( -- ) \ add file and stats to the listviewbox DeleteAllItems: TheView drop DestroyImageLists ! add-small-icons hwndSmallIcons LVSIL_SMALL SetImageList: TheView drop - add-large-icons hwndLargeIcons LVSIL_NORMAL SetImageList: TheView drop ! Total: FolderList dup SetItemCount: TheView drop ! 0 ! ?do i AddViewItem loop ; ! :M start: ( parent -- ) ! start: super ! new> treelist to folderlist ! recbuffer-size malloc to recbuffer ;M --- 505,536 ---- 3 SetiSubItem: LVItem ( time ) asciiz SetpszText: LvItem ! Addr: LvItem ndx SetItemText: TheView drop ; : show-files ( -- ) \ add file and stats to the listviewbox DeleteAllItems: TheView drop DestroyImageLists ! add-icons hwndSmallIcons LVSIL_SMALL SetImageList: TheView drop hwndLargeIcons LVSIL_NORMAL SetImageList: TheView drop ! 0 show-dirs? ! if #dirs + ! then show-files? ! if #fls + ! then SetItemCount: TheView drop ! show-dirs? ! if Total: DirList 0 ! ?do DirList i AddViewItem ! loop ! then show-files? ! if Total: FolderList 0 ! ?do FolderList i AddViewItem ! loop ! then ; ! :M Start: ( parent -- ) ! Start: super ! new> TreeList to FolderList ! new> TreeList to DirList ! RecBuffer-Size malloc to RecBuffer ;M *************** *** 489,496 **** InitTheViewColumns ViewPopupBar SetPopupBar: self ;M :M On_Size: ( -- ) ! 0 0 GetSize: self Move: TheView ;M :M Classinit: ( -- ) --- 539,548 ---- InitTheViewColumns ViewPopupBar SetPopupBar: self + self Start: ViewStatusBar ;M :M On_Size: ( -- ) ! Redraw: ViewStatusBar ! 0 0 GetSize: self Height: ViewStatusBar - Move: TheView ;M :M Classinit: ( -- ) *************** *** 512,517 **** 0 to #dirs 0 to #fls 0 to hwndlabel ! 0 to recbuffer NextID to id SortAscending: [ self ] ;M --- 564,570 ---- 0 to #dirs 0 to #fls + 0.0 2to total-size 0 to hwndlabel ! 0 to RecBuffer NextID to id SortAscending: [ self ] ;M *************** *** 522,572 **** FolderList Dispose 0 to FolderList ! then ; :M ~: ( -- ) DisposeTheList ! free-recbuffer ;M :M Close: ( -- ) DisposeTheList ! free-recbuffer DestroyImageLists ;M ! : finddirs ( -- ) ! 0 to #dirs TreePath count s" *.*" Setup: FileFinder FindFiles: FileFinder begin 0= while IsDirectory?: FileFinder ! if FullPath: FileFinder AddFile ! 1 +to #dirs ! then FindNextFile: FileFinder ! repeat FindClose: FileFinder ; ! ! : findfiles ( -- ) ! 0 to #fls ! thespecs first-path" ! begin dup 0> ! while TreePath count 2swap SetUp: FileFinder ! FindFiles: FileFinder ! begin 0= ! while IsFile?: FileFinder ! if FullPath: FileFinder AddFile ! 1 +to #fls ! then FindNextFile: FileFinder ! repeat FindClose: FileFinder ! thespecs next-path" ! repeat 2drop ; ! ! : FindAllFiles ( -- ) ! show-dirs? ! if finddirs ! then show-files? ! if findfiles ! then ; ! ! : recbuffer() ( n -- addr ) ! recbuffer +cells ; : dosortorder ( n -- f ) --- 575,620 ---- FolderList Dispose 0 to FolderList ! then DirList ! if DirList DisposeList ! DirList Dispose ! 0 to DirList ! then ; :M ~: ( -- ) DisposeTheList ! free-RecBuffer ;M :M Close: ( -- ) DisposeTheList ! free-RecBuffer DestroyImageLists ;M ! \ scan a directory once for all files, compare each file found to file specs and add ! \ if match is found ! : FindAllFiles ( -- ) ! 0 to #dirs ! 0 to #fls ! 0.0 2to total-size TreePath count s" *.*" Setup: FileFinder FindFiles: FileFinder begin 0= while IsDirectory?: FileFinder ! if .or..?: FileFinder not ! if FullPath: FileFinder AddDir ! 1 +to #dirs ! then ! else thespecs first-path" ! begin dup 0> ! while GetFileName: FileFinder match-specs? ! if FullPath: FileFinder AddFile ! GetFileSize: FileFinder 2+to total-size ! 1 +to #fls ! 0 0 \ set to leave ! else thespecs next-path" ! then ! repeat 2drop ! then FindNextFile: FileFinder ! repeat FindClose: FileFinder ; : dosortorder ( n -- f ) *************** *** 575,604 **** : compare-recs ( n1 n2 -- f ) GetFileName: [ swap ] ! GetFileName: [ rot ] caps-compare ( compareia ) dosortorder ; ! ! : readrecbuffer ( -- ) \ load temporary buffer with record pointers ! >FirstLink: FolderList ! total: FolderList max-recs min 0max 0 ! ?do Data@: FolderList i recbuffer() ! ! >NextLink: FolderList ! loop ; ! ! : writerecbuffer ( -- ) \ rewrite sorted records to database ! >FirstLink: FolderList ! total: FolderList max-recs min 0max 0 ! ?do i recbuffer() @ Data!: FolderList ! >NextLink: FolderList ! loop ; ! : sortfiles ( -- ) ! recbuffer 0= ?exit \ if not allocated abort sorting ['] compare-recs is precedes \ set sort comparator ! total: folderlist 2 < ?exit ! readrecbuffer \ load buffer ! #dirs 1 > ! if 0 recbuffer() #dirs sort \ sort the directories ! then #fls 1 > ! if #dirs recbuffer() #fls sort \ and the files ! then writerecbuffer ; :M Setpath: { addr cnt -- } \ check for valid path --- 623,639 ---- : compare-recs ( n1 n2 -- f ) GetFileName: [ swap ] ! GetFileName: [ rot ] caps-compare dosortorder ; ! : (sort) { list -- } ! RecBuffer 0= ?exit \ if not allocated abort sorting ['] compare-recs is precedes \ set sort comparator ! Total: list 2 < ?exit ! list ReadRecBuffer \ load buffer ! 0 RecBuffer() Total: list sort \ ! list writeRecBuffer ; ! ! : sortfolder ( -- ) ! DirList (sort) ! FolderList (sort) ; :M Setpath: { addr cnt -- } \ check for valid path *************** *** 607,611 **** treepath +null exitm ! then addr cnt 2dup + 1- c@ '\' = if 1- then find-first-file --- 642,646 ---- treepath +null exitm ! then addr cnt lastchar '\' = if 1- then find-first-file *************** *** 628,632 **** hwndlabel 0= ?exit hwndlabel Call IsWindow 0= ?exit ! treepath count asciiz 0 WM_SETTEXT hwndlabel send-window ; :M UpdateFiles: ( -- ) \ primary word, rebuild files list in view --- 663,678 ---- hwndlabel 0= ?exit hwndlabel Call IsWindow 0= ?exit ! treepath count asciiz 0 WM_SETTEXT hwndlabel Call SendMessage drop ; ! ! : show-stats ( -- ) ! new$ >r ! #dirs (.) r@ place ! s" Directories, " r@ +place ! #fls (.) r@ +place ! s" files totalling " r@ +place ! total-size (ud,.) r@ +place ! s" bytes" r@ +place ! r@ +null ! r> 1+ SetText: ViewStatusBar ; :M UpdateFiles: ( -- ) \ primary word, rebuild files list in view *************** *** 634,643 **** if current-dir$ count SetPath: self then _Win32-Find-Data [ 11 cells max-path + 14 + ] LITERAL erase FolderList DisposeList 0 to SelectedItem FindAllFiles ! SortFiles show-files show-path self On_Update null-check execute \ user function ;M --- 680,693 ---- if current-dir$ count SetPath: self then _Win32-Find-Data [ 11 cells max-path + 14 + ] LITERAL erase + s" Building list..." "message FolderList DisposeList + DirList DisposeList 0 to SelectedItem FindAllFiles ! SortFolder show-files show-path + show-stats + message-off self On_Update null-check execute \ user function ;M *************** *** 686,689 **** --- 736,742 ---- #fls ;M + :M TotalFileSize: ( -- d ) + total-size ;M + :M Showfiles: ( f -- ) \ flag=true if showing files to show-files? ;M *************** *** 745,759 **** ncode case ! LVN_ITEMCHANGED of l LVN_GetNotifyParam to SelectedItem ! l LVN_GetNotifyItem dup itemindex <> ! if to itemindex ! SelectedItem OnSelect null-check execute \ call only once ! else drop ! then ! endof ! NM_RCLICK of popup? if show-popup then ! endof ! NM_DBLCLK of ?descend ! endof endcase false --- 798,812 ---- ncode case ! LVN_ITEMCHANGED of l LVN_GetNotifyParam to SelectedItem ! l LVN_GetNotifyItem dup itemindex <> ! if to itemindex ! SelectedItem OnSelect null-check execute \ call only once ! else drop ! then ! endof ! NM_RCLICK of popup? if show-popup then ! endof ! NM_DBLCLK of ?descend ! endof endcase false |