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