Problem overloading/deactivating wx.Dialog.TransferDataFromWindow

Hi,

I have a problem with the wx.Dialog.TransferDataFromWindow (TFW) method.
I tried overloading the method, but the new method doesn’t get called.
Is it still not possible to overload this method,
and if so, can I at least prevent it from getting called?
(however, I still want TranferToWindow (TTW) to recursively call the child TTWs)

Motivation:
I use validators to transfer data from ‘data items’ to controls and vice versa.
There can be more than one control manipulating the same data item,
for example a slider and a textctrl for an integer value.
Let the valid range for the slider be 0-100, whereas for the textctrl it is 0-1000.
(0-100 being the most common, sensible values for something but the user should have the freedom
to enter bigger values if he wants to)
If the value 500 was entered in the textctrl, the data item gets updated with TFW,
then the data item’s value is transferred to the slider with TTW, which gets limited to 100, fine.
At the end of the dialog, however, the slider must not TFW its value after the textctrl.
(since otherwise the 500 is overwritten by 100)
This is of course not guaranteed, when Dialog.TFW calls all the children’s TFW in arbitrary order.

No, it's still can't be overridden in wx.Dialog (although it will be in Phoenix) but it is overridable in classes derived from wx.Validator.

http://wiki.wxpython.org/OverridingMethods

···

On 4/18/12 4:50 AM, Patrick Ruoff wrote:

Hi,

I have a problem with the wx.Dialog.TransferDataFromWindow (TFW) method.
I tried overloading the method, but the new method doesn't get called.
Is it still not possible to overload this method,
and if so, can I at least prevent it from getting called?
(however, I still want TranferToWindow (TTW) to recursively call the
child TTWs)

--
Robin Dunn
Software Craftsman

No, it’s still can’t be overridden in wx.Dialog (although it will be in
Phoenix) but it is overridable in classes derived from wx.Validator.

http://wiki.wxpython.org/OverridingMethods

Ok, thx for the answer!
Is it enough to intercept the dialog’s wx.ID_OK event then
or is there another place where Dialog.TFW might get called?

Why is it that you are wanting to do this? (Perhaps there is a better way to accomplish the same thing.)

···

On 4/20/12 7:30 AM, Patrick Ruoff wrote:

    No, it's still can't be overridden in wx.Dialog (although it will be in
    Phoenix) but it is overridable in classes derived from wx.Validator.

    OverridingMethods - wxPyWiki
    <http://wiki.wxpython.org/OverridingMethods&gt;

Ok, thx for the answer!
Is it enough to intercept the dialog's wx.ID_OK event then
or is there another place where Dialog.TFW might get called?

--
Robin Dunn
Software Craftsman