1
2
3
4
5 import wx
6 import wx.grid
7
8
9
10
11
12
15
16 from Gnumed.wxpython import gmMedicationWidgets
17
18
19 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
20 wx.ScrolledWindow.__init__(self, *args, **kwds)
21 self._RBTN_episode = wx.RadioButton(self, -1, _("Episode"))
22 self._RBTN_brand = wx.RadioButton(self, -1, _("Brand"))
23 self._CHBOX_show_inactive = wx.CheckBox(self, -1, _("Inactive"))
24 self._CHBOX_show_unapproved = wx.CheckBox(self, -1, _("Unapproved"))
25 self._grid_substances = gmMedicationWidgets.cCurrentSubstancesGrid(self, -1, size=(1, 1))
26 self._BTN_add = wx.Button(self, wx.ID_ADD, "", style=wx.BU_EXACTFIT)
27 self._BTN_edit = wx.Button(self, -1, _("&Edit"), style=wx.BU_EXACTFIT)
28 self._BTN_delete = wx.Button(self, wx.ID_DELETE, "", style=wx.BU_EXACTFIT)
29 self._BTN_allergy = wx.Button(self, -1, _("Allergy"), style=wx.BU_EXACTFIT)
30 self._BTN_info = wx.Button(self, -1, _("Info"), style=wx.BU_EXACTFIT)
31 self._BTN_kidneys = wx.Button(self, -1, _("Kidney"), style=wx.BU_EXACTFIT)
32 self._BTN_interactions = wx.Button(self, -1, _("&Interactions?"), style=wx.BU_EXACTFIT)
33 self._BTN_print = wx.Button(self, wx.ID_PRINT, "", style=wx.BU_EXACTFIT)
34
35 self.__set_properties()
36 self.__do_layout()
37
38 self.Bind(wx.EVT_RADIOBUTTON, self._on_episode_grouping_selected, self._RBTN_episode)
39 self.Bind(wx.EVT_RADIOBUTTON, self._on_brand_grouping_selected, self._RBTN_brand)
40 self.Bind(wx.EVT_CHECKBOX, self._on_show_inactive_checked, self._CHBOX_show_inactive)
41 self.Bind(wx.EVT_CHECKBOX, self._on_show_unapproved_checked, self._CHBOX_show_unapproved)
42 self.Bind(wx.EVT_BUTTON, self._on_add_button_pressed, self._BTN_add)
43 self.Bind(wx.EVT_BUTTON, self._on_edit_button_pressed, self._BTN_edit)
44 self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._BTN_delete)
45 self.Bind(wx.EVT_BUTTON, self._on_allergy_button_pressed, self._BTN_allergy)
46 self.Bind(wx.EVT_BUTTON, self._on_info_button_pressed, self._BTN_info)
47 self.Bind(wx.EVT_BUTTON, self._on_button_kidneys_pressed, self._BTN_kidneys)
48 self.Bind(wx.EVT_BUTTON, self._on_interactions_button_pressed, self._BTN_interactions)
49 self.Bind(wx.EVT_BUTTON, self._on_print_button_pressed, self._BTN_print)
50
51
53
54 self.SetScrollRate(10, 10)
55 self._RBTN_episode.SetToolTipString(_("Sort entries by \"health issue\" and \"episode\" for which they are taken, then \"substance\", then \"started\"."))
56 self._RBTN_episode.SetValue(1)
57 self._RBTN_brand.SetToolTipString(_("Sort entries by \"brand\", then \"substance\", then \"started\".\n\nThus each substance will only appear once unless it is really taken in more than one preparation."))
58 self._CHBOX_show_inactive.SetToolTipString(_("Whether to show inactive substances, too, or only those which are assumed to currently be active."))
59 self._CHBOX_show_unapproved.SetToolTipString(_("Whether to show all substances or only those the intake of which is approved of."))
60 self._BTN_add.SetToolTipString(_("Add a substance."))
61 self._BTN_edit.SetToolTipString(_("Edit the selected substance intake entry."))
62 self._BTN_delete.SetToolTipString(_("Remove a substance from the list."))
63 self._BTN_allergy.SetToolTipString(_("Discontinue selected entry due to an allergy or intolerance."))
64 self._BTN_info.SetToolTipString(_("Show in-depth information on the selected substance if available."))
65 self._BTN_kidneys.SetToolTipString(_("Show information on handling of drugs in presence of renal insufficiency."))
66 self._BTN_interactions.SetToolTipString(_("Check for interactions between selected drugs.\n\nIncludes all drugs if none selected."))
67 self._BTN_print.SetToolTipString(_("Print the medication list."))
68
69
71
72 __szr_main = wx.BoxSizer(wx.VERTICAL)
73 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
74 __szr_grid = wx.BoxSizer(wx.HORIZONTAL)
75 __szr_grouping = wx.BoxSizer(wx.HORIZONTAL)
76 __lbl_group = wx.StaticText(self, -1, _("Sort by:"))
77 __szr_grouping.Add(__lbl_group, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
78 __szr_grouping.Add(self._RBTN_episode, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
79 __szr_grouping.Add(self._RBTN_brand, 0, wx.ALIGN_CENTER_VERTICAL, 10)
80 __SLINE_grouping = wx.StaticLine(self, -1, style=wx.LI_VERTICAL)
81 __szr_grouping.Add(__SLINE_grouping, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
82 __lbl_filter = wx.StaticText(self, -1, _("Include:"))
83 __szr_grouping.Add(__lbl_filter, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
84 __szr_grouping.Add(self._CHBOX_show_inactive, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
85 __szr_grouping.Add(self._CHBOX_show_unapproved, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
86 __szr_grouping.Add((20, 20), 1, wx.EXPAND, 0)
87 __szr_main.Add(__szr_grouping, 0, wx.EXPAND, 0)
88 __szr_grid.Add(self._grid_substances, 1, wx.TOP|wx.EXPAND, 5)
89 __szr_main.Add(__szr_grid, 1, wx.EXPAND, 0)
90 __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
91 __szr_buttons.Add(self._BTN_add, 0, wx.RIGHT|wx.EXPAND, 5)
92 __szr_buttons.Add(self._BTN_edit, 0, wx.RIGHT|wx.EXPAND, 5)
93 __szr_buttons.Add(self._BTN_delete, 0, wx.RIGHT|wx.EXPAND, 5)
94 __szr_buttons.Add(self._BTN_allergy, 0, wx.RIGHT|wx.EXPAND, 5)
95 __szr_buttons.Add(self._BTN_info, 0, wx.EXPAND, 5)
96 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
97 __szr_buttons.Add(self._BTN_kidneys, 0, wx.ALIGN_CENTER_VERTICAL, 0)
98 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
99 __szr_buttons.Add(self._BTN_interactions, 0, wx.RIGHT|wx.EXPAND, 5)
100 __szr_buttons.Add(self._BTN_print, 0, wx.EXPAND, 0)
101 __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
102 __szr_main.Add(__szr_buttons, 0, wx.TOP|wx.EXPAND, 5)
103 self.SetSizer(__szr_main)
104 __szr_main.Fit(self)
105
106
108 print "Event handler `_on_add_button_pressed' not implemented"
109 event.Skip()
110
112 print "Event handler `_on_delete_button_pressed' not implemented"
113 event.Skip()
114
116 print "Event handler `_on_print_button_pressed' not implemented"
117 event.Skip()
118
120 print "Event handler `_on_episode_grouping_selected' not implemented"
121 event.Skip()
122
124 print "Event handler `_on_brand_grouping_selected' not implemented"
125 event.Skip()
126
128 print "Event handler `_on_show_unapproved_checked' not implemented"
129 event.Skip()
130
132 print "Event handler `_on_show_inactive_checked' not implemented"
133 event.Skip()
134
136 print "Event handler `_on_interactions_button_pressed' not implemented"
137 event.Skip()
138
140 print "Event handler `_on_edit_button_pressed' not implemented"
141 event.Skip()
142
144 print "Event handler `_on_info_button_pressed' not implemented"
145 event.Skip()
146
148 print "Event handler `_on_allergy_button_pressed' not implemented"
149 event.Skip()
150
152 print "Event handler `_on_button_kidneys_pressed' not implemented"
153 event.Skip()
154
155
156