In another post I read the suggestion for a plug-in that would allow to comment/uncomment a selected block of code lines.
The editor has a similar funcitonality already. Try selecting a block and press
Ctrl-Shift-C /
Ctrl-Shift-X. Is that what you want? Or do you mean "block comment" in the sense of
/* ... */ ?
My current knowledge concerned in this matter :
- CodeBlocks SDK : very very little
- wxWidgets : none
The first point is no problem at all, just look at the sdk headers. Big compliment to Yiannis - most everything can be figured from the sdk headers without actually knowing anything.
As far as plugins are concerned, there is a WiKi on how to build a plugin, or you can just look at an existing plugin (choose an easy one, such as class wizard, for example).
The second point is a
huge problem. Without understanding wxWidgets (in particular event handling), you will get nowhere. And it is not very intuitive, either (I think).
Bookmark this:
http://www.wxwidgets.org/manuals/2.6.2/wx_contents.html -- you will need it a lot. And make sure you read "Topic overviews", in particular the one regarding event handling, before starting anything.
- right click on the selection
This is a nasty one, I am just trying to get this to work, too. The problem is that you cannot just set an event table entry for a right button down event and hope for the best, because the event is not propagated. The obvious solution is to use PushEventHandler. Only one problem... it does not work properly. wxWidgets processes some events fine, but loses some others when I do that, even if my event handler immediately calls the original handler without changing one bit. If you come up with something that works, I would be very interested.
- a menu entry in the ?edit? menu
- shortcut acceleration
it is obvious that for this subtask we need to be able to adjust the menus of CB, so
Question 1 : what are the correct ways to accomplish this ?
For the first one, look at
codecompletion.cpp, line 137, the second one is trivial (done in the same line).
The way it is done in
codecompletion.cpp is the correct way to do it (you are sent an event and get the chance to modify the menu before it opens).