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

# Source Code for Module Gnumed.wxGladeWidgets.wxgProviderInboxPnl

      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  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     14  # end wxGlade
     15
     16
     17 -class wxgProviderInboxPnl(wx.ScrolledWindow):
     18 -        def __init__(self, *args, **kwds):
     19                  # begin wxGlade: wxgProviderInboxPnl.__init__
     20                  kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
     21                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     22                  self._msg_welcome = wx.StaticText(self, wx.ID_ANY, _("Programmer must override this text."))
     23                  self._RBTN_relevant_messages = wx.RadioButton(self, wx.ID_ANY, _("&Relevant"), style=wx.RB_GROUP)
     24                  self._RBTN_all_messages = wx.RadioButton(self, wx.ID_ANY, _("A&ll"))
     25                  self._RBTN_overdue_messages = wx.RadioButton(self, wx.ID_ANY, _("&Overdue"))
     26                  self._RBTN_scheduled_messages = wx.RadioButton(self, wx.ID_ANY, _("&Scheduled"))
     27                  self._RBTN_unscheduled_messages = wx.RadioButton(self, wx.ID_ANY, _("&Unscheduled"))
     28                  self._RBTN_expired_messages = wx.RadioButton(self, wx.ID_ANY, _("&Expired"))
     29                  self._CHBOX_active_patient = wx.CheckBox(self, wx.ID_ANY, _("Active patient"))
     30                  self._CHBOX_active_provider = wx.CheckBox(self, wx.ID_ANY, _("Yours"))
     31                  self._BTN_add = wx.Button(self, wx.ID_ANY, _("&Add"), style=wx.BU_EXACTFIT)
     32                  self._LCTRL_provider_inbox = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_SIMPLE | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     33                  self._TXT_inbox_item_comment = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.HSCROLL | wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
     34
     35                  self.__set_properties()
     36                  self.__do_layout()
     37
     38                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_relevant_messages)
     39                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_all_messages)
     40                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_overdue_messages)
     41                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_scheduled_messages)
     42                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_unscheduled_messages)
     43                  self.Bind(wx.EVT_RADIOBUTTON, self._on_message_range_radiobutton_selected, self._RBTN_expired_messages)
     44                  self.Bind(wx.EVT_CHECKBOX, self._on_active_patient_checkbox_ticked, self._CHBOX_active_patient)
     45                  self.Bind(wx.EVT_CHECKBOX, self._on_active_provider_checkbox_ticked, self._CHBOX_active_provider)
     46                  self.Bind(wx.EVT_BUTTON, self._on_add_button_pressed, self._BTN_add)
     47                  self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self._lst_item_activated, self._LCTRL_provider_inbox)
     48                  self.Bind(wx.EVT_LIST_ITEM_FOCUSED, self._lst_item_focused, self._LCTRL_provider_inbox)
     49                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._lst_item_selected, self._LCTRL_provider_inbox)
     50                  # end wxGlade
     51
     52 -        def __set_properties(self):
     53                  # begin wxGlade: wxgProviderInboxPnl.__set_properties
     54                  self.SetScrollRate(10, 10)
     55                  self._msg_welcome.SetFont(wx.Font(11, wx.DEFAULT, wx.ITALIC, wx.BOLD, 0, ""))
     56                  self._RBTN_relevant_messages.SetToolTip(_("Show relevant messages only (excludes expired and not-yet-due messages)."))
     57                  self._RBTN_relevant_messages.SetValue(1)
     58                  self._RBTN_all_messages.SetToolTip(_("Show all (but expired) messages."))
     59                  self._RBTN_overdue_messages.SetToolTip(_("Show overdue messages only."))
     60                  self._RBTN_scheduled_messages.SetToolTip(_("Show scheduled (future-due) messages only."))
     61                  self._RBTN_unscheduled_messages.SetToolTip(_("Show unscheduled (no due date) messages only."))
     62                  self._RBTN_expired_messages.SetToolTip(_("Show expired (expiry date has passed) messages only."))
     63                  self._CHBOX_active_patient.SetToolTip(_("Include only messages about the active patient."))
     64                  self._CHBOX_active_patient.Enable(False)
     65                  self._CHBOX_active_provider.SetToolTip(_("Include only messages explicitely for you (rather than also to all providers)."))
     66                  self._CHBOX_active_provider.SetValue(1)
     67                  self._BTN_add.SetToolTip(_("Add a new message."))
     68                  self._LCTRL_provider_inbox.SetFocus()
     69                  # end wxGlade
     70
     71 -        def __do_layout(self):
     72                  # begin wxGlade: wxgProviderInboxPnl.__do_layout
     73                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     74                  __szr_items = wx.BoxSizer(wx.HORIZONTAL)
     75                  __szr_main.Add(self._msg_welcome, 0, 0, 0)
     76                  __line_top = wx.StaticLine(self, wx.ID_ANY)
     77                  __szr_main.Add(__line_top, 0, wx.BOTTOM | wx.EXPAND | wx.TOP, 5)
     78                  __lbl_items = wx.StaticText(self, wx.ID_ANY, _("Messages:"))
     79                  __szr_items.Add(__lbl_items, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 3)
     80                  __szr_items.Add(self._RBTN_relevant_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     81                  __szr_items.Add(self._RBTN_all_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     82                  __szr_items.Add(self._RBTN_overdue_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     83                  __szr_items.Add(self._RBTN_scheduled_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     84                  __szr_items.Add(self._RBTN_unscheduled_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     85                  __szr_items.Add(self._RBTN_expired_messages, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
     86                  __vline1_options = wx.StaticLine(self, wx.ID_ANY, style=wx.LI_VERTICAL)
     87                  __szr_items.Add(__vline1_options, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     88                  __lbl_audience = wx.StaticText(self, wx.ID_ANY, _("Limit to:"))
     89                  __szr_items.Add(__lbl_audience, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     90                  __szr_items.Add(self._CHBOX_active_patient, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     91                  __szr_items.Add(self._CHBOX_active_provider, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 3)
     92                  __vline2_options = wx.StaticLine(self, wx.ID_ANY, style=wx.LI_VERTICAL)
     93                  __szr_items.Add(__vline2_options, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     94                  __szr_items.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     95                  __szr_items.Add(self._BTN_add, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     96                  __szr_main.Add(__szr_items, 0, wx.BOTTOM | wx.EXPAND, 5)
     97                  __szr_main.Add(self._LCTRL_provider_inbox, 3, wx.EXPAND, 0)
     98                  __szr_main.Add(self._TXT_inbox_item_comment, 2, wx.EXPAND, 0)
     99                  self.SetSizer(__szr_main)
    100                  __szr_main.Fit(self)
    101                  self.Layout()
    102                  # end wxGlade
    103
    104 -        def _on_message_range_radiobutton_selected(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    105                  print("Event handler '_on_message_range_radiobutton_selected' not implemented!")
    106                  event.Skip()
    107
    108 -        def _on_active_patient_checkbox_ticked(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    109                  print("Event handler '_on_active_patient_checkbox_ticked' not implemented!")
    110                  event.Skip()
    111
    112 -        def _on_active_provider_checkbox_ticked(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    113                  print("Event handler '_on_active_provider_checkbox_ticked' not implemented!")
    114                  event.Skip()
    115
    116 -        def _on_add_button_pressed(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    117                  print("Event handler '_on_add_button_pressed' not implemented!")
    118                  event.Skip()
    119
    120 -        def _lst_item_activated(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    121                  print("Event handler '_lst_item_activated' not implemented!")
    122                  event.Skip()
    123
    124 -        def _lst_item_focused(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    125                  print("Event handler '_lst_item_focused' not implemented!")
    126                  event.Skip()
    127
    128 -        def _lst_item_selected(self, event):  # wxGlade: wxgProviderInboxPnl.<event_handler>
    129                  print("Event handler '_lst_item_selected' not implemented!")
    130                  event.Skip()
    131
    132  # end of class wxgProviderInboxPnl
    133