def drawBottomPanel(self): vbox = wx.BoxSizer(wx.VERTICAL) # 画表格 self.m_grid2 = qtable.QGridTable(self.bottom) vbox.Add(self.m_grid2, 1, wx.ALL | wx.EXPAND, 5) self.bottom.SetSizer(vbox)
def __init__(self, parent): wx.Panel.__init__(self, parent) vbox = wx.BoxSizer(wx.VERTICAL) # 查询栏 hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.supplier_name = wx.StaticText(self, label=u'供应商名称:') hbox1.Add(self.supplier_name, flag=wx.RIGHT, border=8) self.supplier_name_text = wx.TextCtrl(self, size=wx.Size(150, -1)) hbox1.Add(self.supplier_name_text, flag=wx.RIGHT, border=8) self.supplier_phone = wx.StaticText(self, label=u'电话:') hbox1.Add(self.supplier_phone, flag=wx.RIGHT, border=8) self.supplier_phone_text = wx.TextCtrl(self, size=wx.Size(150, -1)) hbox1.Add(self.supplier_phone_text, flag=wx.RIGHT, border=8) self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25)) self.search_button.SetToolTipString(u"根据条件搜索") self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click) hbox1.Add(self.search_button, flag=wx.RIGHT, border=10) self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25)) self.clear_button.SetToolTipString(u"清空搜索条件") self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click) hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8) vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 操作按钮栏 hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25)) self.add_button.SetToolTipString(u"添加供应商") self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click) hbox2.Add(self.add_button, flag=wx.RIGHT, border=8) self.del_button = wx.Button(self, wx.ID_ANY, u"删除", size=(70, 25)) self.del_button.SetToolTipString(u"删除供应商") self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click) hbox2.Add(self.del_button, flag=wx.RIGHT, border=8) vbox.Add(hbox2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 失效选择栏 hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.checkBox_status = wx.CheckBox(self, -1, u'显示失效客户', pos=(10, 10)) self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change) hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10) vbox.Add(hbox3, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 画表格 self.m_grid1 = qtable.QGridTable(self) vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5) self.DrawTable() self.SetSizer(vbox) self.Layout() self.Centre(wx.BOTH)
def drawTopPanel(self): # 为top面板设置一个布局管理器 vbox = wx.BoxSizer(wx.VERTICAL) # 查询栏 hbox1 = wx.BoxSizer(wx.HORIZONTAL) orderNo = wx.StaticText(self.top, label=u'入库单号:') hbox1.Add(orderNo, flag=wx.RIGHT, border=8) self.tc_orderNo = wx.TextCtrl(self.top, size=wx.Size(150, -1)) hbox1.Add(self.tc_orderNo, flag=wx.RIGHT, border=8) orderType = wx.StaticText(self.top, label=u'入库类型:') hbox1.Add(orderType, flag=wx.RIGHT, border=8) self.choice_orderType = wx.Choice(self.top) hbox1.Add(self.choice_orderType, flag=wx.RIGHT, border=8) customerName = wx.StaticText(self.top, label=u'供应商:') hbox1.Add(customerName, flag=wx.RIGHT, border=8) self.choice_customerName = wx.Choice(self.top) hbox1.Add(self.choice_customerName, flag=wx.RIGHT, border=8) productName = wx.StaticText(self.top, label=u'产品:') hbox1.Add(productName, flag=wx.RIGHT, border=8) self.choice_productName = wx.Choice(self.top) hbox1.Add(self.choice_productName, flag=wx.RIGHT, border=8) outdate = wx.StaticText(self.top, label=u'入库日期:') hbox1.Add(outdate, flag=wx.RIGHT, border=8) self.datectl_start = adv.DatePickerCtrl(self.top, style=adv.DP_DROPDOWN | adv.DP_SHOWCENTURY | adv.DP_ALLOWNONE) hbox1.Add(self.datectl_start, flag=wx.RIGHT, border=8) todate = wx.StaticText(self.top, label=u'~') hbox1.Add(todate, flag=wx.RIGHT, border=8) self.datectl_end = adv.DatePickerCtrl(self.top, style=adv.DP_DROPDOWN | adv.DP_SHOWCENTURY | adv.DP_ALLOWNONE) hbox1.Add(self.datectl_end, flag=wx.RIGHT, border=8) self.search_button = wx.Button(self.top, wx.ID_ANY, u"搜索", size=(45, 25)) self.search_button.SetToolTipString(u"根据条件搜索") self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click) hbox1.Add(self.search_button, flag=wx.RIGHT, border=10) self.clear_button = wx.Button(self.top, wx.ID_ANY, u"清空", size=(45, 25)) self.clear_button.SetToolTipString(u"清空搜索条件") self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click) hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8) vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 操作按钮栏 hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.add_button = wx.Button(self.top, wx.ID_ANY, u"添加", size=(70, 25)) self.add_button.SetToolTipString(u"添加入库单") self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click) hbox2.Add(self.add_button, flag=wx.RIGHT, border=8) self.del_button = wx.Button(self.top, wx.ID_ANY, u"撤回", size=(70, 25)) self.del_button.SetToolTipString(u"撤回入库单") self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click) hbox2.Add(self.del_button, flag=wx.RIGHT, border=8) vbox.Add(hbox2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 画表格 self.m_grid1 = qtable.QGridTable(self.top) vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5) self.top.SetSizer(vbox)
def __init__(self, parent): wx.Panel.__init__(self, parent) vbox = wx.BoxSizer(wx.VERTICAL) # 查询栏 hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.dic_type = wx.StaticText(self, label=u'字典类型:') hbox1.Add(self.dic_type, flag=wx.RIGHT, border=8) self.dic_type_choice = wx.Choice(self) hbox1.Add(self.dic_type_choice, flag=wx.RIGHT, border=8) self.dic_value = wx.StaticText(self, label=u'字典值:') hbox1.Add(self.dic_value, flag=wx.RIGHT, border=8) self.dic_value_text = wx.TextCtrl(self, size=wx.Size(150, -1)) hbox1.Add(self.dic_value_text, flag=wx.RIGHT, border=8) self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25)) self.search_button.SetToolTipString(u"根据条件搜索") self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click) hbox1.Add(self.search_button, flag=wx.RIGHT, border=10) self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25)) self.clear_button.SetToolTipString(u"清空搜索条件") self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click) hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8) vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 操作按钮栏 hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25)) self.add_button.SetToolTipString(u"添加字典") self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click) hbox2.Add(self.add_button, flag=wx.RIGHT, border=8) # self.del_button = wx.Button(self, wx.ID_ANY, u"失效", size=(70, 25)) # self.del_button.SetToolTipString(u"失效字典") # self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click) # hbox2.Add(self.del_button, flag=wx.RIGHT, border=8) vbox.Add(hbox2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 失效选择栏 hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.checkBox_status = wx.CheckBox(self, -1, u'显示失效字典', pos=(10, 10)) self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change) hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10) vbox.Add(hbox3, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 画表格 self.m_grid1 = qtable.QGridTable(self) vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5) self.dic_type_choice.SetItems(GetDicTypeChoice()) self.dic_type_choice.SetStringSelection("") self.DrawTable() self.SetSizer(vbox) self.Layout() self.Centre(wx.BOTH)
def __init__(self, parent): wx.Panel.__init__(self, parent) self.product_category_dict = GetProductCategoryDict() vbox = wx.BoxSizer(wx.VERTICAL) # 查询栏 hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.product_category = wx.StaticText(self, label=u'产品分类:') hbox1.Add(self.product_category, flag=wx.RIGHT, border=8) self.choice_product_category = wx.Choice(self) hbox1.Add(self.choice_product_category, flag=wx.RIGHT, border=8) self.product_code = wx.StaticText(self, label=u'产品编码:') hbox1.Add(self.product_code, flag=wx.RIGHT, border=8) self.tc_product_code = wx.TextCtrl(self, size=wx.Size(150, -1)) hbox1.Add(self.tc_product_code, flag=wx.RIGHT, border=8) self.product_name = wx.StaticText(self, label=u'产品名称:') hbox1.Add(self.product_name, flag=wx.RIGHT, border=8) self.tc_product_name = wx.TextCtrl(self, size=wx.Size(150, -1)) hbox1.Add(self.tc_product_name, flag=wx.RIGHT, border=8) self.search_button = wx.Button(self, wx.ID_ANY, u"搜索", size=(45, 25)) self.search_button.SetToolTipString(u"根据条件搜索") self.search_button.Bind(wx.EVT_BUTTON, self.button_search_click) hbox1.Add(self.search_button, flag=wx.RIGHT, border=10) self.clear_button = wx.Button(self, wx.ID_ANY, u"清空", size=(45, 25)) self.clear_button.SetToolTipString(u"清空搜索条件") self.clear_button.Bind(wx.EVT_BUTTON, self.button_clear_click) hbox1.Add(self.clear_button, flag=wx.RIGHT, border=8) vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 操作按钮栏 hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.add_button = wx.Button(self, wx.ID_ANY, u"添加", size=(70, 25)) self.add_button.SetToolTipString(u"添加产品") self.add_button.Bind(wx.EVT_BUTTON, self.button_add_click) hbox2.Add(self.add_button, flag=wx.RIGHT, border=8) self.del_button = wx.Button(self, wx.ID_ANY, u"删除", size=(70, 25)) self.del_button.SetToolTipString(u"删除产品") self.del_button.Bind(wx.EVT_BUTTON, self.button_del_click) hbox2.Add(self.del_button, flag=wx.RIGHT, border=8) vbox.Add(hbox2, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 失效选择栏 hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.checkBox_status = wx.CheckBox(self, -1, u'显示失效产品', pos=(10, 10)) self.checkBox_status.Bind(wx.EVT_CHECKBOX, self.checkBox_status_change) hbox3.Add(self.checkBox_status, flag=wx.RIGHT, border=10) vbox.Add(hbox3, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) # 画表格 self.m_grid1 = qtable.QGridTable(self) vbox.Add(self.m_grid1, 1, wx.ALL | wx.EXPAND, 5) self.choice_product_category.SetItems( GetDicTypeChoice(self.product_category_dict)) self.choice_product_category.SetStringSelection("") self.DrawTable() self.SetSizer(vbox) self.Layout() self.Centre(wx.BOTH)