Gnumed.wxGladeWidgets.wxgBillEAPnl

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgBillEAPnl

      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 wxgBillEAPnl(wx.ScrolledWindow):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgBillEAPnl.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
     20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
     21                  self._TCTRL_invoice_id = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
     22                  from Gnumed.wxpython.gmDateTimeInput import cDateInputPhraseWheel
     23                  self._PRW_close_date = cDateInputPhraseWheel(self, wx.ID_ANY, "")
     24                  self._TCTRL_address = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
     25                  self._BTN_select_address = wx.Button(self, wx.ID_ANY, _("&Select"), style=wx.BU_EXACTFIT)
     26                  self._TCTRL_value = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
     27                  self._CHBOX_vat_applies = wx.CheckBox(self, wx.ID_ANY, _("&VAT applies"), style=wx.CHK_3STATE | wx.CHK_ALLOW_3RD_STATE_FOR_USER)
     28                  self._TCTRL_value_with_vat = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
     29                  self._TCTRL_comment = wx.TextCtrl(self, wx.ID_ANY, "")
     30
     31                  self.__set_properties()
     32                  self.__do_layout()
     33
     34                  self.Bind(wx.EVT_BUTTON, self._on_select_address_button_pressed, self._BTN_select_address)
     35                  self.Bind(wx.EVT_CHECKBOX, self._on_vat_applies_box_checked, self._CHBOX_vat_applies)
     36                  # end wxGlade
     37
     38 -        def __set_properties(self):
     39                  # begin wxGlade: wxgBillEAPnl.__set_properties
     40                  self.SetScrollRate(10, 10)
     41                  self._TCTRL_invoice_id.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     42                  self._TCTRL_invoice_id.SetToolTip(_("The invoice ID.\n\nNote that in most jurisdictions this must be a unique entity.\n\nGNUmed will create one for you."))
     43                  self._PRW_close_date.SetToolTip(_("The close date of the bill.\n\nWhen a bill is closed items shall not be added to it anymore."))
     44                  self._TCTRL_address.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     45                  self._TCTRL_address.SetToolTip(_("Where to send the bill."))
     46                  self._BTN_select_address.SetToolTip(_("Select the address where to send the bill."))
     47                  self._TCTRL_value.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     48                  self._TCTRL_value.SetToolTip(_("The total value of this bill without VAT applied."))
     49                  self._CHBOX_vat_applies.SetToolTip(_("Select here whether or not to apply VAT when creating an invoice for this bill."))
     50                  self._CHBOX_vat_applies.Set3StateValue(wx.CHK_UNDETERMINED)
     51                  self._TCTRL_value_with_vat.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     52                  self._TCTRL_value_with_vat.SetToolTip(_("The total value of this bill after VAT has been applied."))
     53                  self._TCTRL_comment.SetToolTip(_("Add an arbitrary comment on this bill."))
     54                  # end wxGlade
     55
     56 -        def __do_layout(self):
     57                  # begin wxGlade: wxgBillEAPnl.__do_layout
     58                  _gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
     59                  __szr_value_details = wx.BoxSizer(wx.HORIZONTAL)
     60                  __szr_address_details = wx.BoxSizer(wx.HORIZONTAL)
     61                  __lbl_invoice_id = wx.StaticText(self, wx.ID_ANY, _("Invoice ID"))
     62                  __lbl_invoice_id.SetForegroundColour(wx.Colour(255, 0, 0))
     63                  _gszr_main.Add(__lbl_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     64                  _gszr_main.Add(self._TCTRL_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     65                  __close_date = wx.StaticText(self, wx.ID_ANY, _("Close date"))
     66                  __close_date.SetForegroundColour(wx.Colour(255, 127, 0))
     67                  _gszr_main.Add(__close_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     68                  _gszr_main.Add(self._PRW_close_date, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     69                  __lbl_address = wx.StaticText(self, wx.ID_ANY, _("Address"))
     70                  __lbl_address.SetForegroundColour(wx.Colour(255, 127, 0))
     71                  _gszr_main.Add(__lbl_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     72                  __szr_address_details.Add(self._TCTRL_address, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     73                  __szr_address_details.Add(self._BTN_select_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     74                  _gszr_main.Add(__szr_address_details, 1, wx.EXPAND, 0)
     75                  __lbl_value = wx.StaticText(self, wx.ID_ANY, _("Value"))
     76                  _gszr_main.Add(__lbl_value, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     77                  __szr_value_details.Add(self._TCTRL_value, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
     78                  __szr_value_details.Add(self._CHBOX_vat_applies, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     79                  __szr_value_details.Add(self._TCTRL_value_with_vat, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
     80                  _gszr_main.Add(__szr_value_details, 1, wx.EXPAND, 0)
     81                  __lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
     82                  _gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     83                  _gszr_main.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     84                  self.SetSizer(_gszr_main)
     85                  _gszr_main.Fit(self)
     86                  _gszr_main.AddGrowableCol(1)
     87                  self.Layout()
     88                  # end wxGlade
     89
     90 -        def _on_select_address_button_pressed(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
     91                  print("Event handler '_on_select_address_button_pressed' not implemented!")
     92                  event.Skip()
     93
     94 -        def _on_vat_applies_box_checked(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
     95                  print("Event handler '_on_vat_applies_box_checked' not implemented!")
     96                  event.Skip()
     97
     98  # end of class wxgBillEAPnl
     99