[wx-dev] #9755: SizedDialog isn't compatible with validators.

wxTrac noreply at wxsite.net
Fri Jul 18 10:08:38 PDT 2008


Ticket URL: <http://trac.wxwidgets.org/ticket/9755>

#9755: SizedDialog isn't compatible with validators.
---------------------------------------+------------------------------------
 Reporter:  mk                         |       Owner:       
     Type:  defect                     |      Status:  new  
 Priority:  normal                     |   Milestone:       
Component:  wxPython                   |     Version:  2.8.x
 Keywords:  sized_controls validators  |   Blockedby:       
    Patch:  0                          |    Blocking:       
---------------------------------------+------------------------------------
 === Background ===
 You've subclassed SizedDialog, and inside your class's {{{__init__}}}
 routine, you're creating new controls that support validators, e.g. a
 TextCtrl. When creating that TextCtrl, instead of passing in 'self', as
 you would with wx.Dialog, you pass in self.GetContentsPane().

 === Problem ===
 The validator's {{{__init__}}} routine gets called, but Validate() is
 never called.

 If you stop passing in self.GetContentsPane(), and pass in self,
 Validate() will
 get called, but then your controls aren't properly positioned.

 === To Reproduce ===
 1. I've modified the 2.8.4.0 version Validator.py to used sized_controls,
 and attached the diff. Patch Validator.py, and then run the result.
 2. Click "Test Dialog Validation" and then click "OK" in the new dialog
 box.

 What happens: the dialog box closes
 What should happen: You should get a MessageBox complaining about the
 empty fields.

 === Versions Tested ===
 I've seen this behavior with  2.8.4.0 (gtk2-unicode) and 2.8.7.1 (msw-
 unicode).


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9755>


More information about the wx-dev mailing list