List Info

Thread: XRCed 1.8-0 bug




XRCed 1.8-0 bug
country flaguser name
Czech Republic
2007-02-21 06:47:15
Hi,
I found a bug in XRCed 1.8-0

Class ParamIntList (file param.py, line 730 something)
doesn't have SetValue()
correctly overriden (for a list with items 1, 2, 3 SetValue
generates '1|2|3'
instead of '[1,2,3]'. This causes problems f.e. in
growablecols/rows in
flexgridsizers.

Easy solution is to add a method 
    def SetValue(self, value):
        self.freeze = True
        if not value: value = []
        self.value = value
        repr_ = '[%s]' % (','.join(str(v) for v in value))
        self.text.SetValue(repr_)  # update text ctrl
        self.freeze = False
to class ParamIntList

Method OnButtonEdit of class ParamIntList should also have a
check for empty
input value just after the try: clause, like:
                if not self.text.GetValue():
                    self.value = []
                else:
                    self.value = eval(self.text.GetValue())

I'd also recommend to replace lines 642 to 645 (
        if value:
           repr_ = reduce(lambda a,b: '%s|%s' % (a,b),
value)
        else:
            repr_ = ''
)
with repr_ = '|'.join(str(v) for v in value) 
which is easier to read, handles more cases correctly
(always outputs string
even with nonstr items in value) and IMO is faster.

Still, XRCed is the best GUI designer , thanks
for your effort.
regards..
    Tomas Dvorak 



------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-helplists.wxwidgets.org


Re: XRCed 1.8-0 bug
user name
2007-02-21 16:33:52
ava wrote:
> Hi,
> I found a bug in XRCed 1.8-0
> 
> Class ParamIntList (file param.py, line 730 something)
doesn't have SetValue()
> correctly overriden (for a list with items 1, 2, 3
SetValue generates '1|2|3'
> instead of '[1,2,3]'. This causes problems f.e. in
growablecols/rows in
> flexgridsizers.
> 
> Easy solution is to add a method 

Could you please make a patch file for these changes?  That
way I can be 
sure I don't make any mistakes when making the changes you
describe.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java
give you jitters?  Relax with wxPython!


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-dev-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-dev-helplists.wxwidgets.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )