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

# Source Code for Module Gnumed.wxGladeWidgets.wxgSimpleSoapPluginPnl

      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 wxgSimpleSoapPluginPnl(wx.ScrolledWindow):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgSimpleSoapPluginPnl.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
     20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     21                  self.SetSize(wx.DLG_UNIT(self, wx.Size(400, 216)))
     22                  self._splitter_main = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_3D | wx.SP_BORDER)
     23                  self.__pnl_left = wx.Panel(self._splitter_main, wx.ID_ANY, style=wx.BORDER_NONE | wx.TAB_TRAVERSAL)
     24                  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     25                  self._LCTRL_problems = cReportListCtrl(self.__pnl_left, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_NO_HEADER | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     26                  self._BTN_add_problem = wx.Button(self.__pnl_left, wx.ID_ANY, _("&Add"), style=wx.BU_EXACTFIT)
     27                  self._BTN_edit_problem = wx.Button(self.__pnl_left, wx.ID_ANY, _("&Edit"), style=wx.BU_EXACTFIT)
     28                  self._BTN_delete_problem = wx.Button(self.__pnl_left, wx.ID_ANY, _("&Delete"), style=wx.BU_EXACTFIT)
     29                  from Gnumed.wxpython.gmTextCtrl import cTextCtrl
     30                  self._TCTRL_soap_problem = wx.TextCtrl(self.__pnl_left, wx.ID_ANY, _("<above, double-click problem to start entering SOAP note>"), style=wx.TE_READONLY)
     31                  self._TCTRL_soap = cTextCtrl(self.__pnl_left, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
     32                  self._BTN_save_soap = wx.Button(self.__pnl_left, wx.ID_ANY, _("&Save"), style=wx.BU_EXACTFIT)
     33                  self._BTN_clear_soap = wx.Button(self.__pnl_left, wx.ID_ANY, _("&Clear"), style=wx.BU_EXACTFIT)
     34                  self.__pnl_right = wx.Panel(self._splitter_main, wx.ID_ANY, style=wx.BORDER_NONE | wx.TAB_TRAVERSAL)
     35                  self._CHBOX_filter_by_problem = wx.CheckBox(self.__pnl_right, wx.ID_ANY, _("&Filter by problem"))
     36                  self._TCTRL_journal = wx.TextCtrl(self.__pnl_right, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
     37
     38                  self.__set_properties()
     39                  self.__do_layout()
     40
     41                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_list_item_selected, self._LCTRL_problems)
     42                  self.Bind(wx.EVT_BUTTON, self._on_add_problem_button_pressed, self._BTN_add_problem)
     43                  self.Bind(wx.EVT_BUTTON, self._on_edit_problem_button_pressed, self._BTN_edit_problem)
     44                  self.Bind(wx.EVT_BUTTON, self._on_delete_problem_button_pressed, self._BTN_delete_problem)
     45                  self.Bind(wx.EVT_BUTTON, self._on_save_soap_button_pressed, self._BTN_save_soap)
     46                  self.Bind(wx.EVT_BUTTON, self._on_clear_soap_button_pressed, self._BTN_clear_soap)
     47                  self.Bind(wx.EVT_CHECKBOX, self._on_filter_by_problem_checked, self._CHBOX_filter_by_problem)
     48                  # end wxGlade
     49
     50 -        def __set_properties(self):
     51                  # begin wxGlade: wxgSimpleSoapPluginPnl.__set_properties
     52                  self.SetSize(wx.DLG_UNIT(self, wx.Size(400, 216)))
     53                  self.SetScrollRate(10, 10)
     54                  self._BTN_add_problem.SetToolTip(_("Add a problem to the problem list."))
     55                  self._BTN_edit_problem.SetToolTip(_("Edit the selected problem."))
     56                  self._BTN_delete_problem.SetToolTip(_("Delete the selected problem (only possible as long as there are no SOAP notes for it)."))
     57                  self._TCTRL_soap_problem.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     58                  self._TCTRL_soap_problem.SetFont(wx.Font(8, wx.DEFAULT, wx.ITALIC, wx.NORMAL, 0, ""))
     59                  self._TCTRL_soap.SetToolTip(_("Enter your SOAP note here."))
     60                  self._BTN_save_soap.SetToolTip(_("Save the current SOAP note."))
     61                  self._BTN_clear_soap.SetToolTip(_("Clear the SOAP note."))
     62                  self._CHBOX_filter_by_problem.SetToolTip(_("Check this if you want to filter the journal by the problem selected on the left."))
     63                  self._CHBOX_filter_by_problem.SetValue(1)
     64                  self._TCTRL_journal.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     65                  self._splitter_main.SetMinimumPaneSize(20)
     66                  # end wxGlade
     67
     68 -        def __do_layout(self):
     69                  # begin wxGlade: wxgSimpleSoapPluginPnl.__do_layout
     70                  __szr_main = wx.BoxSizer(wx.HORIZONTAL)
     71                  __szr_right = wx.BoxSizer(wx.VERTICAL)
     72                  __szr_right_top = wx.BoxSizer(wx.HORIZONTAL)
     73                  __szr_left = wx.BoxSizer(wx.VERTICAL)
     74                  __szr_left_bottom_buttons = wx.BoxSizer(wx.HORIZONTAL)
     75                  __szr_left_middle_buttons = wx.BoxSizer(wx.HORIZONTAL)
     76                  __szr_left.Add(self._LCTRL_problems, 2, wx.BOTTOM | wx.EXPAND | wx.RIGHT, 2)
     77                  __szr_left_middle_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     78                  __szr_left_middle_buttons.Add(self._BTN_add_problem, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     79                  __szr_left_middle_buttons.Add(self._BTN_edit_problem, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     80                  __szr_left_middle_buttons.Add(self._BTN_delete_problem, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     81                  __szr_left_middle_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     82                  __szr_left.Add(__szr_left_middle_buttons, 0, wx.BOTTOM | wx.EXPAND | wx.RIGHT, 2)
     83                  __szr_left.Add(self._TCTRL_soap_problem, 0, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.EXPAND | wx.RIGHT, 2)
     84                  __szr_left.Add(self._TCTRL_soap, 3, wx.BOTTOM | wx.EXPAND | wx.RIGHT, 2)
     85                  __szr_left_bottom_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     86                  __szr_left_bottom_buttons.Add(self._BTN_save_soap, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
     87                  __szr_left_bottom_buttons.Add(self._BTN_clear_soap, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     88                  __szr_left_bottom_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     89                  __szr_left.Add(__szr_left_bottom_buttons, 0, wx.EXPAND | wx.RIGHT, 2)
     90                  self.__pnl_left.SetSizer(__szr_left)
     91                  __szr_right_top.Add(self._CHBOX_filter_by_problem, 1, wx.ALIGN_CENTER_VERTICAL, 0)
     92                  __szr_right.Add(__szr_right_top, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT, 2)
     93                  __szr_right.Add(self._TCTRL_journal, 1, wx.BOTTOM | wx.EXPAND | wx.LEFT, 2)
     94                  self.__pnl_right.SetSizer(__szr_right)
     95                  self._splitter_main.SplitVertically(self.__pnl_left, self.__pnl_right)
     96                  __szr_main.Add(self._splitter_main, 1, wx.ALL | wx.EXPAND, 2)
     97                  self.SetSizer(__szr_main)
     98                  self.Layout()
     99                  # end wxGlade
    100
    101 -        def _on_list_item_selected(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    102                  print("Event handler '_on_list_item_selected' not implemented!")
    103                  event.Skip()
    104
    105 -        def _on_add_problem_button_pressed(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    106                  print("Event handler '_on_add_problem_button_pressed' not implemented!")
    107                  event.Skip()
    108
    109 -        def _on_edit_problem_button_pressed(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    110                  print("Event handler '_on_edit_problem_button_pressed' not implemented!")
    111                  event.Skip()
    112
    113 -        def _on_delete_problem_button_pressed(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    114                  print("Event handler '_on_delete_problem_button_pressed' not implemented!")
    115                  event.Skip()
    116
    117 -        def _on_save_soap_button_pressed(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    118                  print("Event handler '_on_save_soap_button_pressed' not implemented!")
    119                  event.Skip()
    120
    121 -        def _on_clear_soap_button_pressed(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    122                  print("Event handler '_on_clear_soap_button_pressed' not implemented!")
    123                  event.Skip()
    124
    125 -        def _on_filter_by_problem_checked(self, event):  # wxGlade: wxgSimpleSoapPluginPnl.<event_handler>
    126                  print("Event handler '_on_filter_by_problem_checked' not implemented!")
    127                  event.Skip()
    128
    129  # end of class wxgSimpleSoapPluginPnl
    130