# -*- coding: UTF-8 -*-
#
# generated by wxGlade
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class wxgBillEAPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgBillEAPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._TCTRL_invoice_id = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		from Gnumed.wxpython.gmDateTimeInput import cDateInputPhraseWheel
		self._PRW_close_date = cDateInputPhraseWheel(self, wx.ID_ANY, "")
		self._TCTRL_address = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._BTN_select_address = wx.Button(self, wx.ID_ANY, _("&Select"), style=wx.BU_EXACTFIT)
		self._TCTRL_value = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._CHBOX_vat_applies = wx.CheckBox(self, wx.ID_ANY, _("&VAT applies"), style=wx.CHK_3STATE | wx.CHK_ALLOW_3RD_STATE_FOR_USER)
		self._TCTRL_value_with_vat = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._TCTRL_comment = wx.TextCtrl(self, wx.ID_ANY, "")

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_select_address_button_pressed, self._BTN_select_address)
		self.Bind(wx.EVT_CHECKBOX, self._on_vat_applies_box_checked, self._CHBOX_vat_applies)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgBillEAPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._TCTRL_invoice_id.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		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."))
		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."))
		self._TCTRL_address.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_address.SetToolTip(_("Where to send the bill."))
		self._BTN_select_address.SetToolTip(_("Select the address where to send the bill."))
		self._TCTRL_value.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_value.SetToolTip(_("The total value of this bill without VAT applied."))
		self._CHBOX_vat_applies.SetToolTip(_("Select here whether or not to apply VAT when creating an invoice for this bill."))
		self._CHBOX_vat_applies.Set3StateValue(wx.CHK_UNDETERMINED)
		self._TCTRL_value_with_vat.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_value_with_vat.SetToolTip(_("The total value of this bill after VAT has been applied."))
		self._TCTRL_comment.SetToolTip(_("Add an arbitrary comment on this bill."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgBillEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
		__szr_value_details = wx.BoxSizer(wx.HORIZONTAL)
		__szr_address_details = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_invoice_id = wx.StaticText(self, wx.ID_ANY, _("Invoice ID"))
		__lbl_invoice_id.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_invoice_id, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__close_date = wx.StaticText(self, wx.ID_ANY, _("Close date"))
		__close_date.SetForegroundColour(wx.Colour(255, 127, 0))
		_gszr_main.Add(__close_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_close_date, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_address = wx.StaticText(self, wx.ID_ANY, _("Address"))
		__lbl_address.SetForegroundColour(wx.Colour(255, 127, 0))
		_gszr_main.Add(__lbl_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_address_details.Add(self._TCTRL_address, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_address_details.Add(self._BTN_select_address, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(__szr_address_details, 1, wx.EXPAND, 0)
		__lbl_value = wx.StaticText(self, wx.ID_ANY, _("Value"))
		_gszr_main.Add(__lbl_value, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_value_details.Add(self._TCTRL_value, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
		__szr_value_details.Add(self._CHBOX_vat_applies, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_value_details.Add(self._TCTRL_value_with_vat, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
		_gszr_main.Add(__szr_value_details, 1, wx.EXPAND, 0)
		__lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
		_gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

	def _on_select_address_button_pressed(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
		print("Event handler '_on_select_address_button_pressed' not implemented!")
		event.Skip()

	def _on_vat_applies_box_checked(self, event):  # wxGlade: wxgBillEAPnl.<event_handler>
		print("Event handler '_on_vat_applies_box_checked' not implemented!")
		event.Skip()

# end of class wxgBillEAPnl
