[lazarus] SearchViewResults.diff

Bob Wingard bwingard at gt.rr.com
Sat Nov 15 18:01:49 EST 2003


Mattias,

	I noticed that my changes were in CVS this morning but they did not
seem to work. I made a modification to the uniteditor.pp file to show
the search results on top after the search is complete. The diff pick up
a couple of other small changes that I made today.

Bob


? .gdbtkinit
? IDE.txt
? SearchForm.diff
? SearchResults.diff
? SearchResults.zip
? aboutfrm.ppu
? abstractformeditor.ppu
? addfiletoapackagedlg.ppu
? addtopackagedlg.ppu
? addtoprojectdlg.ppu
? aligncompsdlg.ppu
? basedebugmanager.ppu
? basepkgmanager.ppu
? breakpointsdlg.ppu
? brokendependenciesdlg.ppu
? buildfiledlg.ppu
? buildlazdialog.ppu
? callstackdlg.ppu
? charactermapdlg.ppu
? checkcompileropts.ppu
? checklfmdlg.ppu
? clipboardhistory.ppu
? cmdlinedebugger.ppu
? codeexplorer.ppu
? codetemplatedialog.ppu
? codetoolsdefines.ppu
? codetoolsdefpreview.ppu
? codetoolsoptions.ppu
? columndlg.ppu
? compiler.ppu
? compileroptions.ppu
? componenteditors.ppu
? componentpalette.ppu
? componentreg.ppu
? componenttreeview.ppu
? controlselection.ppu
? customformeditor.ppu
? dbgoutputform.ppu
? dbgutils.ppu
? debugger.ppu
? debuggerdlg.ppu
? debugmanager.ppu
? debugoptionsfrm.ppu
? delphiunit2laz.ppu
? designer.ppu
? designermenu.ppu
? designerprocs.ppu
? dialogprocs.ppu
? diffdialog.ppu
? diffpatch.ppu
? diskdiffsdialog.ppu
? editdefinetree.ppu
? editoroptions.ppu
? encloseselectiondlg.ppu
? environmentopts.ppu
? extractprocdlg.ppu
? exttooldialog.ppu
? exttooleditdlg.ppu
? filereferencelist.ppu
? findinfilesdlg.ppu
? findreplacedialog.ppu
? formeditor.ppu
? frmsearch.ppu
? gdbmidebugger.ppu
? gdbtypeinfo.ppu
? graphpropedits.ppu
? idedefs.ppu
? ideoptiondefs.ppu
? ideprocs.ppu
? imagelisteditor.ppu
? imexportcompileropts.ppu
? initialsetupdlgs.ppu
? inputfiledialog.ppu
? inputhistory.ppu
? jitforms.ppu
? keymapping.ppu
? keymapschemedlg.ppu
? lazarus
? lazarusidestrconsts.ppu
? lazarusidestrconsts.rst
? lazconf.ppu
? listviewpropedit.ppu
? localsdlg.ppu
? macropromptdlg.ppu
? main.ppu
? mainbar.ppu
? makeresstrdlg.ppu
? menueditorform.ppu
? miscoptions.ppu
? mpaslex.ppu
? msgview.ppu
? newdialog.ppu
? newprojectdlg.ppu
? noncontrolforms.ppu
? objectinspector.ppu
? objinspstrconsts.ppu
? objinspstrconsts.rst
? openinstalledpkgdlg.ppu
? outputfilter.ppu
? packagedefs.ppu
? packageeditor.ppu
? packagelinks.ppu
? packagesystem.ppu
? patheditordlg.ppu
? pkggraphexplorer.ppu
? pkgmanager.ppu
? pkgoptionsdlg.ppu
? processlist.ppu
? project.ppu
? projectdefs.ppu
? projectinspector.ppu
? projectopts.ppu
? propedits.ppu
? publishmodule.ppu
? publishprojectdlg.ppu
? registerfcl.ppu
? registerlcl.ppu
? registersynedit.ppu
? runparamsopts.ppu
? scalecompsdlg.ppu
? searchresults.lfm
? searchresults.lrs
? searchresults.pas
? searchresultview.ppu
? showcompileropts.ppu
? sizecompsdlg.ppu
? sortselectiondlg.ppu
? sourceeditprocs.ppu
? sourcemarks.ppu
? splash.ppu
? sshgdbmidebugger.ppu
? sysvaruseroverridedlg.ppu
? taborderdlg.ppu
? todolist.ppu
? transfermacros.ppu
? ucomponentmanmain.ppu
? ufrmaddcomponent.ppu
? unitdependencies.ppu
? uniteditor.ppu
? unitinfodlg.ppu
? viewunit_dlg.ppu
? watchesdlg.ppu
? watchpropertydlg.ppu
? wordcompletion.ppu
? components/units/allcodetoolunits.ppu
? components/units/allsyneditunits.ppu
? components/units/avl_tree.ppu
? components/units/basiccodetools.ppu
? components/units/codeatom.ppu
? components/units/codecache.ppu
? components/units/codecompletiontool.ppu
? components/units/codetemplatestool.ppu
? components/units/codetoolmanager.ppu
? components/units/codetoolmemmanager.ppu
? components/units/codetoolsstrconsts.ppu
? components/units/codetoolsstrconsts.rst
? components/units/codetoolsstructs.ppu
? components/units/codetree.ppu
? components/units/customcodetool.ppu
? components/units/definetemplates.ppu
? components/units/eventcodetool.ppu
? components/units/expreval.ppu
? components/units/extractproctool.ppu
? components/units/fileprocs.ppu
? components/units/finddeclarationcache.ppu
? components/units/finddeclarationtool.ppu
? components/units/identcompletiontool.ppu
? components/units/keywordfunclists.ppu
? components/units/laz_dom.ppu
? components/units/laz_xmlcfg.ppu
? components/units/laz_xmlread.ppu
? components/units/laz_xmlwrite.ppu
? components/units/lfmtrees.ppu
? components/units/linkscanner.ppu
? components/units/memcheck.ppu
? components/units/methodjumptool.ppu
? components/units/multikeywordlisttool.ppu
? components/units/pascalparsertool.ppu
? components/units/pascalreadertool.ppu
? components/units/resourcecodetool.ppu
? components/units/sourcechanger.ppu
? components/units/sourcelog.ppu
? components/units/stdcodetools.ppu
? components/units/syncompletion.ppu
? components/units/synedit.ppu
? components/units/syneditautocomplete.ppu
? components/units/syneditexport.ppu
? components/units/synedithighlighter.ppu
? components/units/syneditkeycmds.ppu
? components/units/syneditlazdsgn.ppu
? components/units/syneditmiscclasses.ppu
? components/units/syneditmiscprocs.ppu
? components/units/syneditplugins.ppu
? components/units/syneditregexsearch.ppu
? components/units/syneditsearch.ppu
? components/units/syneditstrconst.ppu
? components/units/syneditstrconst.rst
? components/units/synedittextbuffer.ppu
? components/units/synedittypes.ppu
? components/units/synexporthtml.ppu
? components/units/synhighlightercpp.ppu
? components/units/synhighlighterhtml.ppu
? components/units/synhighlighterjava.ppu
? components/units/synhighlighterlfm.ppu
? components/units/synhighlightermulti.ppu
? components/units/synhighlighterpas.ppu
? components/units/synhighlighterperl.ppu
? components/units/synhighlighterposition.ppu
? components/units/synhighlighterunixshellscript.ppu
? components/units/synhighlighterunixshellscript.rst
? components/units/synhighlighterxml.ppu
? components/units/synmacrorecorder.ppu
? components/units/synmacrorecorder.rst
? components/units/synmemo.ppu
? components/units/synregexpr.ppu
? components/units/syntextdrawer.ppu
? designer/units/jitform.ppu
? examples/bitbtnform.ppu
? examples/bitbutton
? examples/checkbox
? examples/combobox
? examples/comdialogs
? examples/dlgform.ppu
? examples/edittest
? examples/fpcmade.lnx
? examples/groupbox
? examples/groupboxnested
? examples/hello
? examples/helloform.ppu
? examples/listboxtest
? examples/listviewtest
? examples/memotest
? examples/messagedialogs
? examples/notebk
? examples/notebku.ppu
? examples/notebooktest
? examples/progressbar
? examples/scrollbar
? examples/speedtest
? examples/synedit1
? examples/testall
? examples/testallform.ppu
? examples/toolbar
? examples/trackbar
? lcl/interfaces/gtk2/gtk2
? lcl/units/actnlist.ppu
? lcl/units/alllclunits.ppu
? lcl/units/arrow.ppu
? lcl/units/avglvltree.ppu
? lcl/units/buttons.ppu
? lcl/units/calendar.ppu
? lcl/units/checklst.ppu
? lcl/units/clipbrd.ppu
? lcl/units/clistbox.ppu
? lcl/units/comctrls.ppu
? lcl/units/commctrl.ppu
? lcl/units/controls.ppu
? lcl/units/customtimer.ppu
? lcl/units/dbctrls.ppu
? lcl/units/dbgrids.ppu
? lcl/units/dialogs.ppu
? lcl/units/dirsel.ppu
? lcl/units/dynamicarray.ppu
? lcl/units/dynhasharray.ppu
? lcl/units/extctrls.ppu
? lcl/units/extdlgs.ppu
? lcl/units/extendedstrings.ppu
? lcl/units/filectrl.ppu
? lcl/units/forms.ppu
? lcl/units/graphics.ppu
? lcl/units/graphmath.ppu
? lcl/units/graphtype.ppu
? lcl/units/grids.ppu
? lcl/units/imglist.ppu
? lcl/units/interfacebase.ppu
? lcl/units/lazlinkedlist.ppu
? lcl/units/lclintf.ppu
? lcl/units/lclmemmanager.ppu
? lcl/units/lclproc.ppu
? lcl/units/lclstrconsts.ppu
? lcl/units/lclstrconsts.rst
? lcl/units/lcltype.ppu
? lcl/units/lmessages.ppu
? lcl/units/lresources.ppu
? lcl/units/maskedit.ppu
? lcl/units/menus.ppu
? lcl/units/messages.ppu
? lcl/units/pairsplitter.ppu
? lcl/units/postscriptprinter.ppu
? lcl/units/printers.ppu
? lcl/units/registry.ppu
? lcl/units/spin.ppu
? lcl/units/stdctrls.ppu
? lcl/units/stringhashlist.ppu
? lcl/units/textstrings.ppu
? lcl/units/toolwin.ppu
? lcl/units/utrace.ppu
? lcl/units/vclglobals.ppu
? lcl/units/gnome/gtkdef.ppu
? lcl/units/gnome/gtkglobals.ppu
? lcl/units/gnome/gtkint.ppu
? lcl/units/gnome/gtkmsgqueue.ppu
? lcl/units/gnome/gtkproc.ppu
? lcl/units/gnome/gtkwinapiwindow.ppu
? lcl/units/gtk/gtkdef.ppu
? lcl/units/gtk/gtkglobals.ppu
? lcl/units/gtk/gtkint.ppu
? lcl/units/gtk/gtkmsgqueue.ppu
? lcl/units/gtk/gtkproc.ppu
? lcl/units/gtk/gtkwinapiwindow.ppu
? lcl/units/gtk/interfaces.ppu
? packager/units/lazaruspackageintf.ppu
Index: frmsearch.pas
===================================================================
RCS file: /FPC/CVS/projects/lazarus/frmsearch.pas,v
retrieving revision 1.2
diff -u -r1.2 frmsearch.pas
--- frmsearch.pas	15 Nov 2003 13:07:09 -0000	1.2
+++ frmsearch.pas	15 Nov 2003 23:02:47 -0000
@@ -216,6 +216,7 @@
       ThisFile.LoadFromFile(TheFileName);
       for Lines:= 0 to ThisFile.Count -1 do
       begin
