From: Lyle J. <ly...@us...> - 2002-05-14 14:16:06
|
Update of /cvsroot/fxruby/FXRuby/swig-interfaces In directory usw-pr-cvs1:/tmp/cvs-serv23733/swig-interfaces Modified Files: Tag: release10 FXDial.i FXSlider.i FXSpinner.i Log Message: Modified the range and range= methods for FXDial, FXSlider and FXSpinner to work with Ruby Range objects instead of (lo, hi) Fixnum pairs. Index: FXDial.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXDial.i,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** FXDial.i 6 May 2002 19:16:29 -0000 1.17.2.1 --- FXDial.i 14 May 2002 14:16:03 -0000 1.17.2.2 *************** *** 77,97 **** FXint getValue() const; - /// Change the dial's range - void setRange(FXint lo,FXint hi); - #ifdef SWIGRUBY %extend { /// Obtain the current range of the dial VALUE getRange() const { ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; } } #endif #ifdef SWIGPYTHON %extend { PyObject* getRange() const { --- 77,101 ---- FXint getValue() const; #ifdef SWIGRUBY %extend { + /// Change the dial's range + void setRange(VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } + /// Obtain the current range of the dial VALUE getRange() const { ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); } } #endif #ifdef SWIGPYTHON + /// Change the dial's range + void setRange(FXint lo,FXint hi) + %extend { PyObject* getRange() const { Index: FXSlider.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXSlider.i,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -C2 -d -r1.18.2.1 -r1.18.2.2 *** FXSlider.i 6 May 2002 19:16:29 -0000 1.18.2.1 --- FXSlider.i 14 May 2002 14:16:03 -0000 1.18.2.2 *************** *** 100,120 **** FXint getValue() const; - /// Change the slider's range - void setRange(FXint lo,FXint hi); - #ifdef SWIGRUBY %extend { /// Get the slider's current range VALUE getRange() const { ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; ! } } #endif #ifdef SWIGPYTHON %extend { PyObject* getRange() const { --- 100,124 ---- FXint getValue() const; #ifdef SWIGRUBY %extend { + /// Change the slider's range + void setRange(VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } + /// Get the slider's current range VALUE getRange() const { ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); ! } } #endif #ifdef SWIGPYTHON + /// Change the slider's range + void setRange(FXint lo,FXint hi); + %extend { PyObject* getRange() const { Index: FXSpinner.i =================================================================== RCS file: /cvsroot/fxruby/FXRuby/swig-interfaces/FXSpinner.i,v retrieving revision 1.20.2.1 retrieving revision 1.20.2.2 diff -C2 -d -r1.20.2.1 -r1.20.2.2 *** FXSpinner.i 6 May 2002 19:16:29 -0000 1.20.2.1 --- FXSpinner.i 14 May 2002 14:16:04 -0000 1.20.2.2 *************** *** 99,119 **** FXint getValue() const; - /// Change the spinner's range - void setRange(FXint lo,FXint hi); - #ifdef SWIGRUBY %extend { /// Get the spinner's current range VALUE getRange() const { ! FXint lo, hi; ! self->getRange(lo, hi); ! VALUE result = rb_ary_new(); ! rb_ary_push(result, INT2NUM(lo)); ! rb_ary_push(result, INT2NUM(hi)); ! return result; ! } } #endif #ifdef SWIGPYTHON %extend { PyObject* getRange() const { --- 99,125 ---- FXint getValue() const; #ifdef SWIGRUBY + %extend { + /// Change the spinner's range + void setRange(VALUE range){ + FXint lo,hi; + FXRbRange2LoHi(range,lo,hi); + self->setRange(lo,hi); + } + /// Get the spinner's current range VALUE getRange() const { ! FXint lo,hi; ! self->getRange(lo,hi); ! return rb_range_new(INT2NUM(lo),INT2NUM(hi),0); ! } } #endif + #ifdef SWIGPYTHON + /// Change the spinner's range + void setRange(FXint lo,FXint hi); + %extend { PyObject* getRange() const { |