[wxPython] wxSpinCtrl.SetRange( ) strange behaviour with large values...

I'm trying to create a generic IntegerEditor for my properties distribution. Basically, this is the default editor for integers, so it's got to be fairly general. For that reason, I need to allow for any standard integer (32 bit for now) that could be edited.

When I call SetRange with large values (positive or negative), however, the control decides that it's going to restrict the values to 0 and -1 . Large values includes both extremes (-sys.maxint-1, sys.maxint) and fairly reasonable values such as 100000. Here's the code I'm using:

from wxPython.wx import *
from wxprop import baseeditor
from basicproperty import boundary
import sys

class IntegerEditor(baseeditor.BaseEditor):
     """Standard integer editing control... (using a wxSpinCtrl)"""
     controlClass = wxSpinCtrl
     def BeginEdit(self, row, col, grid):
         """Begin editing, we override to set any constraints we can find...
         """
         table = self.GetGrid().GetTable()
         property = table.GetPropertyForCoordinate( row, col )
         try:
             minimum = -sys.maxint-1
             maximum = sys.maxint
             try:
                 for bound in property.property.bounds:
                     if isinstance( bound, boundary.RangeBoundary ):
                         if isinstance(bound.minimum, int):
                             minimum = bound.minimum
                         if isinstance(bound.maximum, int):
                             maximum = bound.maximum
                         break
             except AttributeError:
                 pass
         finally:
             print 'range', (minimum, maximum)
             self.control.SetRange(0, 100000)
         print 'current value', self.GetCurrentTableValue(row, col)
         baseeditor.BaseEditor.BeginEdit( self, row, col, grid )

As far as I can see, there's no reason for this to be failing.

A minor question: why isn't there a way to set the boundaries to non-active?

I think for the moment I'll just go ahead and write my own integer editing control, but it would be nice to know what's going on with the standard control.

Enjoy yourselves,
Mike

···

_______________________________________
   Mike C. Fletcher
   http://members.rogers.com/mcfletch/

Argh, found the problem, it's in the docs, just not under "SetRange", apparently the SpinButton is restricted on some platforms to the range SHRT_MIN to SHRT_MAX.

Sorry to trouble y'all,
Mike

Mike C. Fletcher wrote:
...

When I call SetRange with large values (positive or negative), however, the control decides that it's going to restrict the values to 0 and -1 . Large values includes both extremes (-sys.maxint-1, sys.maxint) and fairly reasonable values such as 100000. Here's the code I'm using:

...

···

_______________________________________
   Mike C. Fletcher
   http://members.rogers.com/mcfletch/