1
2
3
4
5 import wx
6
7
8
9
10
11
14
15 from Gnumed.wxpython import gmProviderInboxWidgets
16 from Gnumed.wxpython import gmPatSearchWidgets
17
18
19 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
20 wx.ScrolledWindow.__init__(self, *args, **kwds)
21 self._TCTRL_subject = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
22 self._PRW_type = gmProviderInboxWidgets.cMessageTypePhraseWheel(self, -1, "", style=wx.NO_BORDER)
23 self._CHBOX_send_to_me = wx.CheckBox(self, -1, _(u"&Myself … or:"))
24 self._PRW_receiver = gmProviderInboxWidgets.cProviderPhraseWheel(self, -1, "", style=wx.NO_BORDER)
25 self._CHBOX_active_patient = wx.CheckBox(self, -1, _(u"&Active … or:"))
26 self._PRW_patient = gmPatSearchWidgets.cPersonSearchCtrl(self, -1, "", style=wx.NO_BORDER)
27 self._TCTRL_message = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.NO_BORDER)
28 self._RBTN_normal = wx.RadioButton(self, -1, _("Normal"))
29 self._RBTN_high = wx.RadioButton(self, -1, _("High"))
30 self._RBTN_low = wx.RadioButton(self, -1, _("Low"))
31
32 self.__set_properties()
33 self.__do_layout()
34
35 self.Bind(wx.EVT_CHECKBOX, self._on_send_to_me_checked, self._CHBOX_send_to_me)
36 self.Bind(wx.EVT_CHECKBOX, self._on_active_patient_checked, self._CHBOX_active_patient)
37
38
40
41 self.SetScrollRate(10, 10)
42 self._TCTRL_subject.SetToolTipString(_("What this message is about."))
43 self._PRW_type.SetToolTipString(_("The message type."))
44 self._CHBOX_send_to_me.SetToolTipString(_("Check if this message should (also) be sent to yourself."))
45 self._CHBOX_send_to_me.SetValue(1)
46 self._PRW_receiver.SetToolTipString(_("Whom to (also) send this message to."))
47 self._CHBOX_active_patient.SetToolTipString(_("Check this if this is about the active patient."))
48 self._CHBOX_active_patient.SetValue(1)
49 self._PRW_patient.Enable(False)
50 self._TCTRL_message.SetToolTipString(_("A longer text detailing the message, if needed."))
51 self._RBTN_normal.SetToolTipString(_("Normal (standard) urgency of message."))
52 self._RBTN_normal.SetValue(1)
53 self._RBTN_high.SetToolTipString(_("Higher than normal (standard) urgency of message."))
54 self._RBTN_low.SetToolTipString(_("Lower than normal (standard) urgency of message."))
55
56
58
59 _gszr_main = wx.FlexGridSizer(6, 2, 1, 3)
60 __szr_importance = wx.BoxSizer(wx.HORIZONTAL)
61 __szr_patient = wx.BoxSizer(wx.HORIZONTAL)
62 __szr_send_to = wx.BoxSizer(wx.HORIZONTAL)
63 __lbl_subject = wx.StaticText(self, -1, _("Subject"))
64 __lbl_subject.SetForegroundColour(wx.Colour(255, 0, 0))
65 _gszr_main.Add(__lbl_subject, 0, wx.ALIGN_CENTER_VERTICAL, 0)
66 _gszr_main.Add(self._TCTRL_subject, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
67 __lbl_category = wx.StaticText(self, -1, _("Category"))
68 __lbl_category.SetForegroundColour(wx.Colour(255, 0, 0))
69 _gszr_main.Add(__lbl_category, 0, wx.ALIGN_CENTER_VERTICAL, 0)
70 _gszr_main.Add(self._PRW_type, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
71 __lbl_receiver = wx.StaticText(self, -1, _("Audience"))
72 __lbl_receiver.SetForegroundColour(wx.Colour(255, 127, 0))
73 _gszr_main.Add(__lbl_receiver, 0, wx.ALIGN_CENTER_VERTICAL, 0)
74 __szr_send_to.Add(self._CHBOX_send_to_me, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
75 __szr_send_to.Add(self._PRW_receiver, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
76 _gszr_main.Add(__szr_send_to, 1, wx.EXPAND, 0)
77 __lbl_patient = wx.StaticText(self, -1, _("Patient"))
78 __lbl_patient.SetForegroundColour(wx.Colour(255, 127, 0))
79 _gszr_main.Add(__lbl_patient, 0, wx.ALIGN_CENTER_VERTICAL, 0)
80 __szr_patient.Add(self._CHBOX_active_patient, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
81 __szr_patient.Add(self._PRW_patient, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
82 _gszr_main.Add(__szr_patient, 1, wx.EXPAND, 0)
83 __lbl_message = wx.StaticText(self, -1, _("Message"))
84 _gszr_main.Add(__lbl_message, 0, wx.TOP, 3)
85 _gszr_main.Add(self._TCTRL_message, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
86 __lbl_urgency = wx.StaticText(self, -1, _("Urgency"))
87 _gszr_main.Add(__lbl_urgency, 0, wx.ALIGN_CENTER_VERTICAL, 0)
88 __szr_importance.Add(self._RBTN_normal, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
89 __szr_importance.Add(self._RBTN_high, 0, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
90 __szr_importance.Add(self._RBTN_low, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
91 __szr_importance.Add((20, 20), 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
92 _gszr_main.Add(__szr_importance, 1, wx.EXPAND, 0)
93 self.SetSizer(_gszr_main)
94 _gszr_main.Fit(self)
95 _gszr_main.AddGrowableRow(4)
96 _gszr_main.AddGrowableCol(1)
97
98
100 print "Event handler `_on_active_patient_checked' not implemented!"
101 event.Skip()
102
104 print "Event handler `_on_send_to_me_checked' not implemented"
105 event.Skip()
106
107
108