Hi, I''m porting a QtRuby (4.1) app over to FxRuby cause I need the cross-platform compatibility and was wondering if there was a Rubberband (http://doc.trolltech.com/4.1/qrubberband.html) type class for Fox or if I will have to roll my own. Thanks, Steven Davidovitz
On Friday 13 October 2006 09:03, Steve D. wrote:> Hi, > I''m porting a QtRuby (4.1) app over to FxRuby cause I need the > cross-platform compatibility and was wondering if there was a > Rubberband (http://doc.trolltech.com/4.1/qrubberband.html) type class > for Fox or if I will have to roll my own.There are only two widgets which have "rubberband-style" selection: FXGLViewer and FXIconList. Both have built-in selection, but its implemented differently; the FXGLViewer implements the drawing using OpenGL, whereas the FXIconList does it using 2D drawing API''s. If it appears generally useful, we could implement FXRubberBand; perhaps you just give an example of how you would use such a thing in your code [assuming you need it outside of the FOX widgets which have this already built in]... - Jeroen
On 10/13/06, Jeroen van der Zijp <jeroen at fox-toolkit.org> wrote:> On Friday 13 October 2006 09:03, Steve D. wrote: > > Hi, > > I''m porting a QtRuby (4.1) app over to FxRuby cause I need the > > cross-platform compatibility and was wondering if there was a > > Rubberband (http://doc.trolltech.com/4.1/qrubberband.html) type class > > for Fox or if I will have to roll my own. > > There are only two widgets which have "rubberband-style" selection: FXGLViewer > and FXIconList. Both have built-in selection, but its implemented differently; > the FXGLViewer implements the drawing using OpenGL, whereas the FXIconList does > it using 2D drawing API''s. > > If it appears generally useful, we could implement FXRubberBand; perhaps you > just give an example of how you would use such a thing in your code [assuming > you need it outside of the FOX widgets which have this already built in]... > > > > - Jeroen > > >In the previous program I was using the rubberband to create rectangles on a 2D Canvas so that they could be stored, etc. In the end I don''t really need anything specific I would just like a click and drag type rectangle to be displayed on an FXCanvas instance. Thanks, Steven
Just an update from before, I created my own in-Ruby class and it seems to be working out fine. I just implemented the basics, nothing fancy. Thanks, Steven Davidovitz
On Oct 18, 2006, at 2:14 PM, Steven Davidovitz wrote:> Just an update from before, I created my own in-Ruby class and it > seems to be working out fine. I just implemented the basics, > nothing fancy.Want to share?
Yeah, sorry about that. You can view the code at the top of the file at http://www.nebulargauntlet.org/trac/ng/browser/branches/mapeditor-fox/lib/renderarea.rb
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]