Gnumed.wxGladeWidgets.wxgFormTemplateEditAreaPnl

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgFormTemplateEditAreaPnl

      1  #!/usr/bin/env python
      2  # -*- coding: UTF-8 -*-
      3  #
      4  # generated by wxGlade 0.6.8
      5  #
      6
      7  import wx
      8
      9  # begin wxGlade: dependencies
     10  import gettext
     11  # end wxGlade
     12
     13  # begin wxGlade: extracode
     14  from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
     15  from Gnumed.wxpython.gmDocumentWidgets import cDocumentTypeSelectionPhraseWheel
     16  # end wxGlade
     17
     18
     19 -class wxgFormTemplateEditAreaPnl(wx.ScrolledWindow):
     20 -        def __init__(self, *args, **kwds):
     21                  # begin wxGlade: wxgFormTemplateEditAreaPnl.__init__
     22                  kwds["style"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
     23                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     24                  self._PRW_name_long = cPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
     25                  self._PRW_name_short = cPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
     26                  self._TCTRL_external_version = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.NO_BORDER)
     27                  self._CHBOX_active = wx.CheckBox(self, wx.ID_ANY, _("active"))
     28                  self._CHBOX_editable = wx.CheckBox(self, wx.ID_ANY, _("editable"))
     29                  self._PRW_template_type = cPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
     30                  self._PRW_instance_type = cDocumentTypeSelectionPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
     31                  self._CH_engine = wx.Choice(self, wx.ID_ANY, choices=[_("OpenOffice"), _("LaTeX"), _("Image editor"), _("Gnuplot"), _("PDF form editor"), _("AbiWord"), _("Xe(La)TeX"), _("Text (generic processing)")])
     32                  self._TCTRL_filename = wx.TextCtrl(self, wx.ID_ANY, "")
     33                  self._BTN_load = wx.Button(self, wx.ID_ANY, _("&Load"), style=wx.BU_EXACTFIT)
     34                  self._BTN_export = wx.Button(self, wx.ID_ANY, _("Export"), style=wx.BU_EXACTFIT)
     35                  self._LBL_status = wx.StaticText(self, wx.ID_ANY, "")
     36
     37                  self.__set_properties()
     38                  self.__do_layout()
     39
     40                  self.Bind(wx.EVT_BUTTON, self._on_load_button_pressed, self._BTN_load)
     41                  self.Bind(wx.EVT_BUTTON, self._on_export_button_pressed, self._BTN_export)
     42                  # end wxGlade
     43
     44 -        def __set_properties(self):
     45                  # begin wxGlade: wxgFormTemplateEditAreaPnl.__set_properties
     46                  self.SetScrollRate(10, 10)
     47                  self._PRW_name_long.SetToolTipString(_("A long, descriptive name for this form template."))
     48                  self._PRW_name_short.SetToolTipString(_("A short, catchy name for this template."))
     49                  self._TCTRL_external_version.SetToolTipString(_("External version information such as the exact version/release/revision of a paper form onto which to print data with the help of this template."))
     50                  self._CHBOX_active.SetToolTipString(_("Mark this checkbox if you want this template to be active in GNUmed."))
     51                  self._CHBOX_active.SetValue(1)
     52                  self._CHBOX_editable.SetToolTipString(_("Check here to be offered manual, generic, last-minute editing of the form after placeholder substitution but before final output generation (ususally PDF) with those form engines to which it applies."))
     53                  self._CHBOX_editable.SetValue(1)
     54                  self._PRW_template_type.SetToolTipString(_("The type of this template. The intended use case for this template."))
     55                  self._PRW_instance_type.SetToolTipString(_("The document type under which to store forms generated from this template."))
     56                  self._CH_engine.SetToolTipString(_("The form engine this template must be processed with."))
     57                  self._CH_engine.SetSelection(0)
     58                  self._TCTRL_filename.SetToolTipString(_("Examplary filename. Mainly used for deriving a suitable file extension since that matters to some form engines. Most of the time this should already be set correctly when the template data is imported initially."))
     59                  self._TCTRL_filename.Enable(False)
     60                  self._BTN_load.SetToolTipString(_("Load template data from a file."))
     61                  self._BTN_export.SetToolTipString(_("Export the form template into a file."))
     62                  self._BTN_export.Enable(False)
     63                  # end wxGlade
     64
     65 -        def __do_layout(self):
     66                  # begin wxGlade: wxgFormTemplateEditAreaPnl.__do_layout
     67                  __gzsr_main = wx.FlexGridSizer(9, 2, 2, 5)
     68                  __szr_template_buttons = wx.BoxSizer(wx.HORIZONTAL)
     69                  __szr_options = wx.BoxSizer(wx.HORIZONTAL)
     70                  __szr_version = wx.BoxSizer(wx.HORIZONTAL)
     71                  __lbl_name_long = wx.StaticText(self, wx.ID_ANY, _("Name"))
     72                  __gzsr_main.Add(__lbl_name_long, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     73                  __gzsr_main.Add(self._PRW_name_long, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     74                  __lbl_name_short = wx.StaticText(self, wx.ID_ANY, _("Alias"))
     75                  __gzsr_main.Add(__lbl_name_short, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     76                  __gzsr_main.Add(self._PRW_name_short, 2, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5)
     77                  __lbl_external_version = wx.StaticText(self, wx.ID_ANY, _("Version"))
     78                  __gzsr_main.Add(__lbl_external_version, 0, wx.ALIGN_CENTER_VERTICAL, 3)
     79                  __szr_version.Add(self._TCTRL_external_version, 0, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 10)
     80                  __szr_version.Add(self._CHBOX_active, 0, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 10)
     81                  __szr_version.Add(self._CHBOX_editable, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     82                  __szr_version.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     83                  __gzsr_main.Add(__szr_version, 1, wx.EXPAND, 0)
     84                  __lbl_template_type = wx.StaticText(self, wx.ID_ANY, _("Template type"))
     85                  __gzsr_main.Add(__lbl_template_type, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     86                  __gzsr_main.Add(self._PRW_template_type, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     87                  __lbl_instance_type = wx.StaticText(self, wx.ID_ANY, _("Document type"))
     88                  __gzsr_main.Add(__lbl_instance_type, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     89                  __gzsr_main.Add(self._PRW_instance_type, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     90                  __lbl_options = wx.StaticText(self, wx.ID_ANY, _("Processing"))
     91                  __gzsr_main.Add(__lbl_options, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     92                  __szr_options.Add(self._CH_engine, 0, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5)
     93                  __gzsr_main.Add(__szr_options, 1, wx.TOP | wx.BOTTOM | wx.EXPAND, 3)
     94                  __lbl_filename = wx.StaticText(self, wx.ID_ANY, _("Template"))
     95                  __gzsr_main.Add(__lbl_filename, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     96                  __gzsr_main.Add(self._TCTRL_filename, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     97                  __gzsr_main.Add((20, 20), 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     98                  __szr_template_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     99                  __szr_template_buttons.Add(self._BTN_load, 0, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
    100                  __szr_template_buttons.Add(self._BTN_export, 0, wx.LEFT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 3)
    101                  __szr_template_buttons.Add((20, 20), 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    102                  __gzsr_main.Add(__szr_template_buttons, 1, wx.EXPAND, 0)
    103                  __lbl_status = wx.StaticText(self, wx.ID_ANY, _("Status"))
    104                  __gzsr_main.Add(__lbl_status, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    105                  __gzsr_main.Add(self._LBL_status, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    106                  self.SetSizer(__gzsr_main)
    107                  __gzsr_main.Fit(self)
    108                  __gzsr_main.AddGrowableCol(1)
    109                  # end wxGlade
    110
    111 -        def _on_load_button_pressed(self, event):  # wxGlade: wxgFormTemplateEditAreaPnl.<event_handler>
    112                  print "Event handler '_on_load_button_pressed' not implemented!"
    113                  event.Skip()
    114
    115 -        def _on_export_button_pressed(self, event):  # wxGlade: wxgFormTemplateEditAreaPnl.<event_handler>
    116                  print "Event handler '_on_export_button_pressed' not implemented!"
    117                  event.Skip()
    118
    119  # end of class wxgFormTemplateEditAreaPnl
    120