Hello,
I have a small problem with NumCtrl initialized with integer and decimal part.
If I try to SetFocus() on a NumCtrl widget, in Linux it correctly selects the
whole integer part as if I TAB to it, while in Windows it jumps to the end of
the control (it also happens without SetFocus if the NumCtrl is the first
control in TAB order). I
import wx, wx.lib.masked as masked
class myFrame(wx.Frame):
def __init__(self, parent=None):
wx.Frame.__init__(self, parent)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(myPanel(self), 1 ,wx.EXPAND|wx.ALL)
self.SetSizerAndFit(sizer)
class myPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
sizer = wx.GridSizer(1, 1, 5, 5)
self.txt = wx.TextCtrl(self)
self.num = myNumCtrl(self)
map(lambda x: sizer.Add(x, 1, wx.EXPAND), (self.txt, self.num))
self.SetSizerAndFit(sizer)
self.num.SetFocus()
class myNumCtrl(masked.NumCtrl):
def __init__(self, parent):
masked.NumCtrl.__init__(self,
parent,
integerWidth=5,
fractionWidth=2,
allowNegative=False)
app = wx.PySimpleApp()
app.frame = myFrame()
app.frame.Show()
app.MainLoop()
Any hint?
···
--
Cordialmente
Stefano Bartaletti
Responsabile Software
G.Tosi Spa Tintoria
Skype account: stefano.bartaletti
ICQ contact : 1271960
Viale dell'Industria 61
21052 Busto Arsizio (VA)
Tel. +39 0331 34 48 11
Fax +39 0331 35 21 23