+        Application.ProcessMessages;
         TheLine:= ThisFile.Strings[Lines];
         if not fCaseSensitive then
           TheLine:= UpperCase(TheLine);
@@ -289,6 +290,7 @@
       ThisFile.LoadFromFile(TheFileName);
       for Lines:= 0 to ThisFile.Count - 1 do
       begin
+        Application.ProcessMessages;
         TheLine:= ThisFile[Lines];
         if RE.Exec(TheLine) then
         begin
@@ -317,10 +319,15 @@
 
 {Start SearchFile ============================================================}
 begin
-  if not fRegExp then
-    DoNormalSearch
-  else
-    DoRegExpSearch;
+  try
+    fResultsList.BeginUpdate;
+    if not fRegExp then
+      DoNormalSearch
+    else
+      DoRegExpSearch;
+  finally
+    fResultsList.EndUpdate;
+  end;//finally
 end;//SearchFile
 
 
@@ -450,7 +457,6 @@
   Application.ProcessMessages;
   inc(fMatches);
   lblMatches.Caption:= IntToStr(fMatches);
-  Application.ProcessMessages;
 end;//UpdateMatches
 
 
@@ -458,14 +464,12 @@
 var
   DisplayFileName: string;
 begin
-  Application.ProcessMessages;
   DisplayFileName:= FileName;
   While ((Length(DisplayFileName) * fCharWidth) >= lblProgress.Width) do
   begin
     DisplayFileName:= PadAndShorten(DisplayFileName);
   end;//while
   lblProgress.Caption:= DisplayFileName;
