Author Topic: Customize Folding  (Read 4271 times)

greensoap

  • Guest
Customize Folding
« on: August 08, 2007, 01:30:13 am »
I prefer when folding shows the ending brace, opposed to the way Code::Blocks hides the ending brace. Can anyone point me in the right direction so that I can modify the code for my own preference.

I tried following the logic in the code, but honestly got pretty confused...

Thanks, Jon

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Customize Folding
« Reply #1 on: August 08, 2007, 04:47:02 am »
I agree that it looks a little odd without the closing brace

SetFoldFlag(flag) method of wxscintilla might do the job you need. the flags are:

Code
#define wxSCI_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
#define wxSCI_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
#define wxSCI_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
#define wxSCI_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
#define wxSCI_FOLDFLAG_LEVELNUMBERS 0x0040
#define wxSCI_FOLDFLAG_BOX 0x0001

I haven't tested to see if any of these actually will do what you need

a lot of the editor custom config is done around line 940 of cbeditor.cpp


Offline jazzer

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Customize Folding
« Reply #2 on: August 21, 2007, 03:46:25 am »
Is it possible to setup Scintilla to fold like MSVC8 does?
It removes both opening and closing brackets, converting something like
Code
if ()
{
  // code nere
}
to
Code
if () [...]
where [...] is clickable (click does expanding)

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Customize Folding
« Reply #3 on: August 21, 2007, 08:02:15 am »
Pretty much like this.