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 from Gnumed.wxpython.gmListWidgets import cReportListCtrl
23 self._LCTRL_persons = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES)
24 self._BTN_new_patient = wx.Button(self, wx.ID_NEW, "")
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 self.Bind(wx.EVT_BUTTON, self._on_new_patient_button_pressed, self._BTN_new_patient)
34
35
37
38 self.SetTitle(_("Select person from list"))
39 self.SetSize((600, 400))
40 self._LCTRL_persons.SetToolTip(_("Displays the list of persons to select from."))
41 self._LCTRL_persons.SetFocus()
42 self._BTN_new_patient.SetToolTip(_("Create a new patient."))
43 self._BTN_select.SetToolTip(_("Select the person highlighted in the list above."))
44 self._BTN_select.Enable(False)
45 self._BTN_select.SetDefault()
46 self._BTN_cancel.SetToolTip(_("Cancel person selection."))
47
48
50
51 _szr_main = wx.BoxSizer(wx.VERTICAL)
52 _szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
53 _lbl_message = wx.StaticText(self, wx.ID_ANY, _("Please select a person from the list below."))
54 _szr_main.Add(_lbl_message, 0, wx.EXPAND, 0)
55 _szr_main.Add(self._LCTRL_persons, 1, wx.EXPAND, 0)
56 _szr_buttons.Add(self._BTN_new_patient, 0, wx.ALIGN_CENTER_VERTICAL, 0)
57 _szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
58 _szr_buttons.Add(self._BTN_select, 0, 0, 0)
59 _szr_buttons.Add(self._BTN_cancel, 0, 0, 0)
60 _szr_main.Add(_szr_buttons, 0, wx.EXPAND, 0)
61 self.SetSizer(_szr_main)
62 self.Layout()
63 self.Centre()
64
65
67 print("Event handler '_on_list_item_activated' not implemented!")
68 event.Skip()
69
71 print("Event handler '_on_list_item_selected' not implemented!")
72 event.Skip()
73
75 print("Event handler '_on_new_patient_button_pressed' not implemented!")
76 event.Skip()
77
78
79