Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: eraser on May 21, 2010, 05:42:49 am

Title: Help - Add pre-defined function/file description by shortcut key
Post by: eraser on May 21, 2010, 05:42:49 am
I need this feature in Code::Blocks edit environment. It maybe like this:

   // File Name: Current file.cc
   // Description: [blank]
   
   #include .....
   ...
   
   // Function Name: myFun
   // Description: [blank]
   // input1: int
   // input2: char
   // output: void
   void myFun(int input1, char input2) {
   ...
   }

I hope the BLUE part, which style is defined in advance and can acquire the FILENAME and function declaration, is inserted automatically by a shortcut key. Does anyone has a solution?  A similar implementation can also be accepted. Thanks.
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: ollydbg on May 21, 2010, 07:13:38 am
Quote
I hope the BLUE part, which style is defined in advance and can acquire the FILENAME and function declaration, is inserted automatically by a shortcut key.

Ha, this function should be implemented in CodeCompletion plugin. Because the CC can understand where your current caret is. This is the same feature as the CC's ToolBar( in Which, when you caret moved, the Toolbar information get updated too).

It can be regard as a "feature request".  :D
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: eraser on May 21, 2010, 10:44:29 am
I took a look at the configuration of CodeCompletion plugin in "Settings"->"Editor"->"Code-completion and symbols browser". I couldn't find the appropriate options. So, can you teach me hand by hand how to realize this feature? Thank you very much.
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: ollydbg on May 21, 2010, 11:02:26 am
can you teach me hand by hand how to realize this feature? Thank you very much.
Well, If you want to implement this function, you should dig into the source code of "CodeCompletion plugin", this is the only way if you want to implement this function. If you really want to do that, I can give more advice.
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: Jenna on May 21, 2010, 11:17:12 am
The second can be done with the DoxyBlocks-plugin : http://forums.codeblocks.org/index.php/topic,12052.msg85232.html#msg85232 (http://forums.codeblocks.org/index.php/topic,12052.msg85232.html#msg85232),
the first is not implemented (as far as I know), but should not be too hard to do.
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: eraser on May 22, 2010, 02:26:57 am
I'm a freash man, and just start to learn C++ days before.  I tried Doxygen plugin last night and couldn't make it work. l'm willing to do something on CC. I can learn more and effectively. So please help me!
Title: Re: Help - Add pre-defined function/file description by shortcut key
Post by: ollydbg on May 22, 2010, 04:10:20 am
I'm a freash man, and just start to learn C++ days before.  I tried Doxygen plugin last night and couldn't make it work. l'm willing to do something on CC. I can learn more and effectively. So please help me!
AHa, CC has a sub forum, see CodeCompletion redesign (http://forums.codeblocks.org/index.php/board,18.0.html)

Also, there are some wiki page like :Code Completion Design (http://wiki.codeblocks.org/index.php?title=Code_Completion_Design) and Code::Completion Rewriteand (http://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite)

Also, you should read the source of the code completion plugin. (learn how to build codeblocks first, some wiki pages will tell you the steps, for Windows, see Installing Code::Blocks from source on Windows (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows))