Author Topic: Class Plugin  (Read 3844 times)

Skaldi

  • Guest
Class Plugin
« on: March 31, 2009, 07:24:55 pm »
Dear all!

I am using Code::Blocks for quite some time (about a year).
I started with the official release 8.02 and just downloaded the nightly buld from the 28. of March.

And I  have to say that you really did a very good job, and i like all the changes.

Espacially i like the feature of importing "Visual Studio" project files, this made the changeover a child's play :).
But this is nothing new

Okay enough bootlicking for now ;), let's come to my questions:

1.) Class plugin
In my project i am using a folder structure (named like the namespaces) where i put my header and source files.
Let's take the class "mesh" for example.

The header file is saved this way "/include/graphic/mesh/mesh.h"
and the source file here "/src/graphic/mesh/mesh.cpp",
where the folder "include" is added to the search directory of the compiler.

Now when i am creating a new class and put my header file in such a folder,
do I have the possibility that the header include file for the source file is automatically
"generated" to the relative path of the header file (considering the searchdirectories)?
Let's take my mesh.cpp again, then the include path to the header file would be "graphic/mesh/mesh.h".
Until now i always do this manually after having added the class. (It is quite more comfortable to edit this in the editor, than in the small textbox of the class wizard).

2.)Code completion
It made much progress in the nightly I downloaded just an hour ago.
It really works great when i am using an instance of a class for example.
But when I am "in" a member function of a class the code completion won't work.
Let's take my class "Mesh" again and the member function "draw"
Code
void Mesh::Draw() const
{
//Pressing ctrl + spacebar the only message is that too many results are found and no class members

this-> //Nothing will be listet here too
}

Not that it is really a problem for me, but would be so nice seeing this working.
I can imagine that this is not something easy to implement, c++ is not a very parsing friendly language.


All in all I have to admit, that Code::Blocks is the best IDE for C++ i have ever seen.
It is small, it is fast, it is crossplatform and it supports tons of compilers with the possibilty of setting compiler switches.

Keep up the good work.

Best regards.
Skaldi

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Class Plugin
« Reply #1 on: April 01, 2009, 04:44:07 am »
1.) Class plugin
The header file is saved this way "/include/graphic/mesh/mesh.h"
and the source file here "/src/graphic/mesh/mesh.cpp",

where the folder "include" is added to the search directory of the compiler.

Now when i am creating a new class and put my header file in such a folder,
do I have the possibility that the header include file for the source file is automatically
"generated" to the relative path of the header file (considering the searchdirectories)?
Let's take my mesh.cpp again, then the include path to the header file would be "graphic/mesh/mesh.h".
Until now i always do this manually after having added the class. (It is quite more comfortable to edit this in the editor, than in the small textbox of the class wizard).

If I understand you. You meant when you are editing mesh.cpp, then you want C::B try to locate the mesh.h and entered in the #include statement.

That is in mesh.cpp
Code
#include  // "graphic/mesh/mesh.h" will be automatically listed of call tips


right?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Skaldi

  • Guest
Re: Class Plugin
« Reply #2 on: April 01, 2009, 10:28:12 am »
Hello, and thanks for the reply

I ment that the class wizard takes care of the path to the include path autmatically by comparing the path of the headerfile with the include directories setup for the compiler.
So when my header file is anywhere in folderstructure that it could generate the right path for me.
For my example again: mesh.cpp.

The path to the headerfile is: "include/graphic/mesh/mesh.h".
Would be great if the class wizard could compare this path with the searchdirectories for the compiler, which is "include" in my case.
So the path generated by the wizard would be "graphic/mesh/mesh.h".

Would be a cool feature.

Best Regards
Skaldi