1
2
3
4
5 import wx
6
9
10 from Gnumed.wxpython import gmListWidgets
11
12
13 kwds["style"] = wx.CAPTION|wx.RESIZE_BORDER|wx.CLOSE_BOX|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
14 wx.Dialog.__init__(self, *args, **kwds)
15 self._lbl_message = wx.StaticText(self, -1, _("Please select a person from the list below."))
16 self._LCTRL_persons = gmListWidgets.cReportListCtrl(self, -1, style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES|wx.NO_BORDER)
17 self._BTN_select = wx.Button(self, wx.ID_OK, _("Select"))
18 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel"))
19
20 self.__set_properties()
21 self.__do_layout()
22
23 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_list_item_selected, self._LCTRL_persons)
24 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_list_item_activated, self._LCTRL_persons)
25
26
28
29 self.SetTitle(_("Select person from list"))
30 self.SetSize((600, 400))
31 self._LCTRL_persons.SetToolTipString(_("Displays the list of persons to select from."))
32 self._LCTRL_persons.SetFocus()
33 self._BTN_select.SetToolTipString(_("Select the person highlighted in the list above."))
34 self._BTN_select.Enable(False)
35 self._BTN_select.SetDefault()
36 self._BTN_cancel.SetToolTipString(_("Cancel person selection."))
37
38
40
41 _szr_main = wx.BoxSizer(wx.VERTICAL)
42 _szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
43 _szr_main.Add(self._lbl_message, 0, wx.EXPAND, 0)
44 _szr_main.Add(self._LCTRL_persons, 1, wx.EXPAND, 0)
45 _szr_buttons.Add((20, 20), 1, 0, 0)
46 _szr_buttons.Add(self._BTN_select, 0, 0, 0)
47 _szr_buttons.Add(self._BTN_cancel, 0, 0, 0)
48 _szr_main.Add(_szr_buttons, 0, wx.EXPAND, 0)
49 self.SetAutoLayout(True)
50 self.SetSizer(_szr_main)
51 self.Layout()
52 self.Centre()
53
54
56 print "Event handler `_on_list_item_selected' not implemented"
57 event.Skip()
58
60 print "Event handler `_on_list_item_activated' not implemented"
61 event.Skip()
62
63
64