Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: nestumkiller on April 22, 2006, 05:20:54 pm

Title: Configure Class Wizard
Post by: nestumkiller on April 22, 2006, 05:20:54 pm
Hi guys!

I'm new using Code::Blocks, so here it goes: is there any possible way of configuring the Class Wizard Plugin? In a way that I can choose how the code will be produced, regarding class comments (authoring, etc..) - sort of like Eclipse does.
Thanks in advance.
Title: Re: Configure Class Wizard
Post by: thomas on April 22, 2006, 06:06:03 pm
Short answer:
No.

Slightly longer answer:
The above is a bold statement, since I don't know what the Eclipse class wizard does at all. :lol:

Long answer:
The code creation is hardcoded into the plugin, but you can of course modify the code. You find the code in question inside plugins\classwizard\classwizarddlg.cpp.
This is not precisely "configuring", but hey, it'll do what you want ;)
Title: Re: Configure Class Wizard
Post by: nestumkiller on April 22, 2006, 07:01:40 pm
Please forgive my ignorance, but after chaging the cpp, should I run the update.bat? Is there any quick way of "updating" it?
BTW, if I have time (I would try it at most), I'll try to adapt the Class Wizard to use an external file -XML - or something similar to be more flexible.
Regarding Eclipse, it uses a kind of variables system, in which you can specify your format. I was used to use it with Java, and for example, a new Class would have the following structure:

${filecomment}
${package_declaration}

${typecomment}
${type_declaration}



From the Eclipse help it says: "The 'New Java files' template is used by the New Type wizards when a new Java file is created. The template can specify where comments are added. Note that the template can contain the variable ${typecomment} that will be substituted by the evaluation of the type comment template."

Here is the link, in case you might wanna see it: http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-preferences-templates.htm (http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/ref-preferences-templates.htm)
Title: Re: Configure Class Wizard
Post by: thomas on April 22, 2006, 07:34:28 pm
Thanks for the link :)

Running update.bat is necessary if you:
a) built a specific source tree for the first time
b) made any modifications to XRCs, icons, images or whatever other "meta" files
c) want to use the stripped binaries from the "output" directory

If you use the binaries from the "devel" directory (as I always do), you can skip update.bat in most cases. However, it never hurts to run it, and it only takes like 5 seconds, too :)