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

# Source Code for Module Gnumed.wxGladeWidgets.wxgDynamicHintListDlg

      1  # -*- coding: UTF-8 -*-
      2  #
      3  # generated by wxGlade
      4  #
      5
      6  import wx
      7  import wx.adv
      8
      9  # begin wxGlade: dependencies
     10  import gettext
     11  # end wxGlade
     12
     13  # begin wxGlade: extracode
     14  from Gnumed.wxpython.gmTextCtrl import cTextCtrl
     15  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     16  # end wxGlade
     17
     18
     19 -class wxgDynamicHintListDlg(wx.Dialog):
     20 -        def __init__(self, *args, **kwds):
     21                  # begin wxGlade: wxgDynamicHintListDlg.__init__
     22                  kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
     23                  wx.Dialog.__init__(self, *args, **kwds)
     24                  self.SetSize((400, 615))
     25                  self._TCTRL_header = wx.TextCtrl(self, wx.ID_ANY, _("Dynamic hints"), style=wx.TE_CENTRE | wx.TE_READONLY)
     26                  self._LCTRL_hints = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_SIMPLE | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     27                  self._TCTRL_hint = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
     28                  self._TCTRL_source = wx.TextCtrl(self, wx.ID_ANY, _("<hint source>"), style=wx.TE_CENTRE | wx.TE_READONLY)
     29                  self._URL_info = wx.adv.HyperlinkCtrl(self, wx.ID_ANY, _("Further information"), _("http://www.duckduckgo.com"), style=wx.adv.HL_DEFAULT_STYLE)
     30                  self._TCTRL_rationale = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
     31                  self._LBL_previous_rationale = wx.StaticText(self, wx.ID_ANY, _("Previous\nrationale"))
     32                  self._TCTRL_previous_rationale = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
     33                  self._BTN_OK = wx.Button(self, wx.ID_OK, "")
     34                  self._BTN_suppress = wx.Button(self, wx.ID_ANY, _("&Suppress"))
     35                  self._BTN_manage_hints = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
     36
     37                  self.__set_properties()
     38                  self.__do_layout()
     39
     40                  self.Bind(wx.EVT_BUTTON, self._on_suppress_button_pressed, self._BTN_suppress)
     41                  self.Bind(wx.EVT_BUTTON, self._on_manage_hints_button_pressed, self._BTN_manage_hints)
     42                  # end wxGlade
     43
     44 -        def __set_properties(self):
     45                  # begin wxGlade: wxgDynamicHintListDlg.__set_properties
     46                  self.SetTitle(_("Dynamic hint"))
     47                  self.SetSize((400, 615))
     48                  self._TCTRL_header.SetBackgroundColour(wx.Colour(255, 0, 0))
     49                  self._TCTRL_header.SetForegroundColour(wx.Colour(255, 255, 0))
     50                  self._TCTRL_header.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
     51                  self._TCTRL_hint.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     52                  self._TCTRL_source.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     53                  self._URL_info.Enable(False)
     54                  self._TCTRL_rationale.SetToolTip(_("Enter a rationale for suppressing this hint."))
     55                  self._TCTRL_previous_rationale.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     56                  self._BTN_OK.SetToolTip(_("Dismiss this hint for now."))
     57                  self._BTN_OK.SetFocus()
     58                  self._BTN_suppress.SetToolTip(_("Suppress this hint in this patient (needs a rationale)."))
     59                  self._BTN_suppress.Enable(False)
     60                  self._BTN_manage_hints.SetToolTip(_("Manage dynamic hints."))
     61                  # end wxGlade
     62
     63 -        def __do_layout(self):
     64                  # begin wxGlade: wxgDynamicHintListDlg.__do_layout
     65                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     66                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     67                  __gszr_rationale = wx.FlexGridSizer(2, 2, 3, 5)
     68                  __szr_main.Add(self._TCTRL_header, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     69                  __szr_main.Add(self._LCTRL_hints, 1, wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, 3)
     70                  __szr_main.Add(self._TCTRL_hint, 1, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     71                  __szr_main.Add(self._TCTRL_source, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     72                  __szr_main.Add(self._URL_info, 0, wx.ALIGN_CENTER | wx.BOTTOM, 5)
     73                  __lbl_rationale = wx.StaticText(self, wx.ID_ANY, _("Rationale for\nsuppression\nfor this patient"))
     74                  __gszr_rationale.Add(__lbl_rationale, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     75                  __gszr_rationale.Add(self._TCTRL_rationale, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     76                  __gszr_rationale.Add(self._LBL_previous_rationale, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     77                  __gszr_rationale.Add(self._TCTRL_previous_rationale, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     78                  __gszr_rationale.AddGrowableRow(0)
     79                  __gszr_rationale.AddGrowableCol(1)
     80                  __szr_main.Add(__gszr_rationale, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     81                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     82                  __szr_buttons.Add(self._BTN_OK, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10)
     83                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     84                  __szr_buttons.Add(self._BTN_suppress, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     85                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     86                  __szr_buttons.Add(self._BTN_manage_hints, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     87                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     88                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     89                  self.SetSizer(__szr_main)
     90                  self.Layout()
     91                  # end wxGlade
     92
     93 -        def _on_suppress_button_pressed(self, event):  # wxGlade: wxgDynamicHintListDlg.<event_handler>
     94                  print("Event handler '_on_suppress_button_pressed' not implemented!")
     95                  event.Skip()
     96
     97 -        def _on_manage_hints_button_pressed(self, event):  # wxGlade: wxgDynamicHintListDlg.<event_handler>
     98                  print("Event handler '_on_manage_hints_button_pressed' not implemented!")
     99                  event.Skip()
    100
    101  # end of class wxgDynamicHintListDlg
    102