| 234 | |
| 235 | class Choices(wx.Panel): |
| 236 | def __init__( self, parent, choices, title): |
| 237 | self.choices = list(choices) |
| 238 | wx.Panel.__init__(self, parent) |
| 239 | |
| 240 | sizer = wx.BoxSizer(wx.VERTICAL) |
| 241 | lab_title = wx.StaticText( self, wx.ID_ANY, title, |
| 242 | wx.DefaultPosition, wx.DefaultSize) |
| 243 | lab_title.Wrap( -1 ) |
| 244 | sizer.Add( lab_title, 0, wx.ALL, 5 ) |
| 245 | self.ctrl = wx.CheckListBox(self, -1, (80, 50), wx.DefaultSize, [str(i) for i in choices]) |
| 246 | sizer.Add( self.ctrl, 1, wx.ALL|wx.EXPAND, 0 ) |
| 247 | self.ctrl.SetMaxSize( wx.Size( -1,100 ) ) |
| 248 | self.SetSizer(sizer) |
| 249 | self.ctrl.Bind(wx.EVT_CHECKLISTBOX, self.on_check) |
| 250 | |
| 251 | def Bind(self, z, f): |
| 252 | self.f = f |