def __init__(self, *args, **kwds): kwds["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.label_heading = wx.StaticText(self, -1, "SUPPLIERS") self.panel_bottom = wx.Panel(self, -1) self.vList = vList(self.panel_bottom, style = wx.LC_HRULES | wx.LC_SINGLE_SEL) self.panel_right = wx.Panel(self.panel_bottom, -1) self.panel_details = wx.Panel(self.panel_right, -1) self.label_sply_name = wx.StaticText(self.panel_details, -1, "Name") self.text_ctrl_supplier_name = wx.TextCtrl(self.panel_details, -1, "") self.label_supplier_address = wx.StaticText(self.panel_details, -1, "Address") self.text_ctrl_supplier_address = wx.TextCtrl(self.panel_details, -1, "", style=wx.TE_MULTILINE) self.label_supplier_telp = wx.StaticText(self.panel_details, -1, "Tel.") self.text_ctrl_supplier_telp = wx.TextCtrl(self.panel_details, -1, "", validator = Validator(2)) self.panel_buttons = self.pb = pb = panel_buttons(self.panel_right, -1) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.vList) self.Bind(wx.EVT_BUTTON, self.OnNew, pb.new) self.Bind(wx.EVT_BUTTON, self.OnEdit, pb.edit) self.Bind(wx.EVT_BUTTON, self.OnDelete, pb.delete) self.Bind(wx.EVT_BUTTON, self.OnSave, pb.save) self.Bind(wx.EVT_BUTTON, self.OnCancel, pb.cancel) self.Bind(wx.EVT_BUTTON, self.OnRefresh, pb.refresh) self.tc = (self.text_ctrl_supplier_name, self.text_ctrl_supplier_address, self.text_ctrl_supplier_telp) self.__set_properties() self.__do_layout() self.displayData()
def __init__(self, *args, **kwds): kwds["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.panel_top = wx.Panel(self, -1) self.panel_bottom = wx.Panel(self, -1) self.label_heading = wx.StaticText(self.panel_top, -1, "PURCHASE ACCOUNTS") self.vList = vList(self.panel_bottom, style = wx.LC_HRULES | wx.LC_VRULES |wx.LC_SINGLE_SEL) self.panel_right = wx.Panel(self.panel_bottom, -1) self.panel_details = wx.Panel(self.panel_right, -1) self.label_section_catagory = wx.StaticText(self.panel_details, -1, "Catagory") self.choice_account_catagory = wx.Choice(self.panel_details, -1, choices=[]) self.label_section_code = wx.StaticText(self.panel_details, -1, "Code") self.panel_section_code = wx.Panel(self.panel_details, -1) self.text_ctrl_acc_code_1 = self.create_code_ctrl(self.panel_section_code) self.text_ctrl_acc_code_2 = self.create_code_ctrl(self.panel_section_code) self.text_ctrl_acc_code_3 = self.create_code_ctrl(self.panel_section_code) self.text_ctrl_acc_code_4 = self.create_code_ctrl(self.panel_section_code) self.label_account_name = wx.StaticText(self.panel_details, -1, "Section") self.text_ctrl_section_name = wx.TextCtrl(self.panel_details, -1, "") self.label_account_balance = wx.StaticText(self.panel_details, -1, "Opening Ballance") self.text_ctrl_balance = masked.NumCtrl(self.panel_details, -1, name="text_ctrl_opening_balance" ) self.panel_buttons = self.pb = panel_buttons(self.panel_right, -1) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.vList) self.Bind(wx.EVT_CHOICE, self.OnSelectAccount, self.choice_account_catagory) self.Bind(wx.EVT_BUTTON, self.OnNew, self.pb.new) self.Bind(wx.EVT_BUTTON, self.OnEdit, self.pb.edit) self.Bind(wx.EVT_BUTTON, self.OnDelete, self.pb.delete) self.Bind(wx.EVT_BUTTON, self.OnSave, self.pb.save) self.Bind(wx.EVT_BUTTON, self.OnCancel, self.pb.cancel) self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.pb.refresh) self.tc = ( self.text_ctrl_acc_code_1, self.text_ctrl_acc_code_2, self.text_ctrl_acc_code_3, self.text_ctrl_acc_code_4, self.text_ctrl_section_name, self.text_ctrl_balance) self.__set_properties() self.__do_layout() self.__do_main()