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

# Source Code for Module Gnumed.wxGladeWidgets.wxgCurrentSubstancesPnl

      1  # -*- coding: UTF-8 -*-
      2  #
      3  # generated by wxGlade
      4  #
      5
      6  import wx
      7  import wx.grid
      8
      9  # begin wxGlade: dependencies
     10  import gettext
     11  # end wxGlade
     12
     13  # begin wxGlade: extracode
     14  from Gnumed.wxpython.gmMedicationWidgets import cCurrentSubstancesGrid
     15  # end wxGlade
     16
     17
     18 -class wxgCurrentSubstancesPnl(wx.ScrolledWindow):
     19 -        def __init__(self, *args, **kwds):
     20                  # begin wxGlade: wxgCurrentSubstancesPnl.__init__
     21                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
     22                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     23                  self._HLINE_lab = wx.StaticLine(self, wx.ID_ANY)
     24                  self._CHCE_grouping = wx.Choice(self, wx.ID_ANY, choices=[_("einlangerstring einlangerstring")])
     25                  self._CHBOX_show_inactive = wx.CheckBox(self, wx.ID_ANY, _("Inactive"))
     26                  self._CHBOX_show_unapproved = wx.CheckBox(self, wx.ID_ANY, _("Unapproved"))
     27                  self._grid_substances = cCurrentSubstancesGrid(self, wx.ID_ANY, size=(1, 1))
     28                  self._BTN_add = wx.Button(self, wx.ID_ADD, "", style=wx.BU_EXACTFIT)
     29                  self._BTN_edit = wx.Button(self, wx.ID_ANY, _("&Edit"), style=wx.BU_EXACTFIT)
     30                  self._BTN_delete = wx.Button(self, wx.ID_DELETE, "", style=wx.BU_EXACTFIT)
     31                  self._BTN_allergy = wx.Button(self, wx.ID_ANY, _("Allergy"), style=wx.BU_EXACTFIT)
     32                  self._BTN_info = wx.Button(self, wx.ID_ANY, _("Info"), style=wx.BU_EXACTFIT)
     33                  self._BTN_heart = wx.Button(self, wx.ID_ANY, _(u"\u2665"), style=wx.BU_EXACTFIT)
     34                  self._BTN_kidneys = wx.Button(self, wx.ID_ANY, _("Kidney"), style=wx.BU_EXACTFIT)
     35                  self._LBL_gfr = wx.StaticText(self, wx.ID_ANY, _("GFR: ?"))
     36                  self._BTN_interactions = wx.Button(self, wx.ID_ANY, _("&Interactions?"), style=wx.BU_EXACTFIT)
     37                  self._BTN_rx = wx.Button(self, wx.ID_ANY, _(u"\u211e"), style=wx.BU_EXACTFIT)
     38                  self._BTN_adr = wx.Button(self, wx.ID_ANY, _("ADR"), style=wx.BU_EXACTFIT)
     39                  self._BTN_print = wx.Button(self, wx.ID_PRINT, "", style=wx.BU_EXACTFIT)
     40
     41                  self.__set_properties()
     42                  self.__do_layout()
     43
     44                  self.Bind(wx.EVT_CHOICE, self._on_grouping_selected, self._CHCE_grouping)
     45                  self.Bind(wx.EVT_CHECKBOX, self._on_show_inactive_checked, self._CHBOX_show_inactive)
     46                  self.Bind(wx.EVT_CHECKBOX, self._on_show_unapproved_checked, self._CHBOX_show_unapproved)
     47                  self.Bind(wx.EVT_BUTTON, self._on_add_button_pressed, self._BTN_add)
     48                  self.Bind(wx.EVT_BUTTON, self._on_edit_button_pressed, self._BTN_edit)
     49                  self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._BTN_delete)
     50                  self.Bind(wx.EVT_BUTTON, self._on_allergy_button_pressed, self._BTN_allergy)
     51                  self.Bind(wx.EVT_BUTTON, self._on_info_button_pressed, self._BTN_info)
     52                  self.Bind(wx.EVT_BUTTON, self._on_button_heart_pressed, self._BTN_heart)
     53                  self.Bind(wx.EVT_BUTTON, self._on_button_kidneys_pressed, self._BTN_kidneys)
     54                  self.Bind(wx.EVT_BUTTON, self._on_interactions_button_pressed, self._BTN_interactions)
     55                  self.Bind(wx.EVT_BUTTON, self._on_rx_button_pressed, self._BTN_rx)
     56                  self.Bind(wx.EVT_BUTTON, self._on_adr_button_pressed, self._BTN_adr)
     57                  self.Bind(wx.EVT_BUTTON, self._on_print_button_pressed, self._BTN_print)
     58                  # end wxGlade
     59
     60 -        def __set_properties(self):
     61                  # begin wxGlade: wxgCurrentSubstancesPnl.__set_properties
     62                  self.SetScrollRate(10, 10)
     63                  self._HLINE_lab.Hide()
     64                  self._CHCE_grouping.SetSelection(0)
     65                  self._CHBOX_show_inactive.SetToolTip(_("Whether to show inactive substances, too, or only those which are assumed to currently be active."))
     66                  self._CHBOX_show_inactive.SetValue(1)
     67                  self._CHBOX_show_unapproved.SetToolTip(_("Whether to show all substances or only those the intake of which is approved of."))
     68                  self._CHBOX_show_unapproved.SetValue(1)
     69                  self._BTN_add.SetToolTip(_("Add a substance."))
     70                  self._BTN_edit.SetToolTip(_("Edit the selected substance intake entry."))
     71                  self._BTN_delete.SetToolTip(_("Remove a substance from the list."))
     72                  self._BTN_allergy.SetToolTip(_("Discontinue selected entry due to an allergy or intolerance."))
     73                  self._BTN_info.SetToolTip(_("Show in-depth information on the selected substance if available."))
     74                  self._BTN_heart.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
     75                  self._BTN_heart.SetToolTip(_("Information on handling drugs in the presence of long Qt syndrome (%s)."))
     76                  self._BTN_kidneys.SetToolTip(_("Information on handling of drugs / the selected drug in the presence of renal insufficiency (%s)."))
     77                  self._BTN_interactions.SetToolTip(_("Check for interactions between selected drugs.\n\nIncludes all drugs if none selected."))
     78                  self._BTN_rx.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
     79                  self._BTN_rx.SetToolTip(_("Write a prescription based on either of\n\n- the selected lines\n- a copy of the most recent prescription"))
     80                  self._BTN_adr.SetToolTip(_("Report an Adverse Drug Reaction."))
     81                  self._BTN_print.SetToolTip(_("Print the medication list."))
     82                  # end wxGlade
     83
     84 -        def __do_layout(self):
     85                  # begin wxGlade: wxgCurrentSubstancesPnl.__do_layout
     86                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     87                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     88                  __szr_grid = wx.BoxSizer(wx.HORIZONTAL)
     89                  __szr_grouping = wx.BoxSizer(wx.HORIZONTAL)
     90                  self._GSZR_lab = wx.GridSizer(0, 5, 2, 3)
     91                  self._GSZR_lab.Add((0, 0), 0, 0, 0)
     92                  self._GSZR_lab.Add((0, 0), 0, 0, 0)
     93                  self._GSZR_lab.Add((0, 0), 0, 0, 0)
     94                  __szr_main.Add(self._GSZR_lab, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 3)
     95                  __szr_main.Add(self._HLINE_lab, 0, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.EXPAND | wx.TOP, 2)
     96                  __lbl_group = wx.StaticText(self, wx.ID_ANY, _("Sort by:"))
     97                  __szr_grouping.Add(__lbl_group, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     98                  __szr_grouping.Add(self._CHCE_grouping, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     99                  __SLINE_grouping = wx.StaticLine(self, wx.ID_ANY, style=wx.LI_VERTICAL)
    100                  __szr_grouping.Add(__SLINE_grouping, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
    101                  __lbl_filter = wx.StaticText(self, wx.ID_ANY, _("Include:"))
    102                  __szr_grouping.Add(__lbl_filter, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    103                  __szr_grouping.Add(self._CHBOX_show_inactive, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    104                  __szr_grouping.Add(self._CHBOX_show_unapproved, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
    105                  __szr_grouping.Add((20, 20), 1, wx.EXPAND, 0)
    106                  __szr_main.Add(__szr_grouping, 0, wx.EXPAND, 0)
    107                  __szr_grid.Add(self._grid_substances, 1, wx.EXPAND | wx.TOP, 5)
    108                  __szr_main.Add(__szr_grid, 1, wx.EXPAND, 0)
    109                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    110                  __szr_buttons.Add(self._BTN_add, 0, wx.EXPAND | wx.RIGHT, 5)
    111                  __szr_buttons.Add(self._BTN_edit, 0, wx.EXPAND | wx.RIGHT, 5)
    112                  __szr_buttons.Add(self._BTN_delete, 0, wx.EXPAND | wx.RIGHT, 5)
    113                  __szr_buttons.Add(self._BTN_allergy, 0, wx.EXPAND | wx.RIGHT, 5)
    114                  __szr_buttons.Add(self._BTN_info, 0, wx.EXPAND, 5)
    115                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    116                  __szr_buttons.Add(self._BTN_heart, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    117                  __szr_buttons.Add(self._BTN_kidneys, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    118                  __szr_buttons.Add(self._LBL_gfr, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    119                  __szr_buttons.Add(self._BTN_interactions, 0, wx.ALIGN_CENTER_VERTICAL, 5)
    120                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    121                  __szr_buttons.Add(self._BTN_rx, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    122                  __szr_buttons.Add(self._BTN_adr, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    123                  __szr_buttons.Add(self._BTN_print, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    124                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    125                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.TOP, 5)
    126                  self.SetSizer(__szr_main)
    127                  __szr_main.Fit(self)
    128                  self.Layout()
    129                  # end wxGlade
    130
    131 -        def _on_grouping_selected(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    132                  print("Event handler '_on_grouping_selected' not implemented!")
    133                  event.Skip()
    134
    135 -        def _on_show_inactive_checked(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    136                  print("Event handler '_on_show_inactive_checked' not implemented!")
    137                  event.Skip()
    138
    139 -        def _on_show_unapproved_checked(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    140                  print("Event handler '_on_show_unapproved_checked' not implemented!")
    141                  event.Skip()
    142
    143 -        def _on_add_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    144                  print("Event handler '_on_add_button_pressed' not implemented!")
    145                  event.Skip()
    146
    147 -        def _on_edit_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    148                  print("Event handler '_on_edit_button_pressed' not implemented!")
    149                  event.Skip()
    150
    151 -        def _on_delete_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    152                  print("Event handler '_on_delete_button_pressed' not implemented!")
    153                  event.Skip()
    154
    155 -        def _on_allergy_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    156                  print("Event handler '_on_allergy_button_pressed' not implemented!")
    157                  event.Skip()
    158
    159 -        def _on_info_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    160                  print("Event handler '_on_info_button_pressed' not implemented!")
    161                  event.Skip()
    162
    163 -        def _on_button_heart_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    164                  print("Event handler '_on_button_heart_pressed' not implemented!")
    165                  event.Skip()
    166
    167 -        def _on_button_kidneys_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    168                  print("Event handler '_on_button_kidneys_pressed' not implemented!")
    169                  event.Skip()
    170
    171 -        def _on_interactions_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    172                  print("Event handler '_on_interactions_button_pressed' not implemented!")
    173                  event.Skip()
    174
    175 -        def _on_rx_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    176                  print("Event handler '_on_rx_button_pressed' not implemented!")
    177                  event.Skip()
    178
    179 -        def _on_adr_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    180                  print("Event handler '_on_adr_button_pressed' not implemented!")
    181                  event.Skip()
    182
    183 -        def _on_print_button_pressed(self, event):  # wxGlade: wxgCurrentSubstancesPnl.<event_handler>
    184                  print("Event handler '_on_print_button_pressed' not implemented!")
    185                  event.Skip()
    186
    187  # end of class wxgCurrentSubstancesPnl
    188