It will be a nice feature in the codeblocks editor to have collapsible blocks of code, like in visual studio or sharpdevelop.
For example:
#region Constructors and Destructors
//Code Here..
#endregion
#region Events
//Bunch of events..
#endregion
#region Layout
//Really long code..
#endregion
We will have a better organized code in terms of viewing, searching and editing. I don't know if the feature is already available, but I will like to help in it. if some one can point me to the right direction I will be glad of it.
Quote from: basurapr on March 04, 2007, 06:54:45 PM
#region Constructors and Destructors
//Code Here..
#endregion
You can do this pretty easy using
#ifndefs like:
#ifndef REGION_LIVE_CYCLE
// Constructurs, Destructors...
#endif // REGION_LIVE_CYCLE
As long as you don't define "
REGION_LIVE_CYCLE" (why would you?!) the code compiles fine but yu can collapse those regions easily.
For this purpose make sure you have enabled Settings->Editor->"Folding"->"Fold pre-processor commands".
With regards, Morten.
Quote from: MortenMacFly on March 04, 2007, 09:59:10 PM
Quote from: basurapr on March 04, 2007, 06:54:45 PM
#region Constructors and Destructors
//Code Here..
#endregion
You can do this pretty easy using #ifndefs like:
#ifndef REGION_LIVE_CYCLE
// Constructurs, Destructors...
#endif // REGION_LIVE_CYCLE
As long as you don't define "REGION_LIVE_CYCLE" (why would you?!) the code compiles fine but yu can collapse those regions easily.
For this purpose make sure you have enabled Settings->Editor->"Folding"->"Fold pre-processor commands".
With regards, Morten.
Well, you could do it like Morten suggested, but there is a better way of doing it:
Scintilla (CodeBlocks editing component) offers users an easy way for inserting fold points in the code using the following symbols:
//{ -- as a block starter
//} -- as a block ender
HTH
Eran
Quote from: eranif on March 04, 2007, 11:43:30 PM
Well, you could do it like Morten suggested, but there is a better way of doing it:
Scintilla (CodeBlocks editing component) offers users an easy way for inserting fold points in the code using the following symbols:
//{ -- as a block starter
//} -- as a block ender
HTH
Eran
I took the liberty of adding this to the wiki documentation: Wiki->Documentation->User Documentation->Miscellaneous. I thought it would be handy to know.
jmccay
Hurray!,
Thanks guys, now i have a more searchable source code. Is nice to know that scintilla facilitate this task. :D
thanks a lot :)
Quote from: eranif on March 04, 2007, 11:43:30 PM
//{ -- as a block starter
//} -- as a block ender
Wow! That's fantastic (I honestly didn't know about that :oops:). Thanks Eranif!!! :D
With regards, Morten.