#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.5 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgBillingPluginPnl.wxg"

import wx

# begin wxGlade: extracode
# end wxGlade


class wxgBillingPluginPnl(wx.ScrolledWindow):
    def __init__(self, *args, **kwds):

        from Gnumed.wxpython import gmBillingWidgets

        # begin wxGlade: wxgBillingPluginPnl.__init__
        kwds["style"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self._CHBOX_show_non_invoiced_only = wx.CheckBox(self, -1, _("Show non-invoiced only"))
        self._PNL_bill_items = gmBillingWidgets.cPersonBillItemsManagerPnl(self, -1, style=wx.NO_BORDER | wx.TAB_TRAVERSAL)
        self._PRW_billable = gmBillingWidgets.cBillablePhraseWheel(self, -1, "", style=wx.NO_BORDER)
        self._TCTRL_factor = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
        self._TCTRL_details = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
        self._BTN_insert_item = wx.Button(self, -1, _("&Insert"), style=wx.BU_EXACTFIT)
        self.__szr_add_item_staticbox = wx.StaticBox(self, -1, _("Add billing item to current encounter"))

        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.SetToolTipString(_("Select - by code or part of the description - a billable item to add to the patient."))
        self._TCTRL_factor.SetToolTipString(_("Modify the factor to apply to the item price."))
        self._TCTRL_factor.Enable(False)
        self._TCTRL_details.SetToolTipString(_("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.SetToolTipString(_("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)
        self.__szr_add_item_staticbox.Lower()
        __szr_add_item = wx.StaticBoxSizer(self.__szr_add_item_staticbox, 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, -1, _("Item:"))
        __szr_add_item.Add(__lbl_item, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 2)
        __szr_add_item.Add(self._PRW_billable, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
        __lbl_factor = wx.StaticText(self, -1, _("Factor:"))
        __szr_add_item.Add(__lbl_factor, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 2)
        __szr_add_item.Add(self._TCTRL_factor, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
        __lbl_details = wx.StaticText(self, -1, _("Comment:"))
        __szr_add_item.Add(__lbl_details, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 2)
        __szr_add_item.Add(self._TCTRL_details, 2, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 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)
        # 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_create_invoice_button_pressed(self, event):  # wxGlade: wxgBillingPluginPnl.<event_handler>
        print "Event handler `_on_create_invoice_button_pressed' 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
if __name__ == "__main__":
    import gettext
    gettext.install("app") # replace with the appropriate catalog name

    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = (None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()
