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._LCTRL_persons = gmListWidgets.cReportListCtrl(self, -1, style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES|wx.NO_BORDER)
16 self._BTN_select = wx.Button(self, wx.ID_OK, _("Select"))
17 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel"))
18
19 self.__set_properties()
20 self.__do_layout()
21
22 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_list_item_selected, self._LCTRL_persons)
23 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_list_item_activated, self._LCTRL_persons)
24
25
27
28 self.SetTitle(_("Select person from list"))
29 self.SetSize((600, 400))
30 self._LCTRL_persons.SetToolTipString(_("Displays the list of persons to select from."))
31 self._LCTRL_persons.SetFocus()
32 self._BTN_select.SetToolTipString(_("Select the person highlighted in the list above."))
33 self._BTN_select.Enable(False)
34 self._BTN_select.SetDefault()
35 self._BTN_cancel.SetToolTipString(_("Cancel person selection."))
36
37
39
40 _szr_main = wx.BoxSizer(wx.VERTICAL)
41 _szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
42 _lbl_message = wx.StaticText(self, -1, _("Please select a person from the list below."))
43 _szr_main.Add(_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