# Is there anyway to enable MultiSelect in the StyledTextCtrl

**URL:** <https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171>\
**Category:** wxRuby\
**Created:** [January 24, 2010, 12:00am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171 "2010-01-24T00:00:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [January 24, 2010, 12:00am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171/1 "2010-01-24T00:00:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [January 24, 2010, 5:30pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171/2 "2010-01-24T17:30:23Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [January 24, 2010, 6:23pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171/3 "2010-01-24T18:23:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [January 25, 2010, 4:43pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-enable-multiselect-in-the-styledtextctrl/182171/4 "2010-01-25T16:43:16Z")

</div>

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 ([Scintilla and SciTE](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
