Gnumed.wxGladeWidgets.wxgDynamicHintDlg

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgDynamicHintDlg

      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  # end wxGlade
     16
     17
     18 -class wxgDynamicHintDlg(wx.Dialog):
     19 -        def __init__(self, *args, **kwds):
     20                  # begin wxGlade: wxgDynamicHintDlg.__init__
     21                  kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
     22                  wx.Dialog.__init__(self, *args, **kwds)
     23                  self.SetSize((400, 400))
     24                  self._TCTRL_title = wx.TextCtrl(self, wx.ID_ANY, _("<hint title>"), style=wx.TE_CENTRE | wx.TE_READONLY)
     25                  self._TCTRL_hint = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_WORDWRAP)
     26                  self._TCTRL_source = wx.TextCtrl(self, wx.ID_ANY, _("<hint source>"), style=wx.TE_CENTRE | wx.TE_READONLY)
     27                  self._URL_info = wx.adv.HyperlinkCtrl(self, wx.ID_ANY, _("Further information"), _("http://www.duckduckgo.com"), style=wx.adv.HL_DEFAULT_STYLE)
     28                  self._TCTRL_rationale = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_WORDWRAP)
     29                  self._LBL_previous_rationale = wx.StaticText(self, wx.ID_ANY, _("Previous\nrationale"))
     30                  self._TCTRL_previous_rationale = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
     31                  self._BTN_transfer_previous_rationale = wx.Button(self, wx.ID_ANY, _(u"\u2934"), style=wx.BU_EXACTFIT)
     32                  self._BTN_OK = wx.Button(self, wx.ID_OK, "")
     33                  self._BTN_suppress = wx.Button(self, wx.ID_ANY, _("&Suppress"))
     34                  self._BTN_manage_hints = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
     35
     36                  self.__set_properties()
     37                  self.__do_layout()
     38
     39                  self.Bind(wx.EVT_BUTTON, self._on_transfer_previous_rationale_button_pressed, self._BTN_transfer_previous_rationale)
     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: wxgDynamicHintDlg.__set_properties
     46                  self.SetTitle(_("Dynamic hint"))
     47                  self.SetSize((400, 400))
     48                  self._TCTRL_title.SetBackgroundColour(wx.Colour(255, 0, 0))
     49                  self._TCTRL_title.SetForegroundColour(wx.Colour(255, 255, 0))
     50                  self._TCTRL_title.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_transfer_previous_rationale.SetFont(wx.Font(15, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, ""))
     57                  self._BTN_transfer_previous_rationale.Enable(False)
     58                  self._BTN_OK.SetToolTip(_("Dismiss this hint for now."))
     59                  self._BTN_OK.SetFocus()
     60                  self._BTN_suppress.SetToolTip(_("Suppress this hint in this patient (needs a rationale)."))
     61                  self._BTN_suppress.Enable(False)
     62                  self._BTN_manage_hints.SetToolTip(_("Manage dynamic hints."))
     63                  # end wxGlade
     64
     65 -        def __do_layout(self):
     66                  # begin wxGlade: wxgDynamicHintDlg.__do_layout
     67                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     68                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     69                  __gszr_rationale = wx.FlexGridSizer(2, 2, 3, 5)
     70                  __szr_prev_rationale = wx.BoxSizer(wx.HORIZONTAL)
     71                  __szr_main.Add(self._TCTRL_title, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     72                  __szr_main.Add(self._TCTRL_hint, 1, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     73                  __szr_main.Add(self._TCTRL_source, 0, wx.BOTTOM | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     74                  __szr_main.Add(self._URL_info, 0, wx.ALIGN_CENTER | wx.BOTTOM, 5)
     75                  __lbl_rationale = wx.StaticText(self, wx.ID_ANY, _("Rationale for\nsuppression\nin this patient"))
     76                  __gszr_rationale.Add(__lbl_rationale, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     77                  __gszr_rationale.Add(self._TCTRL_rationale, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     78                  __gszr_rationale.Add(self._LBL_previous_rationale, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     79                  __szr_prev_rationale.Add(self._TCTRL_previous_rationale, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     80                  __szr_prev_rationale.Add(self._BTN_transfer_previous_rationale, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     81                  __gszr_rationale.Add(__szr_prev_rationale, 1, wx.EXPAND, 0)
     82                  __gszr_rationale.AddGrowableRow(0)
     83                  __gszr_rationale.AddGrowableCol(1)
     84                  __szr_main.Add(__gszr_rationale, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT, 3)
     85                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     86                  __szr_buttons.Add(self._BTN_OK, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10)
     87                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     88                  __szr_buttons.Add(self._BTN_suppress, 0, wx.ALIGN_CENTER_VERTICAL, 5)
     89                  __szr_buttons.Add((20, 20), 2, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     90                  __szr_buttons.Add(self._BTN_manage_hints, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     91                  __szr_buttons.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     92                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
     93                  self.SetSizer(__szr_main)
     94                  self.Layout()
     95                  # end wxGlade
     96
     97 -        def _on_transfer_previous_rationale_button_pressed(self, event):  # wxGlade: wxgDynamicHintDlg.<event_handler>
     98                  print("Event handler '_on_transfer_previous_rationale_button_pressed' not implemented!")
     99                  event.Skip()
    100
    101 -        def _on_suppress_button_pressed(self, event):  # wxGlade: wxgDynamicHintDlg.<event_handler>
    102                  print("Event handler '_on_suppress_button_pressed' not implemented!")
    103                  event.Skip()
    104
    105 -        def _on_manage_hints_button_pressed(self, event):  # wxGlade: wxgDynamicHintDlg.<event_handler>
    106                  print("Event handler '_on_manage_hints_button_pressed' not implemented!")
    107                  event.Skip()
    108
    109  # end of class wxgDynamicHintDlg
    110