[fxruby-users] Folding in Scintilla

Gérard Ménochet gerard.menochet at wanadoo.fr
Sat Oct 21 05:40:53 EDT 2006


Hi,

I'm trying to figure out how to use the folding feature in scintilla. I'd
take the example from the
scintilla documentation and that doesn't work. Everything is ok except the
folding (nothing displayed)
#~ #   Fox version: 1.6.0 - win2000

here is the code

 MARKERNUMBER_2 = 2
 MARGIN_SCRIPT_FOLD_INDEX = 2
 WINDOW_ID = 900
....
  # Folder
   self.setMarginTypeN( MARGIN_SCRIPT_FOLD_INDEX , SC_MARGIN_SYMBOL )
  self.setMarginMaskN( MARGIN_SCRIPT_FOLD_INDEX , SC_MASK_FOLDERS )
  self.setMarginWidthN( MARGIN_SCRIPT_FOLD_INDEX , 16 )

  self.setLexer(SCLEX_RUBY)
  self.setStyleBits(4)

  self.setProperty( "fold", "1" )
  self.setProperty( "fold.compact", "1" )

  self.setMarginSensitiveN(MARGIN_SCRIPT_FOLD_INDEX , true )

  self.markerDefine( SC_MARKNUM_FOLDEROPEN, SC_MARK_SMALLRECT)
  self.markerDefine( SC_MARKNUM_FOLDER, SC_MARK_PLUS )
  self.markerDefine( SC_MARKNUM_FOLDERSUB, SC_MARK_EMPTY )
  self.markerDefine( SC_MARKNUM_FOLDERTAIL, SC_MARK_EMPTY )
  self.markerDefine( SC_MARKNUM_FOLDEREND, SC_MARK_EMPTY )
  self.markerDefine( SC_MARKNUM_FOLDEROPENMID, SC_MARK_EMPTY )
  self.markerDefine( SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_EMPTY )

  self.setFoldFlags(16)

Maybe the problem comes from SCN_MARGINCLICK and/or SCN_NEEDSHOWN. I haven't
implemented the following instructions from the scintilla example:

Register the "on margin click" event for the window (this is windows
specific)
BEGIN_MESSAGE_MAP(CDocumentWindow, CDocumentWindowsBaseClass)
  ON_NOTIFY(SCN_MARGINCLICK, WINDOW_ID, OnMarginClicked)
END_MESSAGE_MAP()

I wonder how to do that with FXRuby.
Could someone tell me a hint or a solution ?

Thanks

Gérard Ménochet

PS:  I think this version doesn't really like the use of "SEL_CHANGED"  on
FXScintilla:
abnormal program termination
C:/Program
Files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.0-mswin32/lib/fox16/scintilla.r
b:25: [BUG] Segmentation fault
ruby 1.8.4 (2006-04-14) [i386-mswin32]



More information about the fxruby-users mailing list