Package Gnumed :: Package wxGladeWidgets :: Module wxgInboxMessageEAPnl |
[frames] | no frames]

# Source Code for Module Gnumed.wxGladeWidgets.wxgInboxMessageEAPnl

      1  # -*- coding: UTF-8 -*-
      2  #
      3  # generated by wxGlade
      4  #
      5
      6  import wx
      7
      8  # begin wxGlade: dependencies
      9  import gettext
     10  # end wxGlade
     11
     12  # begin wxGlade: extracode
     13  # end wxGlade
     14
     15
     16 -class wxgInboxMessageEAPnl(wx.ScrolledWindow):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgInboxMessageEAPnl.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
     20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     21                  self._TCTRL_subject = wx.TextCtrl(self, wx.ID_ANY, "")
     22                  from Gnumed.wxpython.gmProviderInboxWidgets import cMessageTypePhraseWheel
     23                  self._PRW_type = cMessageTypePhraseWheel(self, wx.ID_ANY, "")
     24                  self._CHBOX_send_to_me = wx.CheckBox(self, wx.ID_ANY, _(u"&Myself \u2026 or:"))
     25                  from Gnumed.wxpython.gmStaffWidgets import cProviderPhraseWheel
     26                  self._PRW_receiver = cProviderPhraseWheel(self, wx.ID_ANY, "")
     27                  self._CHBOX_active_patient = wx.CheckBox(self, wx.ID_ANY, _(u"&Active \u2026 or:"))
     28                  from Gnumed.wxpython.gmPatSearchWidgets import cPersonSearchCtrl
     29                  self._PRW_patient = cPersonSearchCtrl(self, wx.ID_ANY, "")
     30                  self._TCTRL_message = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
     31                  from Gnumed.wxpython.gmDateTimeInput import cDateInputPhraseWheel
     32                  self._PRW_due = cDateInputPhraseWheel(self, wx.ID_ANY, "")
     33                  self._PRW_expiry = cDateInputPhraseWheel(self, wx.ID_ANY, "")
     34                  self._RBTN_normal = wx.RadioButton(self, wx.ID_ANY, _("Normal"))
     35                  self._RBTN_high = wx.RadioButton(self, wx.ID_ANY, _("High"))
     36                  self._RBTN_low = wx.RadioButton(self, wx.ID_ANY, _("Low"))
     37
     38                  self.__set_properties()
     39                  self.__do_layout()
     40
     41                  self.Bind(wx.EVT_CHECKBOX, self._on_send_to_me_checked, self._CHBOX_send_to_me)
     42                  self.Bind(wx.EVT_CHECKBOX, self._on_active_patient_checked, self._CHBOX_active_patient)
     43                  # end wxGlade
     44
     45 -        def __set_properties(self):
     46                  # begin wxGlade: wxgInboxMessageEAPnl.__set_properties
     47                  self.SetScrollRate(10, 10)
     48                  self._TCTRL_subject.SetToolTip(_("What this message is about."))
     49                  self._PRW_type.SetToolTip(_("The message type."))
     50                  self._CHBOX_send_to_me.SetToolTip(_("Check if this message should (also) be sent to yourself."))
     51                  self._CHBOX_send_to_me.SetValue(1)
     52                  self._PRW_receiver.SetToolTip(_("Whom to (also) send this message to."))
     53                  self._CHBOX_active_patient.SetToolTip(_("Check this if this is about the active patient."))
     54                  self._CHBOX_active_patient.SetValue(1)
     55                  self._PRW_patient.Enable(False)
     56                  self._TCTRL_message.SetToolTip(_("A longer text detailing the message, if needed."))
     57                  self._PRW_due.SetToolTip(_("Optional: Pick a date when this message is due to be acted on."))
     58                  self._PRW_expiry.SetToolTip(_("Optional: Pick a date when this message will no longer be relevant."))
     59                  self._RBTN_normal.SetToolTip(_("Normal (standard) urgency of message."))
     60                  self._RBTN_normal.SetValue(1)
     61                  self._RBTN_high.SetToolTip(_("Higher than normal (standard) urgency of message."))
     62                  self._RBTN_low.SetToolTip(_("Lower than normal (standard) urgency of message."))
     63                  # end wxGlade
     64
     65 -        def __do_layout(self):
     66                  # begin wxGlade: wxgInboxMessageEAPnl.__do_layout
     67                  _gszr_main = wx.FlexGridSizer(8, 2, 1, 3)
     68                  __szr_importance = wx.BoxSizer(wx.HORIZONTAL)
     69                  __szr_patient = wx.BoxSizer(wx.HORIZONTAL)
     70                  __szr_send_to = wx.BoxSizer(wx.HORIZONTAL)
     71                  __lbl_subject = wx.StaticText(self, wx.ID_ANY, _("Subject"))
     72                  __lbl_subject.SetForegroundColour(wx.Colour(255, 0, 0))
     73                  _gszr_main.Add(__lbl_subject, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     74                  _gszr_main.Add(self._TCTRL_subject, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     75                  __lbl_category = wx.StaticText(self, wx.ID_ANY, _("Category"))
     76                  __lbl_category.SetForegroundColour(wx.Colour(255, 0, 0))
     77                  _gszr_main.Add(__lbl_category, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     78                  _gszr_main.Add(self._PRW_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     79                  __lbl_receiver = wx.StaticText(self, wx.ID_ANY, _("Audience"))
     80                  __lbl_receiver.SetForegroundColour(wx.Colour(255, 127, 0))
     81                  _gszr_main.Add(__lbl_receiver, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     82                  __szr_send_to.Add(self._CHBOX_send_to_me, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     83                  __szr_send_to.Add(self._PRW_receiver, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     84                  _gszr_main.Add(__szr_send_to, 1, wx.EXPAND, 0)
     85                  __lbl_patient = wx.StaticText(self, wx.ID_ANY, _("Patient"))
     86                  __lbl_patient.SetForegroundColour(wx.Colour(255, 127, 0))
     87                  _gszr_main.Add(__lbl_patient, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     88                  __szr_patient.Add(self._CHBOX_active_patient, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     89                  __szr_patient.Add(self._PRW_patient, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     90                  _gszr_main.Add(__szr_patient, 1, wx.EXPAND, 0)
     91                  __lbl_message = wx.StaticText(self, wx.ID_ANY, _("Message"))
     92                  _gszr_main.Add(__lbl_message, 0, wx.TOP, 3)
     93                  _gszr_main.Add(self._TCTRL_message, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     94                  __lbl_due = wx.StaticText(self, wx.ID_ANY, _("Due"))
     95                  _gszr_main.Add(__lbl_due, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     96                  _gszr_main.Add(self._PRW_due, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     97                  __lbl_expires = wx.StaticText(self, wx.ID_ANY, _("Expires"))
     98                  _gszr_main.Add(__lbl_expires, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     99                  _gszr_main.Add(self._PRW_expiry, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    100                  __lbl_urgency = wx.StaticText(self, wx.ID_ANY, _("Urgency"))
    101                  _gszr_main.Add(__lbl_urgency, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    102                  __szr_importance.Add(self._RBTN_normal, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    103                  __szr_importance.Add(self._RBTN_high, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    104                  __szr_importance.Add(self._RBTN_low, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    105                  __szr_importance.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    106                  _gszr_main.Add(__szr_importance, 1, wx.EXPAND, 0)
    107                  self.SetSizer(_gszr_main)
    108                  _gszr_main.Fit(self)
    109                  _gszr_main.AddGrowableRow(4)
    110                  _gszr_main.AddGrowableCol(1)
    111                  self.Layout()
    112                  # end wxGlade
    113
    114 -        def _on_send_to_me_checked(self, event):  # wxGlade: wxgInboxMessageEAPnl.<event_handler>
    115                  print("Event handler '_on_send_to_me_checked' not implemented!")
    116                  event.Skip()
    117
    118 -        def _on_active_patient_checked(self, event):  # wxGlade: wxgInboxMessageEAPnl.<event_handler>
    119                  print("Event handler '_on_active_patient_checked' not implemented!")
    120                  event.Skip()
    121
    122  # end of class wxgInboxMessageEAPnl
    123