Unless I've missed something, CB is still lacking incremental search.It never did. Just hit "F3" to continue searching the term from the last position.
That's not incremental search, you're describing repeat search.Although I don't see any major benefit in this search method you might want to try the ThreadSearch plugin. It does not do the incremental stuff but has similar features. Probably you can enhance it in a way that it would work as you like.
That's not incremental search, you're describing repeat search.Although I don't see any major benefit in this search method you might want to try the ThreadSearch plugin. It does not do the incremental stuff but has similar features. Probably you can enhance it in a way that it would work as you like.
This would be something that falls under the remit of code completion, id expect it a requirement for good code completion to also include incremental search, so hopefully it will be included when the CC is done.
I don't think that it's really needed for that.
Incremental search for one file is easy to implement.
In fact I just created this as plugin (with a really ugly modal dialog at the moment).
It might be a better idea to use a toolbar instead, but that's another thing (and I might work on it the next days).
I'm not sure if incremental search in more then one file is really needed.
I think that's something ThreadSearch-plugin can do better (even if it not searches incremental).
Incremental search for one file is easy to implement.The already implemented "show occurences" feature does just that. It's hard/impossible to implement it properly for all project files though, due to the sheer (im)possible number of files and hits. Imagine a project with 15,000 files.
In fact I just created this as plugin (with a really ugly modal dialog at the moment).
It might be a better idea to use a toolbar instead, but that's another thing (and I might work on it the next days).
I created a plugin that does incremental search from a toolbar.
...
If anybody can test it and give a feedback, I would be glad.
Looks good, though highlighting didn't work for me at all.Might be the same problem taht Mario has (and me with XP on my Laptop as I just found out).
The hint for "Select only" should be changed to "Selected text" to be consistent with the search dialogue. The highlight colour is very decent, so it is not easy to see the highlighting on a laptop screen, perhaps it should be customizable.
rhf : the thread is splitted, please post here: http://forums.codeblocks.org/index.php/topic,9289.0.html (http://forums.codeblocks.org/index.php/topic,9289.0.html).OK. Repeat of previous post: I just updated with SVN 5253 and experimented with Incremental Search. It appears to work properly; however, the toolbar buttons for Prev, Next, etc do not appear. There is just a single large button with no icons. This is on Windows XP.
I tested it on Linux, w2k and winxp sp2, and it works on all platforms.rhf : the thread is splitted, please post here: http://forums.codeblocks.org/index.php/topic,9289.0.html (http://forums.codeblocks.org/index.php/topic,9289.0.html).OK. Repeat of previous post: I just updated with SVN 5253 and experimented with Incremental Search. It appears to work properly; however, the toolbar buttons for Prev, Next, etc do not appear. There is just a single large button with no icons. This is on Windows XP.
Thanks for adding a nice feature.
IncrementalSearch.cpp: In member function 'virtual void IncrementalSearch::BuildMenu(wxMenuBar*)':Though I haven't find the cause yet, I committed already a first part of a fix wrt includes. Don't include pch's in header files. There's more to follow ...
IncrementalSearch.cpp:115: error: 'class wxMenuItem' has no member named 'GetLabelText'
IncrementalSearch.cpp:115: error: 'class wxMenuItem' has no member named 'GetItemLabelText'
make[4]: *** [IncrementalSearch.lo] Error 1
make[4]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins/contrib/IncrementalSearch'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins/contrib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src'
make: *** [all-recursive] Error 1
How did you compile it.I just updated to SVN 5258 and built CodeBlocks.cbp and ContribPlugins.workspace and ran update.bat.
Did you use clean svn-version or did you patch the code manually before.
Maybe a screenshot would be helpful.Well I tried but couldn't figure out how to insert a screenshot. I have attached (I hope) the file ScnShot.jpg which shows the effect.
How did you compile it.I just updated to SVN 5258 and built CodeBlocks.cbp and ContribPlugins.workspace and ran update.bat.
Did you use clean svn-version or did you patch the code manually before.
The icons still do not show in the IncrementalSearch toolbar.
I am using tdm-mingw-1.808.3 which uses gcc 4.3.2. (There could of course be a bug with this compiler.)Maybe a screenshot would be helpful.Well I tried but couldn't figure out how to insert a screenshot. I have attached (I hope) the file ScnShot.jpg which shows the effect.
Even though the toolbar buttons do not show, when I move the mouse over the toolbar the various hints do appear.
Leaving the virtual declaration in the header-files is not an error, even if it is unneded. But if you don't like it, why didn't you remove it from both header-files ?No that's not an error. But I think it is preferred to have people no longer derive from this class, since it is a concrete class. The fact I didn't remove them all, sloppy me :oops:
g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../src/include -I../../../../src/include/wxscintilla/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT IncrementalSearch.lo -MD -MP -MF .deps/IncrementalSearch.Tpo -c IncrementalSearch.cpp -fPIC -DPIC -o .libs/IncrementalSearch.o
IncrementalSearch.cpp: In member function 'virtual void IncrementalSearch::BuildMenu(wxMenuBar*)':
IncrementalSearch.cpp:127: error: 'class wxMenuItem' has no member named 'GetLabelText'
IncrementalSearch.cpp:127: error: 'class wxMenuItem' has no member named 'GetItemLabelText'
make[4]: *** [IncrementalSearch.lo] Error 1
make[4]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins/contrib/IncrementalSearch'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins/contrib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/killerbot/Documents/CodeBlocksDev/trunk/src'
make: *** [all-recursive] Error 1
wx : 2.8.4
#if wxCHECK_VERSION(2,8,5)
if (items[i]->GetLabelText(items[i]->GetItemLabelText()) == _("Find previous"))
#else
if (items[i]->GetLabelFromText(items[i]->GetLabel()) == _("Find previous"))
#endif
Are the images inside "IncrementalSearch.zip" (it should be in "share/CodeBlocks").No, the images are not there.
The images are in the subfolder "images" and "images/16x16" inside the zip-file.
Do you have an image in the "Search -> Incremental Search" MenuItem ? It is in the same zip-file.No. The icon does not show up in the Menu either.
Have you tried to remove the zip from "src/devel/share/CodeBlocks" and "src/output/share/CodeBlocks" before building ?Well I use the standard update.bat file obtained via SVN. The images appear to be unzipped in the two dirs
Are the images inside "IncrementalSearch.zip" (it should be in "share/CodeBlocks").No, the images are not there.
The images are in the subfolder "images" and "images/16x16" inside the zip-file.
wx : 2.8.4
That's the problem "GetLabelText" and "GetItemLabelText" are in wxWidgets since 2.8.5.
I can add a version-guard and use the older functions if wxGtk is too old.
EDIT:
That means you have a more recent version on 32-bit linux, right?
EDIT2:
It would be nice if you could test the following code instead the original one:Code#if wxCHECK_VERSION(2,8,5)
if (items[i]->GetLabelText(items[i]->GetItemLabelText()) == _("Find previous"))
#else
if (items[i]->GetLabelFromText(items[i]->GetLabel()) == _("Find previous"))
#endif
I can't test it, because I do not have wxWidgets 2.8.4 anymore.
I it works I will commit it.
Compile IncrementalSearch with the attached project file. I suspect recursive addition of image file is not working here (this was affecting Linux builds, too). :)That did it! Thanks.
In Linux the problem was, that I only included "images/*.png" (I don't want the conf-dialog images inside the zip-file, because they don't belong there) with "-R"-switch for recursion. That can only find images with path "images/*.png", but not "images/16x16/*.png".Are the images inside "IncrementalSearch.zip" (it should be in "share/CodeBlocks").No, the images are not there.
The images are in the subfolder "images" and "images/16x16" inside the zip-file.
Compile IncrementalSearch with the attached project file. I suspect recursive addition of image file is not working here (this was affecting Linux builds, too). :)
I can test it either, since I have upgraded my wx to 2.8.9 on my 64-bit linux box. And now it builds correctly :-)
@Biplab:
thanks for the fixes to the autoconf-files.
I hopefully will learn how it works some days, but until now I did not find a good readable and easy to understand documentation.
So it's still more or less trial and error.
http://www-src.lip6.fr/homepages/Alexandre.Duret-Lutz/autotools.html
But it might be a problem with different behaviour of different zip-versions. I use "Zip 2.32" from June 19th 2006.Ouch! My zip version was Zip 2.3 dated November 29th 1999! Think I'll upgrade now - sorry to cause you problems.
I commited Incremental search this afternoon.
Thanks. :)I commited Incremental search this afternoon.
I built the last version from SVN with the incremental search plugin yesterday. Thanks! That was really missing!
- there should be a way to exit from incremental search mode using the keyboard, and go back to typing; pressing Esc or the assigned shortcut (Ctrl+I) seems the most intuitive way (now seems that the only way is to press the [x> icon on the toolbar near the search text);That make sonly sense, if both is implemented.
- search options for incremental search could have their shortcut, active during incremental search (VS does i.e. ctrl-c for case sense);
- the searched text should be selected when exiting from incremental search (as in the case of normal search);If the first will be implemented, this would be easy (but should be configurable)
Maybe this can also be implemented inside the plugin.
Now, given I'm a VS6 guy, there's another search feature I'm missing. It's not related to incremental search but I'm reporting it here... it's the Ctrl-F3 shortcut, which starts searching for the word under the cursor - if no text is selected, otherwise it searches for the selected text. That's very quick, no search dialog is shown, you just jump to the next result. Whooa! (and yes, Shift-Ctrl-F3 does it backward). Anyone else liking it out there?
- there should be a way to exit from incremental search mode using the keyboard, and go back to typing; pressing Esc or the assigned shortcut (Ctrl+I) seems the most intuitive way (now seems that the only way is to press the [x> icon on the toolbar near the search text);
- there should be a way to exit from incremental search mode using the keyboard, and go back to typing; pressing Esc or the assigned shortcut (Ctrl+I) seems the most intuitive way (now seems that the only way is to press the [x> icon on the toolbar near the search text);
I've already implemented this feature. I prefer Escape Key. I'll commit it later. :)
So I can reuse some keyword by myself.. That's all !
But ThreadSearch is too professionalJust right click on a word and click on "Find occurrences"; not too complicated isn't it ? :wink: