1
2
3
4
5 import wx
6
9
10 from Gnumed.wxpython import gmAllergyWidgets
11
12
13 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
14 wx.Dialog.__init__(self, *args, **kwds)
15 self._PNL_edit_area = gmAllergyWidgets.cAllergyEditAreaPnl(self, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
16 self._BTN_save = wx.Button(self, wx.ID_SAVE, "")
17 self._BTN_clear = wx.Button(self, wx.ID_CLEAR, "")
18 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
19
20 self.__set_properties()
21 self.__do_layout()
22
23 self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._BTN_save)
24 self.Bind(wx.EVT_BUTTON, self._on_clear_button_pressed, self._BTN_clear)
25
26
28
29 self.SetTitle(_("Edit Allergy/Intolerance"))
30 self.SetSize((400, 190))
31 self._BTN_save.SetToolTipString(_("Save the allergy/intolerance in the database."))
32 self._BTN_clear.SetToolTipString(_("Clear all fields or reset to database values."))
33 self._BTN_cancel.SetToolTipString(_("Cancel editing the allergy/intolerance."))
34 self._BTN_cancel.SetDefault()
35
36
38
39 __szr_main = wx.BoxSizer(wx.VERTICAL)
40 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
41 __szr_main.Add(self._PNL_edit_area, 1, wx.ALL|wx.EXPAND, 2)
42 __szr_buttons.Add(self._BTN_save, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
43 __szr_buttons.Add(self._BTN_clear, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
44 __szr_buttons.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
45 __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
46 __szr_main.Add(__szr_buttons, 0, wx.TOP|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 15)
47 self.SetSizer(__szr_main)
48 self.Layout()
49 self.Centre()
50
51
53 print "Event handler `_on_save_button_pressed' not implemented!"
54 event.Skip()
55
57 print "Event handler `_on_clear_button_pressed' not implemented!"
58 event.Skip()
59
61 print "Event handler `_on_cancel_button_pressed' not implemented!"
62 event.Skip()
63
64
65