Problem with auto-selection in wx masked control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jean-michel bain-cornu

    #1

    Problem with auto-selection in wx masked control

    Hi all,

    I'm trying to get the whole field selected when the caret arrives into a
    wx masked control.
    This is perfectly done with the program below.
    But if I comment out the line "r= dlg.ShowModal() ", I get something
    different : the data within the field is no more correctly selected.
    Why ? And is there any solution ?
    If somebody have got an idea, I'd be delighted.

    Cheers,
    jm

    #------------------------------------------------------------------------
    import wx
    from wx.lib import masked
    #--
    class TestPanel( wx.Panel ):
    def __init__( self, parent):
    wx.Panel.__init __( self, parent, -1 )
    self.mask1 = masked.NumCtrl( self, -1, name="target control",
    pos=(20,50))
    self.mask1.SetS electOnEntry(Tr ue)
    self.mask1.SetV alue(123.45678)
    self.Show()
    #--
    class MainWindow(wx.F rame):
    def __init__(self,p arent,id, title):
    wx.Frame.__init __(self,parent, wx.ID_ANY,title ,size=(200 ,200))
    win = TestPanel(self)
    dlg = wx.MessageDialo g(self, 'Confirm')
    r= dlg.ShowModal()
    dlg.Destroy()
    self.Show()
    #--
    app = wx.PySimpleApp( )
    frame=MainWindo w(None,-1,'')
    app.MainLoop()
    #------------------------------------------------------------------------
Working...