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"))
    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._TCTRL_value_with_vat.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
    51                  self._TCTRL_value_with_vat.SetToolTip(_("The total value of this bill after VAT has been applied."))
    52                  self._TCTRL_comment.SetToolTip(_("Add an arbitrary comment on this bill."))
    53                  # end wxGlade
    54
    55 -        def __do_layout(self):
    56                  # begin wxGlade: wxgBillEAPnl.__do_layout
    57                  _gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
    58                  __szr_value_details = wx.BoxSizer(wx.HORIZONTAL)
    59                  __szr_address_details = wx.BoxSizer(wx.HORIZONTAL)
    60                  __lbl_invoice_id = wx.StaticText(self, wx.ID_ANY, _("Invoice ID"))
    61                  __lbl_invoice_id.SetForegroundColour(wx.Colour(255, 0, 0))
    62                  _gszr_main.Add(__lbl_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    63                  _gszr_main.Add(self._TCTRL_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    64                  __close_date = wx.StaticText(self, wx.ID_ANY, _("Close date"))
    65                  __close_date.SetForegroundColour(wx.Colour(255, 127, 0))
    66                  _gszr_main.Add(__close_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    67                  _gszr_main.Add(self._PRW_close_date, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    68                  __lbl_address = wx.StaticText(self, wx.ID_ANY, _("Address"))
    69                  __lbl_address.SetForegroundColour(wx.Colour(255, 127, 0))
    70                  _gszr_main.Add(__lbl_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    71                  __szr_address_details.Add(self._TCTRL_address, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    72                  __szr_address_details.Add(self._BTN_select_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    73                  _gszr_main.Add(__szr_address_details, 1, wx.EXPAND, 0)
    74                  __lbl_value = wx.StaticText(self, wx.ID_ANY, _("Value"))
    75                  _gszr_main.Add(__lbl_value, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    76                  __szr_value_details.Add(self._TCTRL_value, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    77                  __szr_value_details.Add(self._CHBOX_vat_applies, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    78                  __szr_value_details.Add(self._TCTRL_value_with_vat, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
    79                  _gszr_main.Add(__szr_value_details, 1, wx.EXPAND, 0)
    80                  __lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
    81                  _gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    82                  _gszr_main.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    83                  self.SetSizer(_gszr_main)
    84                  _gszr_main.Fit(self)
    85                  _gszr_main.AddGrowableCol(1)
    86                  self.Layout()
    87                  # end wxGlade
    88
    89 -        def _on_select_address_button_pressed(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
    90                  print("Event handler '_on_select_address_button_pressed' not implemented!")
    91                  event.Skip()
    92
    93 -        def _on_vat_applies_box_checked(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
    94                  print("Event handler '_on_vat_applies_box_checked' not implemented!")
    95                  event.Skip()
    96
    97  # end of class wxgBillEAPnl
    98