lib.maskedit.numctrl and lib.maskedit.maskedit patches

Hopefully someone like Robin or Will can check this and o.k. it for inclusion in a future version.

Patches were done against wxPython 2.8.8.1 Unicode on Windows.

*numctrl *
- it did not implement the ChangeValue method - event free programmatic change of the value

I copied the SetValue and _SetValue methods and made the appropriate changes.

*maskedit.maskedit*
- the ClearValue method would fire a change event as it used SetValue to reset the control to its default value.

I copied the ClearValue method to ClearValueAlt method and changed it to use ChangeValue.

ClearValueAlt is maybe not the best name, but I could not think of anything better.

Werner

numctrlPatch (9.68 KB)

maskeditPatch (734 Bytes)

Werner F. Bruhin wrote:

Hopefully someone like Robin or Will can check this and o.k. it for inclusion in a future version.

Patches were done against wxPython 2.8.8.1 Unicode on Windows.

*numctrl *
- it did not implement the ChangeValue method - event free programmatic change of the value

I copied the SetValue and _SetValue methods and made the appropriate changes.

*maskedit.maskedit*
- the ClearValue method would fire a change event as it used SetValue to reset the control to its default value.

I copied the ClearValue method to ClearValueAlt method and changed it to use ChangeValue.

ClearValueAlt is maybe not the best name, but I could not think of anything better.

Found some more SetValue calls being used during initialization, i.e. when doing SetParameters.

Will do some more testing and provide an updated patch, probably tomorrow.

Werner

Werner F. Bruhin wrote:

Werner F. Bruhin wrote:

Hopefully someone like Robin or Will can check this and o.k. it for inclusion in a future version.

Patches were done against wxPython 2.8.8.1 Unicode on Windows.

*numctrl *
- it did not implement the ChangeValue method - event free programmatic change of the value

I copied the SetValue and _SetValue methods and made the appropriate changes.

*maskedit.maskedit*
- the ClearValue method would fire a change event as it used SetValue to reset the control to its default value.

I copied the ClearValue method to ClearValueAlt method and changed it to use ChangeValue.

ClearValueAlt is maybe not the best name, but I could not think of anything better.

Found some more SetValue calls being used during initialization, i.e. when doing SetParameters.

Will do some more testing and provide an updated patch, probably tomorrow.

Attached the two updated patches.

Additional changes need to be made as follows:

*numctrl*
- In method SetParameters I changed SetValue to ChangeValue

*maskedit.maskedit*
- In method _configure I changed SetValue to ChangeValue
- In method _SetInitialValue I changed SetValue to ChangeValue

At this point setup/initialization of the controls and using ChangeValue will not fire any change event.

I hope that this can make it into a future version of wxPython.

Werner

maskeditPatch2 (3.06 KB)

numctrlPatch2 (11 KB)

Werner F. Bruhin wrote:

Werner F. Bruhin wrote:

Werner F. Bruhin wrote:

Hopefully someone like Robin or Will can check this and o.k. it for inclusion in a future version.

Patches were done against wxPython 2.8.8.1 Unicode on Windows.

*numctrl *
- it did not implement the ChangeValue method - event free programmatic change of the value

I copied the SetValue and _SetValue methods and made the appropriate changes.

*maskedit.maskedit*
- the ClearValue method would fire a change event as it used SetValue to reset the control to its default value.

I copied the ClearValue method to ClearValueAlt method and changed it to use ChangeValue.

ClearValueAlt is maybe not the best name, but I could not think of anything better.

Found some more SetValue calls being used during initialization, i.e. when doing SetParameters.

Will do some more testing and provide an updated patch, probably tomorrow.

Attached the two updated patches.

Additional changes need to be made as follows:

*numctrl*
- In method SetParameters I changed SetValue to ChangeValue

*maskedit.maskedit*
- In method _configure I changed SetValue to ChangeValue
- In method _SetInitialValue I changed SetValue to ChangeValue

At this point setup/initialization of the controls and using ChangeValue will not fire any change event.

I hope that this can make it into a future version of wxPython.

Werner

I found one more problem.

In _SetInitialValue the maskedit.combobox case was not handled, i.e. needed to check isInstance(self, wx.TextCtrl) in two places before using ChangeValue instead of SetValue.

I hope that I got it all now. I checked it against my application which makes pretty heavy use of maskedit controls and I also checked the wxPython demo.

The attached patch is again against version 2.8.8.1 and is all inclusive (i.e. not just this last correction).

Werner

maskeditPatch3 (3.18 KB)

···

------------------------------------------------------------------------

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi people,
    this is my question:

I want use on MacOSX platform WebKit module for loading web pages.

I have a frame which contains a WebKitCtrl object, like this following example:

import wx
import wx.webkit as wk

class Browser(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "TEST")
               web = wk.WebKitCtrl(self)
        web.LoadURL("http://javascript.html.it/guide/lezione/874/le-finestre-di-dialogo/")
               self.SetSize( (600,400) )
        self.CenterOnScreen()
       
   if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    Browser().Show()
    app.MainLoop()

When I click on a "test link" in the alert section, javascript don't works.
If I open the same page with Safari, javascript works properly.

Any idea?
PS: if I load script.aculo.us home page and related demos with webkitctrl, these demos works fine!!! Is scriptaculous based on javascript??? and why scriptaculous works and a simple alert not?

thx very much

···

--
/\/\ariano Di Felice
Java/PHP/Python WEB/GUI Developer
http://www.marianodifelice.it
mariano.difelice@gmail.com
Tel. 0735 703735
Cell +39 339 6407211

Mariano Di Felice wrote:

Hi people,
   this is my question:

I want use on MacOSX platform WebKit module for loading web pages.

I have a frame which contains a WebKitCtrl object, like this following example:

import wx
import wx.webkit as wk

class Browser(wx.Frame):
   def __init__(self):
       wx.Frame.__init__(self, None, -1, "TEST")
             web = wk.WebKitCtrl(self)
       web.LoadURL("http://javascript.html.it/guide/lezione/874/le-finestre-di-dialogo/"\)

             self.SetSize( (600,400) )
       self.CenterOnScreen()
        if __name__ == "__main__":
   app = wx.PySimpleApp(0)
   Browser().Show()
   app.MainLoop()

When I click on a "test link" in the alert section, javascript don't works.
If I open the same page with Safari, javascript works properly.

Any idea?

The WebKitCtrl does not implement the handlers needed to respond to requests to show popup windows, message dialogs, etc.

···

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