def OnToolClick(self, event): tb = event.GetEventObject() tb.FindTool(wxID_TB_AUTO).SetState(aui.AUI_BUTTON_STATE_NORMAL) tb.FindTool(wxID_TB_WWW).SetState(aui.AUI_BUTTON_STATE_NORMAL) dlg = MyScanFileSelDlg(self) dlg.ClearSel() tb.RefreshOverflowState() self.UpdateScriptType()
def OnSelScanFile(self, event): checkstate = (self.tb2.FindTool(wxID_TB_WWW).GetState() & aui.AUI_BUTTON_STATE_CHECKED) if not checkstate: wx.MessageBox(u"请先选择文件扫描模式!", u"警告") return dlg = MyScanFileSelDlg(self) if dlg.ShowModal() == wx.ID_OK: dlg.SaveSel() dlg.Destroy()
def OnToolAutoClick(self, event): evid = event.GetId() tb = event.GetEventObject() checkstate = (tb.FindTool(evid).GetState() & aui.AUI_BUTTON_STATE_CHECKED) if checkstate: for (k,v) in SCRIPT_TYPE_BT.items(): if k == wxID_TB_AUTO: continue tb.FindTool(k).SetState(aui.AUI_BUTTON_STATE_NORMAL) dlg = MyScanFileSelDlg(self) dlg.ClearSel()
def OnToolWWWClick(self, event): evid = event.GetId() tb = event.GetEventObject() checkstate = (tb.FindTool(evid).GetState() & aui.AUI_BUTTON_STATE_CHECKED) # file select if checkstate: for (k,v) in SCRIPT_TYPE_BT.items(): if k == wxID_TB_WWW: continue tb.FindTool(k).SetState(aui.AUI_BUTTON_STATE_NORMAL) tb.RefreshOverflowState() dlg = MyScanFileSelDlg(self) if dlg.ShowModal() == wx.ID_OK: dlg.SaveSel() dlg.Destroy() else: self.cmdpara.SetScanFile("") self.UpdateScriptType() return