There is a contribution called ''stc'' (StyledTextControl) that comes with wxWidgets. It appears that this is -also- a wrapper around Scintilla. I can''t tell if one or the other of these two is a better choice or if there''s a particular reason to favor one over the other. I can see that having the source available right there in the contrib directory would make things a lot easier. I will investigate stc some more to see what''s what with it. Roy
The two appear pretty similar on the outside. The main differences are: 1) wxScintilla appears to be actively maintained and is on the current version of Scintilla (1.65 vs. stc''s 1.62) 2) wxScintilla has a nice, SWIG-friendly .H file 3) stc is included with wxWindows, wxScintilla is not. My preference, at this point, is to go with wxScintilla. Given that both are optional components and the implementation difficulty of one is much higher than the other I don''t see that it''s a bad choice. If someone wants to weigh in on this with some other ideas though, I''m all ears. Here''s the link to wxScintilla''s download page: https://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182 It''s part of wxCode: http://wxcode.sourceforge.net/ Roy Roy Sutton wrote:> There is a contribution called ''stc'' (StyledTextControl) that comes with > wxWidgets. It appears that this is -also- a wrapper around Scintilla. > I can''t tell if one or the other of these two is a better choice or if > there''s a particular reason to favor one over the other. I can see that > having the source available right there in the contrib directory would > make things a lot easier. > > I will investigate stc some more to see what''s what with it. > > Roy
Roy Sutton wrote:> I was fiddling around with wxScintilla tonight and I added it to wxRuby.Very cool.> I haven''t gotten it really nicely integrated since I wanted to > make it an optional component.Based on my limited understanding, I think it must be optional.> I may fiddle with this some more if you guys think it would> be worth adding to wxRuby2. Traditionally, it has been a popular wxruby request. And I believe it would be necessary for freeride to even consider switching to wxruby. I think someone created wxScintilla support for wxruby 0.6, but I''m not sure.> The two appear pretty similar on the outside. The main differences are: > > 1) wxScintilla appears to be actively maintained and is on the current > version of Scintilla (1.65 vs. stc''s 1.62)That sounds like a fairly strong reason to prefer wxScintilla.> 2) wxScintilla has a nice, SWIG-friendly .H fileLikewise.> 3) stc is included with wxWindows, wxScintilla is not.Oh. Hmm. See below.> My preference, at this point, is to go with wxScintilla. Given that > both are optional components and the implementation difficulty of one is > much higher than the other I don''t see that it''s a bad choice. If > someone wants to weigh in on this with some other ideas though, I''m all > ears.Could you describe the actual process that would need to happen to support either of them? Would this be a wxruby-compile-time choice? Would we always build the wxruby parts but they might or might not work depending on whether the wxScintilla library existed? Or would it be an entirely separate ruby-require library? Then, when I understand the basics, could you describe any differences in that process depending on which of the two approaches we took? Thanks, Kevin
The way I implemented it so far is to require you to set an environment variable pointing to the wxScintilla install directory. If this environment variable is set, the rake files include the appropriate lib and include file. It also sets a define WXSCINTILLA that I have used to #ifdef some code to support the library. If you don''t set this then it will ignore Scintilla. The way I have it right now it''s still not quite 100%. I need to remove the Scintilla.i file from classes and have it parsed from elsewhere so it doesn''t get automatically included. Aside from that, it''s ready to go, AFAIK. Since my earlier post I hooked up all the events and the ScintillaEvent type and made an example editor that really doesn''t do much useful except show off a few things. Roy Kevin Smith wrote:> Could you describe the actual process that would need to happen to > support either of them? Would this be a wxruby-compile-time choice? > Would we always build the wxruby parts but they might or might not work > depending on whether the wxScintilla library existed? Or would it be an > entirely separate ruby-require library? > > Then, when I understand the basics, could you describe any differences > in that process depending on which of the two approaches we took? >
Roy Sutton wrote:> The way I implemented it so far is to require you to set an environment > variable pointing to the wxScintilla install directory. If this > environment variable is set, the rake files include the appropriate lib > and include file. It also sets a define WXSCINTILLA that I have used to > #ifdef some code to support the library. If you don''t set this then it > will ignore Scintilla. The way I have it right now it''s still not quite > 100%. I need to remove the Scintilla.i file from classes and have it > parsed from elsewhere so it doesn''t get automatically included. Aside > from that, it''s ready to go, AFAIK.Hm. Ok. I think the easiest thing for Scintilla.i would be to just have conditionals (%if or #if?) in it such that effectively becomes empty if scintilla isn''t wanted. I think an empty .i file is harmless. It sure would be nice if we could make it a run-time option instead of compile-time. If that''s really not possible, then would we have two binary wxruby releases on each platform, one with it and one without? Or maybe wxRubyScintilla should be its own separate project, or at least its own separate dll/so target. That way, if you require it, it would link in happily, but if you don''t, it would not require the underlying wxScintilla library to be present.> Since my earlier post I hooked up all the events and the ScintillaEvent > type and made an example editor that really doesn''t do much useful > except show off a few things.Cool. Kevin
Hmm. I''ll have to look into %if to see if it''ll do right. A run-time option? If it''s built into the library there''s no need to turn it on or off. For binary distributions I''d say always include it. For compiling it yourself you''d need to either download the additional file (or we include it with the src if we can?) or else you get a version without wxScintilla. My concern over making it a separate project is just making sure the resultant library doesn''t duplicate wx code from wxRuby and that it will work properly, accessing the required wx libraries when combined through Ruby. If anyone wants to play around with it I can zip up everything and drop it to the list later. I''m curious to see how it works on Mac, since Scintilla itself apparently doesn''t work on Mac, if you believe the Scintilla Web site. Roy Kevin Smith wrote:> Hm. Ok. > > I think the easiest thing for Scintilla.i would be to just have > conditionals (%if or #if?) in it such that effectively becomes empty if > scintilla isn''t wanted. I think an empty .i file is harmless. > > It sure would be nice if we could make it a run-time option instead of > compile-time. If that''s really not possible, then would we have two > binary wxruby releases on each platform, one with it and one without? > > Or maybe wxRubyScintilla should be its own separate project, or at least > its own separate dll/so target. That way, if you require it, it would > link in happily, but if you don''t, it would not require the underlying > wxScintilla library to be present.