1 try:
2 import wxversion
3 import wx
4 except ImportError:
5 from wxPython import wx
6
7 from gmListCtrlMapper import *
8
9 Inboxdata = {
10 1 : ("Pathology", "5 unread results (Douglas Pathology)"),
11 2 : ("Radiology", "1 Xray of femur (Newcastle radiology)"),
12 3 : ("", "Head CT (Hunter Diagnostic Imaging)"),
13 4 : ("Internal Mail ", "from practice nurse - non urgent"),
14 }
15 ID_INBOX = wx.NewId()
16
19 wx.Panel.__init__(self, parent, id, wx.DefaultPosition, wx.DefaultSize, 0 )
20 list_inbox = wx.ListCtrl(self, ID_INBOX, wx.DefaultPosition, wx.DefaultSize,wx.LC_REPORT|wx.LC_NO_HEADER|wx.SUNKEN_BORDER)
21 list_inbox.InsertColumn(0, "From")
22 list_inbox.InsertColumn(1, "Message", wx.LIST_FORMAT_LEFT)
23 self.list_inbox = list_inbox
24 self.lc_mapper = gmListCtrlMapper(self.list_inbox)
25
26
27
28
29 self.SetData( Inboxdata)
30
31 list_inbox.SetColumnWidth(0, wx.LIST_AUTOSIZE)
32 list_inbox.SetColumnWidth(1, wx.LIST_AUTOSIZE)
33 sizer = wx.BoxSizer(wx.VERTICAL)
34 sizer.Add(list_inbox,100,wx.EXPAND)
35 self.SetSizer(sizer)
36 sizer.Fit(self)
37 self.SetAutoLayout(True)
38
39
40 print self.GetData()
41
44
47
48 if __name__ == "__main__":
49 app = wxPyWidgetTester(size = (400, 200))
50 app.SetWidget(Inbox, -1)
51 app.MainLoop()
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75