User forums > General (but related to Code::Blocks)

Code Folding

(1/3) > >>

Knx:

--- Code: ---        //(*Identifiers(tFrame)
        static const long ID_BUTTON1;
        static const long ID_PANEL1;
        static const long ID_TEXTCTRL1;
        static const long ID_PANEL2;
        static const long ID_NOTEBOOK1;
        static const long idMenuQuit;
        static const long idMenuAbout;
        static const long ID_STATUSBAR1;
        //*)

        //(*Declarations(tFrame)
        wxNotebook* Notebook1;
        wxButton* Button1;
        wxPanel* Panel1;
        wxStatusBar* StatusBar1;
        wxTextCtrl* TextCtrl1;
        wxPanel* Panel2;
        //*)
--- End code ---

Since C::B generates the code like this for wxWidgets, why not to create a fold option for "//(*" "//*)", code between this could be folded.
In NetBeans(Java) you can fold code putting

--- Code: ---// <editor-fold defaultstate="collapsed" desc=" Variables declaration "> 
code here
// </editor-fold>

--- End code ---
And when collapsed you see a white box with " Variables declaration "

mariocup:
Hi Knx,

you can add folding point in CB using (http://codeblocks.org/docs/main_codeblocks_ench1.html#x2-10001)

--- Code: ---//{

//}

--- End code ---

Bye,

mario

MortenMacFly:

--- Quote from: Knx on November 20, 2007, 10:53:54 am ---
--- Code: ---// <editor-fold defaultstate="collapsed" desc=" Variables declaration "> 
code here
// </editor-fold>

--- End code ---
And when collapsed you see a white box with " Variables declaration "

--- End quote ---


--- Quote from: mariocup on November 20, 2007, 01:08:42 pm ---you can add folding point in CB using (http://codeblocks.org/docs/main_codeblocks_ench1.html#x2-10001)

--- Code: ---//{

//}

--- End code ---

--- End quote ---

The combination of both - having wxSmith to add these automatically (but maybe optionally) would be a very good feature request for Byo! You might want to file such at BerliOS.

With regards, Morten.

byo:
Switching to //{ scheme may be little bit problematic now since it may introduce problems on how to deal with two types of comments. Besides it looks like the //{ folding does not work now (at least on my Ubuntu box).

So probably the easiest way to allow folding wxSmith code is to modify current algorithm generating folding blocks but I don't know much about it and how it could be changed.

The wxSmith-generated code could also be threated especially in lexer so it would be coloured differently to separate that code from other parts. I've done this before but it required patching wxScintilla so maybe better solution should be introduced first ;)

Regards
   BYO

MortenMacFly:

--- Quote from: byo on November 20, 2007, 11:25:42 pm ---Switching to //{ scheme may be little bit problematic now since it may introduce problems on how to deal with two types of comments.

--- End quote ---
I'm afraid I don't get it completely. I didn't mean to switch, but having this in addition around wxSmith code and current comments. So you can keep the wxSmith comment style untouched. But you are also talking about "two types of comments"...?! Mind explaining again for a stupe like me...?! ;-)

Navigation

[0] Message Index

[#] Next page

Go to full version