1
2
3
4
5 import wx
6
7
8
9
10
11
14
15 from Gnumed.wxpython import gmPhraseWheel, gmPatSearchWidgets, gmListWidgets
16
17
18 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
19 wx.ScrolledWindow.__init__(self, *args, **kwds)
20 self._PRW_zone = gmPatSearchWidgets.cWaitingZonePhraseWheel(self, -1, "", style=wx.TE_PROCESS_ENTER|wx.NO_BORDER)
21 self._LBL_no_of_patients = wx.StaticText(self, -1, "")
22 self._LCTRL_patients = gmListWidgets.cReportListCtrl(self, -1, style=wx.LC_REPORT|wx.SIMPLE_BORDER)
23 self._BTN_activate = wx.Button(self, -1, _("&Activate"), style=wx.BU_EXACTFIT)
24 self._BTN_activateplus = wx.Button(self, -1, _(u"Activate²"), style=wx.BU_EXACTFIT)
25 self._BTN_add_patient = wx.Button(self, wx.ID_ADD, "", style=wx.BU_EXACTFIT)
26 self._BTN_remove = wx.Button(self, wx.ID_REMOVE, "", style=wx.BU_EXACTFIT)
27 self._BTN_edit = wx.Button(self, -1, _("&Edit"), style=wx.BU_EXACTFIT)
28 self._BTN_up = wx.Button(self, wx.ID_UP, "", style=wx.BU_EXACTFIT)
29 self._BTN_down = wx.Button(self, wx.ID_DOWN, "", style=wx.BU_EXACTFIT)
30
31 self.__set_properties()
32 self.__do_layout()
33
34 self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._on_list_item_activated, self._LCTRL_patients)
35 self.Bind(wx.EVT_BUTTON, self._on_activate_button_pressed, self._BTN_activate)
36 self.Bind(wx.EVT_BUTTON, self._on_activateplus_button_pressed, self._BTN_activateplus)
37 self.Bind(wx.EVT_BUTTON, self._on_add_patient_button_pressed, self._BTN_add_patient)
38 self.Bind(wx.EVT_BUTTON, self._on_remove_button_pressed, self._BTN_remove)
39 self.Bind(wx.EVT_BUTTON, self._on_edit_button_pressed, self._BTN_edit)
40 self.Bind(wx.EVT_BUTTON, self._on_up_button_pressed, self._BTN_up)
41 self.Bind(wx.EVT_BUTTON, self._on_down_button_pressed, self._BTN_down)
42
43
45
46 self.SetScrollRate(10, 10)
47 self._PRW_zone.SetToolTipString(_("Enter the waiting zone you want to filter by here.\nIf you leave this empty all waiting patients will be shown regardless of which zone they are waiting in."))
48 self._LCTRL_patients.SetToolTipString(_("These patients are waiting.\n\nDoubleclick to activate (entry will stay in list)."))
49 self._BTN_activate.SetToolTipString(_("Activate patient but do not remove from waiting list."))
50 self._BTN_activate.Enable(False)
51 self._BTN_activate.SetDefault()
52 self._BTN_activateplus.SetToolTipString(_("Activate patient and remove from waiting list."))
53 self._BTN_activateplus.Enable(False)
54 self._BTN_add_patient.SetToolTipString(_("Add the active patient to the waiting list."))
55 self._BTN_remove.SetToolTipString(_("Remove selected patient from the waiting list."))
56 self._BTN_remove.Enable(False)
57 self._BTN_edit.SetToolTipString(_("Edit details of the waiting list entry."))
58 self._BTN_edit.Enable(False)
59 self._BTN_up.SetToolTipString(_("Move patient up."))
60 self._BTN_up.Enable(False)
61 self._BTN_down.SetToolTipString(_("Move patient down."))
62 self._BTN_down.Enable(False)
63
64
66
67 __szr_main = wx.BoxSizer(wx.VERTICAL)
68 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
69 __szr_top = wx.BoxSizer(wx.HORIZONTAL)
70 __lbl_filter = wx.StaticText(self, -1, _("Filter by:"))
71 __szr_top.Add(__lbl_filter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 10)
72 __lbl_zone = wx.StaticText(self, -1, _("Zone"))
73 __szr_top.Add(__lbl_zone, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
74 __szr_top.Add(self._PRW_zone, 1, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
75 __szr_top.Add(self._LBL_no_of_patients, 0, wx.ALIGN_CENTER_VERTICAL, 0)
76 __szr_top.Add((20, 20), 3, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
77 __szr_main.Add(__szr_top, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 3)
78 __szr_main.Add(self._LCTRL_patients, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 3)
79 __szr_buttons.Add((20, 20), 2, wx.EXPAND, 0)
80 __szr_buttons.Add(self._BTN_activate, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
81 __szr_buttons.Add(self._BTN_activateplus, 0, wx.ALIGN_CENTER_VERTICAL, 0)
82 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
83 __szr_buttons.Add(self._BTN_add_patient, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
84 __szr_buttons.Add(self._BTN_remove, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
85 __szr_buttons.Add(self._BTN_edit, 0, wx.ALIGN_CENTER_VERTICAL, 0)
86 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
87 __szr_buttons.Add(self._BTN_up, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
88 __szr_buttons.Add(self._BTN_down, 0, wx.ALIGN_CENTER_VERTICAL, 0)
89 __szr_buttons.Add((20, 20), 2, wx.EXPAND, 0)
90 __szr_main.Add(__szr_buttons, 0, wx.TOP|wx.BOTTOM|wx.EXPAND, 5)
91 self.SetSizer(__szr_main)
92 __szr_main.Fit(self)
93
94
96 print "Event handler `_on_add_patient_button_pressed' not implemented!"
97 event.Skip()
98
100 print "Event handler `_on_activate_button_pressed' not implemented!"
101 event.Skip()
102
104 print "Event handler `_on_activateplus_button_called' not implemented!"
105 event.Skip()
106
108 print "Event handler `_on_remove_button_pressed' not implemented!"
109 event.Skip()
110
112 print "Event handler `_on_edit_button_pressed' not implemented!"
113 event.Skip()
114
116 print "Event handler `_on_up_button_pressed' not implemented!"
117 event.Skip()
118
120 print "Event handler `_on_down_button_pressed' not implemented!"
121 event.Skip()
122
124 print "Event handler `_on_list_item_activated' not implemented"
125 event.Skip()
126
128 print "Event handler `_on_activateplus_button_pressed' not implemented"
129 event.Skip()
130
131
132