Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Collapsible Code Blocks

(1/2) > >>

basurapr:
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.

MortenMacFly:

--- Quote from: basurapr on March 04, 2007, 06:54:45 pm ---#region Constructors and Destructors
//Code Here..
#endregion

--- End quote ---
You can do this pretty easy using #ifndefs like:

--- Code: ---#ifndef REGION_LIVE_CYCLE
// Constructurs, Destructors...
#endif // REGION_LIVE_CYCLE

--- End code ---
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.

eranif:

--- 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

--- End quote ---
You can do this pretty easy using #ifndefs like:

--- Code: ---#ifndef REGION_LIVE_CYCLE
// Constructurs, Destructors...
#endif // REGION_LIVE_CYCLE

--- End code ---
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.

--- End quote ---
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


jmccay:

--- 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

--- End quote ---

   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

basurapr:
Hurray!,

Thanks guys, now i have a more searchable source code. Is nice to know that scintilla facilitate this task. :D

thanks a lot  :)

Navigation

[0] Message Index

[#] Next page

Go to full version