User forums > Using Code::Blocks
Make member function
noisy:
Hi!
I just switched to CodeBlocks from KDevelop and I have to say looks really great by now :)
But there is function I miss, don't know wheter I just didn't find it, or it isn't included.
In KDevelop I just select the declaration of a function, press F2 and then the member in the source file is auto-generated.
Pressing F2 when selected in the header:
--- Code: ---void testFunc (char *test);
--- End code ---
creates in the source file:
--- Code: ---void testFunc (char *test)
{
}
--- End code ---
So could you please tell me, whether I just didn't find this really useful function, or is it not supported by CodeBlocks.
If so it would make me very happy, if someone could add this feature :D
David Perfors:
This is not supported by Code::Blocks, though it would be very usefull and I think it is possible to implement this in a simple plugin.
Pecan:
You can write a plugin to do that, or use KeyMacs (see the wiki index) with the following key macro definition
define Ctrl-F2 in KeyMacs as:
{home}+{end}^C{F11}^{end}^v{enter}{{}{enter}{}}{enter}
Place the cursor on the header declaration of the function and hit Ctrl-F2.
This Macro does the following
{home} - go to beginning of line
+{end} - mark selection to end of line
^C - copy marked
{F11} - switch to source definitions
^{end} - go to bottom of file
^v - paste previously copied declaration
{enter} - next line
{{} - enter a {
{enter} - next line
{}} - enter a }
{enter} - next line
David Perfors:
wow, that is even easier :) But I must admit that I didn't read good enough. I though: 1 click and all the methods of a class are created :)
wxLearner:
--- Quote from: mispunt on June 04, 2007, 02:44:07 pm ---I though: 1 click and all the methods of a class are created :)
--- End quote ---
It's already possible, but actually it needs more than 1 click: right click, select "Insert => All class methods without implementation...".
Navigation
[0] Message Index
[#] Next page
Go to full version