From: Ezra B. <ezr...@us...> - 2007-05-14 05:37:42
|
Update of /cvsroot/win32forth/win32forth/apps/Win32ForthIDE In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25188 Modified Files: EdPreferences.f EdReplace.f Main.f ProjectTree.f Log Message: Small enhancement to search & replace. Some code tidying. EAB Index: Main.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/Main.f,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Main.f 13 May 2007 07:52:26 -0000 1.39 --- Main.f 14 May 2007 05:37:39 -0000 1.40 *************** *** 98,104 **** needs EdTabControl.f - \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - Needs Task.f --- 98,101 ---- *************** *** 143,147 **** : InitClassBrowsers ( -- ) VocInitTask run-task 0= abort" Failed to start background Task" ! ClassInitTask run-task 0= abort" Failed to start background Task" ; \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ --- 140,144 ---- : InitClassBrowsers ( -- ) VocInitTask run-task 0= abort" Failed to start background Task" ! ClassInitTask run-task 0= abort" Failed to start background Task" ; \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *************** *** 741,745 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! fload ScintillaMDI.f fload ScintillaHyperMDI.f fload EdHexViewer.f --- 738,742 ---- \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ! needs ScintillaMDI.f fload ScintillaHyperMDI.f fload EdHexViewer.f Index: ProjectTree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/ProjectTree.f,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ProjectTree.f 25 Feb 2007 19:04:42 -0000 1.16 --- ProjectTree.f 14 May 2007 05:37:39 -0000 1.17 *************** *** 20,24 **** \ 0 value TheStatusBar 0 value TheStatusBar ! 0 value dirty? 0 value Modified --- 20,24 ---- \ 0 value TheStatusBar 0 value TheStatusBar ! 0 value module? 0 value dirty? 0 value Modified *************** *** 75,79 **** short itemflags 1 bits itemid \ item id, 0 for child item ! 15 bits reservedflags 4 cells bytes reserved ;recordsize: sizeof(iteminfo) --- 75,80 ---- short itemflags 1 bits itemid \ item id, 0 for child item ! 1 bits recursed ! 14 bits reservedflags 4 cells bytes reserved ;recordsize: sizeof(iteminfo) *************** *** 116,119 **** --- 117,126 ---- :m isitemid: ( f -- ) to itemid ;m + + :m recursed: ( -- recursed ) + recursed ;m + + :m isrecursed: ( f -- ) + to recursed ;m ;class *************** *** 287,312 **** ; :M AddItem: ( str cnt parentlist -- ) to ThisList pad place no-duplicates? ! if #items: ThisList ?dup ! if 1+ 1 ! do i >Link#: ThisList ! Data@: ThisList Getname: [ ] zcount ! pad count istr= ! if unloop exitm ! then ! loop ! then then Data@: ThisList ! if AddLink: ThisList then New> TreeItem dup Data!: ThisList to ThisItem ! pad count UpdateList ;M :m AddModule: ( str cnt -- ) ! ModuleList AddItem: self ;m :m AddForm: ( str cnt -- ) ! FormList AddItem: self ;m :m AddDLL: ( str cnt -- ) --- 294,322 ---- ; + :M InList?: { str cnt thelist -- f } + #items: TheList ?dup + if 1+ 1 + do i >Link#: TheList + Data@: TheList Getname: [ dup ] zcount + str cnt istr= + if unloop exitm + then drop + loop + then 0 ;M + :M AddItem: ( str cnt parentlist -- ) to ThisList pad place no-duplicates? ! if pad count ThisList inlist?: self ?exitm then Data@: ThisList ! if AddLink: ThisList then New> TreeItem dup Data!: ThisList to ThisItem ! pad count 2dup cr type UpdateList ;M :m AddModule: ( str cnt -- ) ! true to module? ModuleList AddItem: self ;m :m AddForm: ( str cnt -- ) ! false to module? FormList AddItem: self ;m :m AddDLL: ( str cnt -- ) *************** *** 968,973 **** s" sys-winlibrary" "of true to skip-recurse? true endof \ don't search .dll file s" load-dialog" "of true to skip-recurse? true to dialog? true endof \ add .res and .h later ! s" thisfile" "of true to skip-recurse? true endof \ special word for PM ??? ! s" load-bitmap" "of bl word drop true to skip-recurse? true endof \ skip bitmap name s" toolbar" "of bl word drop true to skip-recurse? true endof \ skip bitmap name ( default ) false swap --- 978,982 ---- s" sys-winlibrary" "of true to skip-recurse? true endof \ don't search .dll file s" load-dialog" "of true to skip-recurse? true to dialog? true endof \ add .res and .h later ! \ s" load-bitmap" "of bl word drop true to skip-recurse? true endof \ skip bitmap name s" toolbar" "of bl word drop true to skip-recurse? true endof \ skip bitmap name ( default ) false swap *************** *** 990,994 **** \ Given file name search for needed files ! : BuildNeededFiles { fname fcnt \ tmp$ -- } \ recursive routine false to comment? maxstring localalloc: tmp$ --- 999,1003 ---- \ Given file name search for needed files ! : BuildNeededFiles { fname fcnt \ tmp$ obj -- } \ recursive routine false to comment? maxstring localalloc: tmp$ *************** *** 1012,1024 **** if 2dup addfile - \ 2dup SetText: ProjStatus dialog? IF 2dup pad place -2 pad c+! s" .res" pad +place pad count addfile - THEN skip-recurse? if 2drop ! else comment? -rot recurse to comment? \ save comment? on stack then then --- 1021,1037 ---- if 2dup addfile dialog? IF 2dup pad place -2 pad c+! s" .res" pad +place pad count addfile THEN skip-recurse? if 2drop ! else comment? >r 2dup module? ! if modulelist: theproject ! else formlist: theproject ! then inlist?: theproject to obj recursed: obj 0= ! if cr ." recursing " type recurse \ save comment? on stack ! else 2drop ! then r> to comment? true isrecursed: obj then then *************** *** 1045,1054 **** SetBuildFile: TheProject else drop exit ! then GetBuildFile: TheProject ModuleList: TheProject ! AddItem: TheProject ! true to Modified then fClear if Clear: TheProject then - \ s" " SetText: ProjStatus GetBuildFile: TheProject ModuleList: TheProject AddItem: TheProject --- 1058,1064 ---- SetBuildFile: TheProject else drop exit ! then then fClear if Clear: TheProject then GetBuildFile: TheProject ModuleList: TheProject AddItem: TheProject *************** *** 1056,1068 **** GetBuildFile: TheProject BuildNeededFiles - #addedfiles Modified or to Modified - #addedfiles (.) pad place - s" files added " pad +place - #linecount (.) pad +place - s" total lines search of " pad +place - total-size (.) pad +place - s" bytes" pad +place - - GetBuildFile: TheProject SetBuildFile: TheProject \ update info SortParentLists: TheProject --- 1066,1069 ---- Index: EdPreferences.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdPreferences.f,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EdPreferences.f 13 Jan 2007 02:20:10 -0000 1.2 --- EdPreferences.f 14 May 2007 05:37:39 -0000 1.3 *************** *** 39,43 **** ! :m close: ( -- ) color: fore to fore-color color: back to back-color --- 39,43 ---- ! : savecolors ( -- ) color: fore to fore-color color: back to back-color *************** *** 48,52 **** IsButtonChecked?: chkAutoIndent to autoindent? Update ! close: super ;m : command-func ( id obj -- ) --- 48,52 ---- IsButtonChecked?: chkAutoIndent to autoindent? Update ! ; : command-func ( id obj -- ) *************** *** 58,63 **** getid: btnSelectFore of choose: selfore if color: selfore paint: selfore-window then endof getid: btnSelectBack of choose: selback if color: selback paint: selback-window then endof ! getid: btncancel of close: super endof ! getid: btnok of close: self endof endcase ; --- 58,63 ---- getid: btnSelectFore of choose: selfore if color: selfore paint: selfore-window then endof getid: btnSelectBack of choose: selback if color: selback paint: selback-window then endof ! getid: btncancel of close: self endof ! getid: btnok of savecolors close: self endof endcase ; Index: EdReplace.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Win32ForthIDE/EdReplace.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdReplace.f 15 Apr 2007 02:55:45 -0000 1.1 --- EdReplace.f 14 May 2007 05:37:39 -0000 1.2 *************** *** 12,19 **** --- 12,26 ---- 0 value scope 0 value replacecount + 0 value savedpos : SearchForText ( -- f ) findbuf count SearchInTarget: CurrentWindow -1 <> ; + : SavePosition ( -- ) + GetCurrentPos: CurrentWindow to savedpos ; + + : RestorePosition ( -- ) + savedpos GotoPos: CurrentWindow ; + : setflags ( -- ) 0 \ default *************** *** 37,41 **** : SetTargetRange ( -- ) \ what to search direction ! if GetTargetStart: CurrentWindow 0 else GetTargetEnd: CurrentWindow GetTextLength: CurrentWindow then SetTargetEnd: CurrentWindow SetTargetStart: CurrentWindow ; --- 44,48 ---- : SetTargetRange ( -- ) \ what to search direction ! if GetTargetStart: CurrentWindow 0 \ backwards else GetTargetEnd: CurrentWindow GetTextLength: CurrentWindow then SetTargetEnd: CurrentWindow SetTargetStart: CurrentWindow ; *************** *** 56,60 **** s" time(s)." pad +place true pad count ?MessageBox ! 0 GotoPos: CurrentWindow ; :Object frmConfirmPrompt <Super frmPrompt --- 63,67 ---- s" time(s)." pad +place true pad count ?MessageBox ! RestorePosition ; :Object frmConfirmPrompt <Super frmPrompt *************** *** 134,137 **** --- 141,154 ---- endcase ; + : ?TextSelected { \ SelBuf$ -- } + \ replace findbuf contents if text is selected + 0 GetSelText: CurrentWindow LocalAlloc: SelBuf$ + SelBuf$ GetSelText: CurrentWindow + if SelBuf$ zcount BL skip -trailing 10 -TRAILCHARS 13 -TRAILCHARS + ?dup + if maxstring min Findbuf place + else drop + then + then ; :M ON_INIT: ( -- ) *************** *** 151,154 **** --- 168,173 ---- scope Check: radCurrent + ?TextSelected + findbuf count SetText: txtSearch Replacebuf count SetText: txtReplace *************** *** 158,161 **** --- 177,182 ---- 0 to replacecount + SavePosition + ;m |