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

# Source Code for Module Gnumed.wxGladeWidgets.wxgEditDocumentTypesPnl

      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 wxgEditDocumentTypesPnl(wx.ScrolledWindow):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgEditDocumentTypesPnl.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
     20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     21                  from Gnumed.wxpython.gmListWidgets import cReportListCtrl
     22                  self._LCTRL_doc_type = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_SIMPLE | wx.LC_REPORT | wx.LC_SINGLE_SEL)
     23                  self._TCTRL_type = wx.TextCtrl(self, wx.ID_ANY, "")
     24                  self._TCTRL_l10n_type = wx.TextCtrl(self, wx.ID_ANY, "")
     25                  self._BTN_set_translation = wx.Button(self, wx.ID_ANY, _("Set &translation"))
     26                  self._BTN_add = wx.Button(self, wx.ID_ADD, "")
     27                  self._BTN_delete = wx.Button(self, wx.ID_DELETE, "")
     28                  self._BTN_reassign = wx.Button(self, wx.ID_ANY, _("&Reassign"))
     29                  self._BTN_dismiss = wx.Button(self, wx.ID_CANCEL, _("&Close"))
     30
     31                  self.__set_properties()
     32                  self.__do_layout()
     33
     34                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_list_item_selected, self._LCTRL_doc_type)
     35                  self.Bind(wx.EVT_TEXT, self._on_type_modified, self._TCTRL_type)
     36                  self.Bind(wx.EVT_BUTTON, self._on_set_translation_button_pressed, self._BTN_set_translation)
     37                  self.Bind(wx.EVT_BUTTON, self._on_add_button_pressed, self._BTN_add)
     38                  self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._BTN_delete)
     39                  self.Bind(wx.EVT_BUTTON, self._on_reassign_button_pressed, self._BTN_reassign)
     40                  # end wxGlade
     41
     42 -        def __set_properties(self):
     43                  # begin wxGlade: wxgEditDocumentTypesPnl.__set_properties
     44                  self.SetScrollRate(10, 10)
     45                  self._LCTRL_doc_type.SetToolTip(_("This lists the available document types."))
     46                  self._LCTRL_doc_type.SetFocus()
     47                  self._TCTRL_type.SetToolTip(_("The document type, usually in English."))
     48                  self._TCTRL_l10n_type.SetToolTip(_("The document type in the local language."))
     49                  self._BTN_set_translation.SetToolTip(_("Change translation of selected document type for your local language."))
     50                  self._BTN_set_translation.Enable(False)
     51                  self._BTN_add.SetToolTip(_("Add above input as a new document type."))
     52                  self._BTN_add.Enable(False)
     53                  self._BTN_delete.SetToolTip(_("Delete selected document type. Note that you can only delete document types that are not in use."))
     54                  self._BTN_delete.Enable(False)
     55                  self._BTN_reassign.SetToolTip(_("Change the type of all documents currently having the selected document type."))
     56                  self._BTN_reassign.Enable(False)
     57                  self._BTN_dismiss.SetDefault()
     58                  # end wxGlade
     59
     60 -        def __do_layout(self):
     61                  # begin wxGlade: wxgEditDocumentTypesPnl.__do_layout
     62                  _szr_main = wx.BoxSizer(wx.VERTICAL)
     63                  _szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     64                  _gszr_editor = wx.FlexGridSizer(2, 2, 2, 2)
     65                  _szr_main.Add(self._LCTRL_doc_type, 1, wx.EXPAND, 5)
     66                  _lbl_name = wx.StaticText(self, wx.ID_ANY, _("Type (English)"))
     67                  _gszr_editor.Add(_lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     68                  _gszr_editor.Add(self._TCTRL_type, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     69                  _lbl_local_name = wx.StaticText(self, wx.ID_ANY, _("Local language"))
     70                  _gszr_editor.Add(_lbl_local_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     71                  _gszr_editor.Add(self._TCTRL_l10n_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     72                  _gszr_editor.AddGrowableCol(1)
     73                  _szr_main.Add(_gszr_editor, 0, wx.BOTTOM | wx.EXPAND | wx.TOP, 5)
     74                  _szr_buttons.Add(self._BTN_set_translation, 0, wx.RIGHT, 3)
     75                  _szr_buttons.Add(self._BTN_add, 0, wx.RIGHT, 3)
     76                  _szr_buttons.Add(self._BTN_delete, 0, wx.RIGHT, 3)
     77                  _szr_buttons.Add(self._BTN_reassign, 0, 0, 3)
     78                  _szr_buttons.Add((5, 5), 1, wx.EXPAND, 0)
     79                  _szr_buttons.Add(self._BTN_dismiss, 0, 0, 0)
     80                  _szr_main.Add(_szr_buttons, 0, wx.EXPAND, 0)
     81                  self.SetSizer(_szr_main)
     82                  _szr_main.Fit(self)
     83                  self.Layout()
     84                  # end wxGlade
     85
     86 -        def _on_list_item_selected(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
     87                  print("Event handler '_on_list_item_selected' not implemented!")
     88                  event.Skip()
     89
     90 -        def _on_type_modified(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
     91                  print("Event handler '_on_type_modified' not implemented!")
     92                  event.Skip()
     93
     94 -        def _on_set_translation_button_pressed(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
     95                  print("Event handler '_on_set_translation_button_pressed' not implemented!")
     96                  event.Skip()
     97
     98 -        def _on_add_button_pressed(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
     99                  print("Event handler '_on_add_button_pressed' not implemented!")
    100                  event.Skip()
    101
    102 -        def _on_delete_button_pressed(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
    103                  print("Event handler '_on_delete_button_pressed' not implemented!")
    104                  event.Skip()
    105
    106 -        def _on_reassign_button_pressed(self, event):  # wxGlade: wxgEditDocumentTypesPnl.<event_handler>
    107                  print("Event handler '_on_reassign_button_pressed' not implemented!")
    108                  event.Skip()
    109
    110  # end of class wxgEditDocumentTypesPnl
    111