-  Application.ProcessMessages;
 end;//UpdateProgress
 
 function TSearchForm.PadAndShorten(FileName: string): string;
Index: searchresultview.pp
===================================================================
RCS file: /FPC/CVS/projects/lazarus/searchresultview.pp,v
retrieving revision 1.3
diff -u -r1.3 searchresultview.pp
--- searchresultview.pp	15 Nov 2003 14:04:16 -0000	1.3
+++ searchresultview.pp	15 Nov 2003 23:02:48 -0000
@@ -68,6 +68,7 @@
     function GetSourcePositon: TPoint;
     function GetSourceFileName: string;
     function GetSelectedText: string;
+    procedure BringResultsToFront(APageName: string);
     procedure BeginUpdate;
     procedure EndUpdate;
     property OnSelectionChanged: TNotifyEvent read fOnSelectionChanged
@@ -148,6 +149,16 @@
   fUpdating:= false;
 end;//EndUpdate
 
+{Brings The results tab named APageName to front if APageName does not exist
+ does nothing}
+procedure TSearchResultsView.BringResultsToFront(APageName: string);
+begin
+  if PageExists(APageName) then
+  begin
+    ResultsNoteBook.PageIndex:= GetPageIndex(APageName);
+  end;//if
+end;//BringResultsToFront
+
 procedure TSearchResultsView.ResultsNoteBookClosetabclicked(Sender: TObject);
 var
   TheObject: TObject;
@@ -212,6 +223,7 @@
       if i > -1 then
       begin
         NewListBox:= GetListBox(i);
+        ResultsNoteBook.PageIndex:= i;
       end//if
       else
       begin
Index: uniteditor.pp
===================================================================
RCS file: /FPC/CVS/projects/lazarus/uniteditor.pp,v
retrieving revision 1.270
diff -u -r1.270 uniteditor.pp
--- uniteditor.pp	15 Nov 2003 14:04:16 -0000	1.270
+++ uniteditor.pp	15 Nov 2003 23:02:53 -0000
@@ -3440,6 +3440,7 @@
         finally
           FreeAndNil(SearchForm);
           SearchResultsView.EndUpdate;
+          SearchResultsView.ShowOnTop;
         end;//finally
       finally
         FreeAndNil(TheFileList);





More information about the Lazarus mailing list