Forum: wxRuby Is there anyway to enable MultiSelect in the StyledTextCtrl

Posted by John Baker (fatdogs12)
on 2010-01-24 00:00
I've noticed that the StyledTextControl (Scintilla basically) in
wxWidgets has a great feature that allows multi-selections of text, just
like TextMate. However wxRuby seems to have the function calls to
support that feature. I'm wonder if there is a way to enable it or if
there might be a way I could rewrite that wrapper to include that
function.

It seems strange that they would purposely omit that since they are
seemingly pretty exhaustive on most functions calls. Any insight on this
would be greatly appreciated. I'm trying to write an open source
TextMate clone in Ruby and it's gonna be pretty hard without
MultiSelect, I could probably hack something together but it'd be ugly.
Thanks ahead of time.
Posted by Alpha Blue (elricstorm)
on 2010-01-24 17:30
Hi John,

Again, I managed to find this information out only because I downloaded 
the entire source file and scoured the events section of that file.  It 
appears that events are separated for only two sections and that's 
StyledTextCtrl (Scintilla) and MediaCtrl events with prefix EVT_MEDIA.

You can find the Scintilla events here:

http://rubyhelp.org/docs/wxruby/styledtextctrl.html

I found out this information because inside of the source files, there's 
a wx/classes/evthandler.rb file that contains all of the events around 
lines 168 - 1000.  At the top of this event start lines were the 
following comments:

  # All StyledTextCtrl (Scintilla) events with prefix EVT_STC are dealt
  # with in the separate styledtextctrl.rb file.
  #
  # All MediaCtrl events with prefix EVT_MEDIA are dealt with in the
  # separate mediactrl.rb file

So, the events were housed in:

evthandler.rb (standard events)
styledtextctrl.rb (Scintilla events)
mediactrl.rb (Media Control events)

Read my response to your previous thread about events to see where all 
of the events are located on the docs site of rubyforge.

Take care mate.



Posted by John Baker (fatdogs12)
on 2010-01-24 18:23
Again I appreciate you taking the time, however the Scintilla itself 
actually has a method which supports multiSelection where as 
StyledTextCtrl does not. That's unfortunate, but I was hoping to see if 
there was a way to extend it myself.
Posted by Alex Fenton (Guest)
on 2010-01-25 16:43
(Received via mailing list)
hi

John Baker wrote:
> I've noticed that the StyledTextControl (Scintilla basically) in
> wxWidgets has a great feature that allows multi-selections of text, just
> like TextMate. However wxRuby seems to have the function calls to
> support that feature. I'm wonder if there is a way to enable it or if
> there might be a way I could rewrite that wrapper to include that
> function.
>   

On the scintilla site (http://www.scintilla.org/index.html) it seems
that multi-selection was only added in Scintilla v2.0, but the wxWidgest
2.8 series is based on Scintilla versions around 1.71. So unfortunately
this feature isn't available in C++ wxWidgets - it's not that it's
omitted in Ruby.

It may be that the SVN version of wxWidgets 3.0 supports Scintilla 2.x -
did you see a reference to that?

alex
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.