News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Make member function

Started by noisy, June 04, 2007, 10:17:42 AM

Previous topic - Next topic

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:

void testFunc (char *test);

creates in the source file:

void testFunc (char *test)
{
}


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.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Pecan

#2
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 :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

wxLearner

Quote from: mispunt on June 04, 2007, 02:44:07 PMI though: 1 click and all the methods of a class are created :)
It's already possible, but actually it needs more than 1 click: right click, select "Insert => All class methods without implementation...".

David Perfors

 :shock: how could I miss that option? incredible!
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

killerbot

Quote from: mispunt on June 04, 2007, 07:49:33 PM
:shock: how could I miss that option? incredible!

cool, didn't know that one either

MortenMacFly

#7
Quote from: killerbot on June 04, 2007, 07:55:01 PM
Quote from: mispunt on June 04, 2007, 07:49:33 PM
:shock: how could I miss that option? incredible!
cool, didn't know that one either
Me not, too... have to check SVN blame who actually was that hero... ;-) :lol:

Edit: I knew it... ;-)

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]