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

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
from Gnumed.wxpython.gmBillingWidgets import cBillablePhraseWheel
from Gnumed.wxpython.gmBillingWidgets import cPersonBillItemsManagerPnl
# end wxGlade


class wxgBillingPluginPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgBillingPluginPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._CHBOX_show_non_invoiced_only = wx.CheckBox(self, wx.ID_ANY, _("Show non-invoiced only"))
		self._PNL_bill_items = cPersonBillItemsManagerPnl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.TAB_TRAVERSAL)
		self._PRW_billable = cBillablePhraseWheel(self, wx.ID_ANY, "")
		self._TCTRL_factor = wx.TextCtrl(self, wx.ID_ANY, "")
		self._TCTRL_details = wx.TextCtrl(self, wx.ID_ANY, "")
		self._BTN_insert_item = wx.Button(self, wx.ID_ANY, _("&Insert"), style=wx.BU_EXACTFIT)

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_CHECKBOX, self._on_non_invoiced_only_checkbox_toggled, self._CHBOX_show_non_invoiced_only)
		self.Bind(wx.EVT_BUTTON, self._on_insert_bill_item_button_pressed, self._BTN_insert_item)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgBillingPluginPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._CHBOX_show_non_invoiced_only.SetValue(1)
		self._PRW_billable.SetToolTip(_("Select - by code or part of the description - a billable item to add to the patient."))
		self._TCTRL_factor.SetToolTip(_("Modify the factor to apply to the item price."))
		self._TCTRL_factor.Enable(False)
		self._TCTRL_details.SetToolTip(_("Optional: Add a short patient specific comment on this item. Will be shown on the bill."))
		self._TCTRL_details.Enable(False)
		self._BTN_insert_item.SetToolTip(_("Add the selected billing item to the patient."))
		self._BTN_insert_item.Enable(False)
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgBillingPluginPnl.__do_layout
		__szr_main = wx.BoxSizer(wx.VERTICAL)
		__szr_add_item = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, _("Add billing item to current encounter")), wx.HORIZONTAL)
		__szr_list_options = wx.BoxSizer(wx.HORIZONTAL)
		__szr_list_options.Add(self._CHBOX_show_non_invoiced_only, 0, wx.ALIGN_CENTER_VERTICAL, 5)
		__szr_list_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_main.Add(__szr_list_options, 0, wx.BOTTOM | wx.EXPAND, 2)
		__szr_main.Add(self._PNL_bill_items, 1, wx.BOTTOM | wx.EXPAND, 2)
		__lbl_item = wx.StaticText(self, wx.ID_ANY, _("Item:"))
		__szr_add_item.Add(__lbl_item, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 2)
		__szr_add_item.Add(self._PRW_billable, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__lbl_factor = wx.StaticText(self, wx.ID_ANY, _("Factor:"))
		__szr_add_item.Add(__lbl_factor, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 2)
		__szr_add_item.Add(self._TCTRL_factor, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__lbl_details = wx.StaticText(self, wx.ID_ANY, _("Comment:"))
		__szr_add_item.Add(__lbl_details, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 2)
		__szr_add_item.Add(self._TCTRL_details, 2, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__szr_add_item.Add(self._BTN_insert_item, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_main.Add(__szr_add_item, 0, wx.EXPAND, 0)
		self.SetSizer(__szr_main)
		__szr_main.Fit(self)
		self.Layout()
		# end wxGlade

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

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

# end of class wxgBillingPluginPnl
