Lyle,

I've implemented the whole Scintilla API and only require the SendMessage
function ;-)  There are still some issues to work out, but most of it works
good.

I used SWin/VRuby (using windows SendMessage) but it should be trivial to
port over to FXRuby.  The only other thing needed is a way to get events
from the Scintilla component.

I'm contributing that code to the FreeRIDE project, and this is coming at a
great time.

Email me directly and we can work on this. (mailto:rich / infoether.com)

-Rich

> -----Original Message-----
> From: Lyle Johnson [mailto:ljohnson / resgen.com]
> Sent: Thursday, January 03, 2002 1:11 PM
> To: ruby-talk ML; undisclosed-recipients:
> Subject: [ruby-talk:30147] Progress: Ruby binding for Scintilla &
> FXScintilla
>
>
> Over the past month or so several people have expressed an interest in FOX
> and FXRuby support for the Scintilla (http://www.scintilla.org)
> source code
> editing component. With the recent progress on the FreeRIDE project
> (http://www.rubyide.org/cgi-bin/wiki.pl?HomePage) this has become a more
> pressing issue, since FOX's FXText widget doesn't support styled text or
> some of the other features desirable in a source code editing component.
>
> Gilles Filippini has been working on a FOX "port" of Scintilla
> and SciTE and
> has produced several beta releases of his code; the latest beta
> is currently
> available for download at:
>
>     http://pini.free.fr/scite141fox4.tgz
>
> Yesterday, after a long holiday break, I started looking at Gilles' code,
> and how to incorporate a binding for the FXScintilla code into FXRuby. It
> looks like Gilles has taken the sensible approach of making his
> FXScintilla
> widget a very lightweight wrapper around the Scintilla component.
> Outside of
> the C++ class constructor and destructor, the only two significant member
> functions are:
>
>     void setScintillaID(int id);
>
> and
>
>     sptr_t sendMessage(unsigned int iMsg, uptr_t wParam, sptr_t lParam);
>
> The second one is the one I want to focus on for now. The gist of
> it is that
> to do anything with the Scintilla component you're going to send it a
> message, where each message has a unique integer identifier (the first
> argument to sendMessage) as well as some associated message data
> (the wParam
> and lParam arguments). This is of course very similar the approach used by
> MFC, FOX and several other GUI toolkits, so no surprises there.
> But to make
> the FXScintilla widget useful under Ruby, that means someone needs to
> furthermore come up with a Ruby module that exposes all of the Scintilla
> message identifiers, constants and whatever else comes along for the ride,
> so that you could then do things like:
>
>     scintillaWidget = FXScintilla.new(p, nil, 0,
> LAYOUT_FILL_X|LAYOUT_FILL_Y)
>     scintillaWidget.sendMessage(SCI_ZOOMIN, 0, 0)
>
> So before I start looking at that -- and I'm starting at zero here, with
> basically no experience with programming against Scintilla's API -- is
> anyone else already working on something similar? Or does anyone want to
> volunteer?
>
> Lyle
>
>
>