MCPcopy Create free account
hub / github.com/Image-Py/imagepy / __init__

Method __init__

imagepy/ui/widgets/normal.py:6–27  ·  view source on GitHub ↗
(self, parent, rang, accury, title, unit)

Source from the content-addressed store, hash-verified

4class NumCtrl(wx.Panel):
5 """NumCtrl: diverid from wx.core.TextCtrl """
6 def __init__(self, parent, rang, accury, title, unit):
7 wx.Panel.__init__(self, parent)
8 sizer = wx.BoxSizer( wx.HORIZONTAL )
9 self.prefix = lab_title = wx.StaticText( self, wx.ID_ANY, title,
10 wx.DefaultPosition, wx.DefaultSize)
11
12 lab_title.Wrap( -1 )
13 sizer.Add( lab_title, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
14 self.ctrl = wx.TextCtrl(self, wx.TE_RIGHT)
15 self.ctrl.Bind(wx.EVT_KEY_UP, lambda x : self.para_changed(key))
16 sizer.Add( self.ctrl, 2, wx.ALL, 5 )
17
18 self.postfix = lab_unit = wx.StaticText( self, wx.ID_ANY, unit,
19 wx.DefaultPosition, wx.DefaultSize)
20
21 lab_unit.Wrap( -1 )
22 sizer.Add( lab_unit, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
23 self.SetSizer(sizer)
24
25 self.min, self.max = rang
26 self.accury = accury
27 self.ctrl.Bind(wx.EVT_KEY_UP, self.ontext)
28
29 #! TODO: what is this?
30 def Bind(self, z, f):self.f = f

Callers

nothing calls this directly

Calls 3

para_changedMethod · 0.80
__init__Method · 0.45
BindMethod · 0.45

Tested by

no test coverage detected