From 82c1259fa49a39f8497a27d93dd66e6ae91b0bd5 Mon Sep 17 00:00:00 2001 From: Puiching_Memory <1138663075@qq.com> Date: Sat, 4 Dec 2021 15:11:36 +0800 Subject: [PATCH] Update1204 --- GUI.py | 60 +- GUI_College.py | 8 +- GUI_SSC.py | 25 +- M_BingWallPaper.py | 18 +- L_College.py => M_College.py | 8 + M_History.py | 15 +- M_Pinyin.py | 1 - M_SSC.py | 13 + Main.py | 1066 ++++++++++++++++++++++++++++++++-- Preparation.py | 10 +- WeaterAPI.py | 2 +- 11 files changed, 1149 insertions(+), 77 deletions(-) rename L_College.py => M_College.py (91%) diff --git a/GUI.py b/GUI.py index 8dda243..b0a2a71 100644 --- a/GUI.py +++ b/GUI.py @@ -117,53 +117,53 @@ def __init__( self, parent ): self.G1.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) self.G1.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G1, 0, 0, 5 ) + wSizer_L2.Add( self.G1, 0, wx.RIGHT|wx.LEFT, 2 ) - self.G2 = wx.Button( self, wx.ID_ANY, u"数学 3", wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE ) + self.G2 = wx.Button( self, wx.ID_ANY, u"数学 4", wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE ) self.G2.SetFont( wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) self.G2.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G2, 0, 0, 5 ) + wSizer_L2.Add( self.G2, 0, wx.RIGHT|wx.LEFT, 2 ) self.G3 = wx.Button( self, wx.ID_ANY, u"英语 1", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G3.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G3, 0, 0, 5 ) + wSizer_L2.Add( self.G3, 0, wx.RIGHT|wx.LEFT, 2 ) self.G4 = wx.Button( self, wx.ID_ANY, u"信息 4", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G4.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G4, 0, 0, 5 ) + wSizer_L2.Add( self.G4, 0, wx.RIGHT|wx.LEFT, 2 ) self.G5 = wx.Button( self, wx.ID_ANY, u"历史 2", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G5.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G5, 0, 0, 5 ) + wSizer_L2.Add( self.G5, 0, wx.RIGHT|wx.LEFT, 2 ) self.G6 = wx.Button( self, wx.ID_ANY, u"地理 1", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G6.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G6, 0, 0, 5 ) + wSizer_L2.Add( self.G6, 0, wx.RIGHT|wx.LEFT, 2 ) - self.G7 = wx.Button( self, wx.ID_ANY, u"物理 4", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) + self.G7 = wx.Button( self, wx.ID_ANY, u"物理 3", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G7.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G7, 0, 0, 5 ) + wSizer_L2.Add( self.G7, 0, wx.RIGHT|wx.LEFT, 2 ) self.G8 = wx.Button( self, wx.ID_ANY, u"化学 1", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G8.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G8, 0, 0, 5 ) + wSizer_L2.Add( self.G8, 0, wx.RIGHT|wx.LEFT, 2 ) self.G9 = wx.Button( self, wx.ID_ANY, u"生物 1", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G9.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G9, 0, 0, 5 ) + wSizer_L2.Add( self.G9, 0, wx.RIGHT|wx.LEFT, 2 ) self.G10 = wx.Button( self, wx.ID_ANY, u"通用 4", wx.DefaultPosition, wx.Size( 70,-1 ), wx.BORDER_NONE ) self.G10.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) - wSizer_L2.Add( self.G10, 0, 0, 5 ) + wSizer_L2.Add( self.G10, 0, wx.RIGHT|wx.LEFT, 2 ) bSizer_main.Add( wSizer_L2, 0, wx.ALIGN_CENTER_HORIZONTAL, 0 ) @@ -260,6 +260,13 @@ def __init__( self, parent ): wSizer81.Add( self.Help1, 0, wx.ALL, 5 ) + self.TIP1 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 80,20 ), wx.BORDER_NONE ) + self.TIP1.SetFont( wx.Font( 8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) + self.TIP1.SetForegroundColour( wx.Colour( 255, 0, 0 ) ) + self.TIP1.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) + + wSizer81.Add( self.TIP1, 0, wx.ALL, 5 ) + bSizer3.Add( wSizer81, 0, wx.EXPAND, 5 ) @@ -271,6 +278,8 @@ def __init__( self, parent ): wSizer2.Add( self.P_F1, 0, 0, 5 ) self.B_F1 = wx.Button( self, wx.ID_ANY, u"<( ̄︶ ̄)↗[GO!]", wx.DefaultPosition, wx.Size( 160,50 ), wx.BORDER_NONE ) + self.B_F1.SetBackgroundColour( wx.Colour( 192, 192, 192 ) ) + wSizer2.Add( self.B_F1, 0, 0, 5 ) @@ -325,6 +334,13 @@ def __init__( self, parent ): wSizer811.Add( self.Help2, 0, wx.ALL, 5 ) + self.TIP2 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 80,20 ), wx.BORDER_NONE ) + self.TIP2.SetFont( wx.Font( 8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) + self.TIP2.SetForegroundColour( wx.Colour( 255, 0, 0 ) ) + self.TIP2.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) + + wSizer811.Add( self.TIP2, 0, wx.ALL, 5 ) + bSizer31.Add( wSizer811, 0, wx.EXPAND, 5 ) @@ -336,6 +352,8 @@ def __init__( self, parent ): wSizer21.Add( self.P_F2, 0, 0, 5 ) self.B_F2 = wx.Button( self, wx.ID_ANY, u"<( ̄︶ ̄)↗[GO!]", wx.DefaultPosition, wx.Size( 160,50 ), wx.BORDER_NONE ) + self.B_F2.SetBackgroundColour( wx.Colour( 192, 192, 192 ) ) + wSizer21.Add( self.B_F2, 0, 0, 5 ) @@ -390,6 +408,13 @@ def __init__( self, parent ): wSizer812.Add( self.Help3, 0, wx.ALL, 5 ) + self.TIP3 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 80,20 ), wx.BORDER_NONE ) + self.TIP3.SetFont( wx.Font( 8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) + self.TIP3.SetForegroundColour( wx.Colour( 255, 0, 0 ) ) + self.TIP3.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) + + wSizer812.Add( self.TIP3, 0, wx.ALL, 5 ) + bSizer32.Add( wSizer812, 0, wx.EXPAND, 5 ) @@ -401,6 +426,8 @@ def __init__( self, parent ): wSizer22.Add( self.P_F3, 0, 0, 5 ) self.B_F3 = wx.Button( self, wx.ID_ANY, u"<( ̄︶ ̄)↗[GO!]", wx.DefaultPosition, wx.Size( 160,50 ), wx.BORDER_NONE ) + self.B_F3.SetBackgroundColour( wx.Colour( 192, 192, 192 ) ) + wSizer22.Add( self.B_F3, 0, 0, 5 ) self.Tip3 = wx.Button( self, wx.ID_ANY, u"Tip3", wx.DefaultPosition, wx.Size( 200,40 ), wx.BORDER_NONE|wx.BU_LEFT|wx.BU_TOP ) @@ -455,6 +482,13 @@ def __init__( self, parent ): wSizer813.Add( self.Help4, 0, wx.ALL, 5 ) + self.TIP4 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 80,20 ), wx.BORDER_NONE ) + self.TIP4.SetFont( wx.Font( 8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "微软雅黑" ) ) + self.TIP4.SetForegroundColour( wx.Colour( 255, 0, 0 ) ) + self.TIP4.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) + + wSizer813.Add( self.TIP4, 0, wx.ALL, 5 ) + bSizer33.Add( wSizer813, 0, wx.EXPAND, 5 ) @@ -466,6 +500,8 @@ def __init__( self, parent ): wSizer23.Add( self.P_F4, 0, 0, 5 ) self.B_F4 = wx.Button( self, wx.ID_ANY, u"<( ̄︶ ̄)↗[GO!]", wx.DefaultPosition, wx.Size( 160,50 ), wx.BORDER_NONE ) + self.B_F4.SetBackgroundColour( wx.Colour( 192, 192, 192 ) ) + wSizer23.Add( self.B_F4, 0, 0, 5 ) self.Tip4 = wx.Button( self, wx.ID_ANY, u"Tip4", wx.DefaultPosition, wx.Size( 200,40 ), wx.BORDER_NONE|wx.BU_LEFT|wx.BU_TOP ) diff --git a/GUI_College.py b/GUI_College.py index ce94ff1..df80780 100644 --- a/GUI_College.py +++ b/GUI_College.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ########################################################################### -## Python code generated with wxFormBuilder (version Oct 26 2018) +## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! @@ -90,6 +90,7 @@ def __init__( self, parent ): self.Centre( wx.BOTH ) # Connect Events + self.Bind( wx.EVT_CLOSE, self.Close ) self.BOX.Bind( wx.EVT_LISTBOX, self.Choise ) self.BOX.Bind( wx.EVT_LISTBOX_DCLICK, self.Choise ) @@ -97,7 +98,10 @@ def __del__( self ): pass - # Virtual event handlers, overide them in your derived class + # Virtual event handlers, override them in your derived class + def Close( self, event ): + event.Skip() + def Choise( self, event ): event.Skip() diff --git a/GUI_SSC.py b/GUI_SSC.py index 2830228..9f60da8 100644 --- a/GUI_SSC.py +++ b/GUI_SSC.py @@ -27,7 +27,7 @@ def __init__( self, parent ): wSizer4 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS ) - self.B_Title = wx.Button( self, wx.ID_ANY, u"RBS_SSC #021.10.30 条形码登记系统", wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE ) + self.B_Title = wx.Button( self, wx.ID_ANY, u"RBS_SSC #021.11.14 条形码登记系统", wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE ) self.B_Title.SetBackgroundColour( wx.Colour( 255, 255, 255 ) ) wSizer4.Add( self.B_Title, 0, wx.ALL, 5 ) @@ -85,14 +85,21 @@ def __init__( self, parent ): self.B_Replace = wx.Button( self, wx.ID_ANY, u"复位", wx.DefaultPosition, wx.DefaultSize, 0 ) wSizer6.Add( self.B_Replace, 0, wx.ALL, 5 ) - Kind_choiceChoices = [ u"A", u"B", u"C" ] + Kind_choiceChoices = [ u"A", u"B", u"C", u"D", u"E", u"F" ] self.Kind_choice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, Kind_choiceChoices, 0 ) self.Kind_choice.SetSelection( 0 ) wSizer6.Add( self.Kind_choice, 0, wx.ALL, 5 ) self.B_Export = wx.Button( self, wx.ID_ANY, u"导出", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.B_Export.Enable( False ) + wSizer6.Add( self.B_Export, 0, wx.ALL, 5 ) + ClassChoices = [ u"Class8", u"Class5" ] + self.Class = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ClassChoices, 0 ) + self.Class.SetSelection( 0 ) + wSizer6.Add( self.Class, 0, wx.ALL, 5 ) + bSizer2.Add( wSizer6, 0, 0, 5 ) @@ -105,8 +112,14 @@ def __init__( self, parent ): # Connect Events self.Bind( wx.EVT_CLOSE, self.Close ) self.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) + self.B_Title.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) + self.GRID.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) + self.T_key_list.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) self.B_Replace.Bind( wx.EVT_BUTTON, self.Replace ) + self.B_Replace.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) self.B_Export.Bind( wx.EVT_BUTTON, self.Export ) + self.Class.Bind( wx.EVT_CHOICE, self.Change_Class ) + self.Class.Bind( wx.EVT_KEY_DOWN, self.Hot_Key_Down ) def __del__( self ): pass @@ -119,10 +132,18 @@ def Close( self, event ): def Hot_Key_Down( self, event ): event.Skip() + + + def Replace( self, event ): event.Skip() + def Export( self, event ): event.Skip() + def Change_Class( self, event ): + event.Skip() + + diff --git a/M_BingWallPaper.py b/M_BingWallPaper.py index 137a21a..b89252b 100644 --- a/M_BingWallPaper.py +++ b/M_BingWallPaper.py @@ -17,13 +17,17 @@ def __init__(self, parent): # 定义主函数 GUI_BingWallPaper.Main.__init__(self, parent) - for i in range(0,4): - print((i)) - picture_url_1 = "https://bing.ioliu.cn/v1/rand" - res = requests.get(picture_url_1, timeout=3600) - network = res.status_code - with open("./Cache/BingWallPaper_1.jpg", "wb") as f: - f.write(res.content) + try: + for i in range(0,4): + print((i)) + picture_url_1 = "https://bing.ioliu.cn/v1/rand" + res = requests.get(picture_url_1, timeout=3600) + network = res.status_code + with open("./Cache/BingWallPaper_1.jpg", "wb") as f: + f.write(res.content) + except: + print('Net ERROR') + def Close(self, event): try: diff --git a/L_College.py b/M_College.py similarity index 91% rename from L_College.py rename to M_College.py index 60d37f6..5627306 100644 --- a/L_College.py +++ b/M_College.py @@ -45,12 +45,20 @@ def Choise(self, event): self.X_score.SetLabel(str('学科水平得分:' + str(X_score))) self.Z_score.SetLabel(str('办学资源得分:' + str(Z_score))) + def Close(self, event): + try: + if app.GetAppName() != '_core.cp38-win_amd64': + self.Destroy() + except: + self.Hide() + ############################## # 主函数 ############################## def main(): + global app app = wx.App(False) frame = CalcFrame(None) frame.Show(True) diff --git a/M_History.py b/M_History.py index 5bfc547..4a4842c 100644 --- a/M_History.py +++ b/M_History.py @@ -15,13 +15,16 @@ class CalcFrame(GUI_History.Main): def __init__(self, parent): # 定义主函数 GUI_History.Main.__init__(self, parent) - url = "https://www.ipip5.com/today/api.php?type=txt" - res = requests.get(url, timeout=3600) - with open("./Cache/History.txt", "wb") as f: - f.write(res.content) + try: + url = "https://www.ipip5.com/today/api.php?type=txt" + res = requests.get(url, timeout=3600) + with open("./Cache/History.txt", "wb") as f: + f.write(res.content) - file = open('./Cache/History.txt', 'r', encoding='utf-8') - self.Info.SetValue(file.read()) + file = open('./Cache/History.txt', 'r', encoding='utf-8') + self.Info.SetValue(file.read()) + except: + self.Info.SetValue('Net ERROR') def Close(self, event): try: diff --git a/M_Pinyin.py b/M_Pinyin.py index a68bf51..6bdb31d 100644 --- a/M_Pinyin.py +++ b/M_Pinyin.py @@ -28,7 +28,6 @@ def Close(self, event): except: self.Hide() - ############################## # 主函数 ############################## diff --git a/M_SSC.py b/M_SSC.py index 5f8d0f1..6f31404 100644 --- a/M_SSC.py +++ b/M_SSC.py @@ -88,6 +88,19 @@ def Export(self, event): workbook.save(get_desktop() + '\Export.xls') print('save finish') + + def Change_Class(self, event): + if self.Class.GetSelection() == 0: + self.GRID.ClearGrid() + for i in range(0,50): + i_a = 801 + i + self.GRID.SetRowLabelValue(i, '0' + str(i_a)) + elif self.Class.GetSelection() == 1: + self.GRID.ClearGrid() + for i in range(0,50): + i_a = 501 + i + self.GRID.SetRowLabelValue(i, '0' + str(i_a)) + def Close(self, event): try: if app.GetAppName() != '_core.cp38-win_amd64': diff --git a/Main.py b/Main.py index 102c091..f868746 100644 --- a/Main.py +++ b/Main.py @@ -49,6 +49,7 @@ import M_Trigonometric # 三角函数 import M_Draw # 画板 import M_SSC # 作业扫码登记系统 +import M_College # 大学评分数据库 import WeaterAPI # 天气API @@ -60,7 +61,6 @@ import P_PPT # PPT小工具 # 临时库 -import L_College ##import YOLO # 辅助功能库 @@ -364,9 +364,6 @@ def User(self, event): def Probe(self, event): Frame_Probe.Show() - - def LLL(self, event): - L_College.main() def GetWeather(self, event): self.Weather.Enable(False) @@ -492,7 +489,7 @@ def Fast_on(self, event): None, M_PPTNG, M_BMI, M_DDT, M_History, M_BingWallPaper,None, None, M_WALP, None, None, None, - M_Music, L_College, M_QRcode, None, + M_Music, M_College, M_QRcode, None, M_Element, None, None, None, M_Gene, None, None, None, M_Roll, M_Base_conversion, M_Roster, M_Timer] @@ -552,6 +549,7 @@ def Net_Tick(self, event): ''' 计时器-网络监视器 ''' + ''' try: ping = str(int(ping3.ping('www.baidu.com') * 1000))[0:3] if int(ping) == 0: @@ -561,6 +559,10 @@ def Net_Tick(self, event): except: self.Network.SetLabel('Net:Ero') + print('net_time') + + ''' + def Time_Tick(self, event): ''' 计时器-时间显示 @@ -943,25 +945,144 @@ def Function1(self, event): FUN_State = 1 if Main_State == 1: - Frame_Pinyin.Show() + Frame_Pinyin.Bind(wx.EVT_CLOSE, self.Function_11) + + if Frame_Pinyin.IsShown() == True: + Frame_Pinyin.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Pinyin.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 2: - Frame_Pi.Show() + Frame_Pi.Bind(wx.EVT_CLOSE, self.Function_12) + + if Frame_Pi.IsShown() == True: + Frame_Pi.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Pi.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 3: - Frame_Capslook.Show() + Frame_Capslook.Bind(wx.EVT_CLOSE, self.Function_13) + + if Frame_Capslook.IsShown() == True: + Frame_Capslook.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Capslook.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 4: - Frame_SSC.Show() + Frame_SSC.Bind(wx.EVT_CLOSE, self.Function_14) + + if Frame_SSC.IsShown() == True: + Frame_SSC.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_SSC.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 5: - Frame_History.Show() + Frame_History.Bind(wx.EVT_CLOSE, self.Function_15) + + if Frame_History.IsShown() == True: + Frame_History.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_History.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 6: - Frame_WALP.Show() + Frame_WALP.Bind(wx.EVT_CLOSE, self.Function_16) + + if Frame_WALP.IsShown() == True: + Frame_WALP.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_WALP.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 7: - Frame_Music.Show() + Frame_Music.Bind(wx.EVT_CLOSE, self.Function_17) + + if Frame_Music.IsShown() == True: + Frame_Music.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Music.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 8: - Frame_Element.Show() + Frame_Element.Bind(wx.EVT_CLOSE, self.Function_18) + + if Frame_Element.IsShown() == True: + Frame_Element.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Element.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 9: - Frame_Gene.Show() + Frame_Gene.Bind(wx.EVT_CLOSE, self.Function_19) + + if Frame_Gene.IsShown() == True: + Frame_Gene.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Gene.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') + elif Main_State == 10: - Frame_Roll.Show() + Frame_Roll.Bind(wx.EVT_CLOSE, self.Function_110) + + if Frame_Roll.IsShown() == True: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Show() + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetLabel('正在运行中~') + self.B_F1.SetForegroundColour('white') def Function2(self, event): ''' 点击事件_按钮2 ''' @@ -969,27 +1090,85 @@ def Function2(self, event): FUN_State = 2 if Main_State == 1: - Frame_Traditional_Chinese.Show() + Frame_Traditional_Chinese.Bind(wx.EVT_CLOSE, self.Function_21) + + if Frame_Traditional_Chinese.IsShown() == True: + Frame_Traditional_Chinese.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Traditional_Chinese.Show() + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetLabel('正在运行中~') + self.B_F2.SetForegroundColour('white') + elif Main_State == 2: - ##M_WxGL.main() wx.MessageBox('未启用,敬请期待!','提示',wx.OK) return elif Main_State == 3: return elif Main_State == 4: - Frame_PPTNG.Show() + Frame_PPTNG.Bind(wx.EVT_CLOSE, self.Function_24) + + if Frame_PPTNG.IsShown() == True: + Frame_PPTNG.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_PPTNG.Show() + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetLabel('正在运行中~') + self.B_F2.SetForegroundColour('white') + elif Main_State == 5: - Frame_BingWallPaper.Show() + Frame_BingWallPaper.Bind(wx.EVT_CLOSE, self.Function_25) + + if Frame_BingWallPaper.IsShown() == True: + Frame_BingWallPaper.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_BingWallPaper.Show() + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetLabel('正在运行中~') + self.B_F2.SetForegroundColour('white') + elif Main_State == 6: return elif Main_State == 7: - wx.CallAfter(L_College.main) + Frame_College.Bind(wx.EVT_CLOSE, self.Function_27) + + if Frame_College.IsShown() == True: + Frame_College.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_College.Show() + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetLabel('正在运行中~') + self.B_F2.SetForegroundColour('white') + elif Main_State == 8: return elif Main_State == 9: return elif Main_State == 10: - Frame_Base_conversion.Show() + Frame_Base_conversion.Bind(wx.EVT_CLOSE, self.Function_210) + + if Frame_Base_conversion.IsShown() == True: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Show() + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetLabel('正在运行中~') + self.B_F2.SetForegroundColour('white') def Function3(self, event): ''' 点击事件_按钮3 ''' @@ -997,25 +1176,84 @@ def Function3(self, event): FUN_State = 3 if Main_State == 1: - Frame_Idion.Show() + Frame_Idion.Bind(wx.EVT_CLOSE, self.Function_31) + + if Frame_Idion.IsShown() == True: + Frame_Idion.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Idion.Show() + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetLabel('正在运行中~') + self.B_F3.SetForegroundColour('white') + elif Main_State == 2: - Frame_Trigonometric.Show() + Frame_Trigonometric.Bind(wx.EVT_CLOSE, self.Function_32) + + if Frame_Trigonometric.IsShown() == True: + Frame_Trigonometric.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Trigonometric.Show() + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetLabel('正在运行中~') + self.B_F3.SetForegroundColour('white') + elif Main_State == 3: return elif Main_State == 4: - Frame_BMI.Show() + Frame_BMI.Bind(wx.EVT_CLOSE, self.Function_34) + + if Frame_BMI.IsShown() == True: + Frame_BMI.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_BMI.Show() + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetLabel('正在运行中~') + self.B_F3.SetForegroundColour('white') + elif Main_State == 5: return elif Main_State == 6: return elif Main_State == 7: - Frame_QRcode.Show() + Frame_QRcode.Bind(wx.EVT_CLOSE, self.Function_37) + + if Frame_QRcode.IsShown() == True: + Frame_QRcode.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_QRcode.Show() + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetLabel('正在运行中~') + self.B_F3.SetForegroundColour('white') + elif Main_State == 8: return elif Main_State == 9: return elif Main_State == 10: - Frame_Roster.Show() + Frame_Roster.Bind(wx.EVT_CLOSE, self.Function_310) + + if Frame_Roster.IsShown() == True: + Frame_Roster.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Roster.Show() + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetLabel('正在运行中~') + self.B_F3.SetForegroundColour('white') def Function4(self, event): ''' 点击事件_按钮4 ''' @@ -1024,24 +1262,469 @@ def Function4(self, event): if Main_State == 1: return elif Main_State == 2: - Frame_Draw.Show() + Frame_Draw.Bind(wx.EVT_CLOSE, self.Function_41) + + if Frame_Draw.IsShown() == True: + Frame_Draw.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_Draw.Show() + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetLabel('正在运行中~') + self.B_F4.SetForegroundColour('white') + elif Main_State == 3: return elif Main_State == 4: - Frame_DDT.Show() + Frame_DDT.Bind(wx.EVT_CLOSE, self.Function_44) + + if Frame_DDT.IsShown() == True: + Frame_DDT.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_DDT.Show() + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetLabel('正在运行中~') + self.B_F4.SetForegroundColour('white') + elif Main_State == 5: return elif Main_State == 6: return elif Main_State == 7: - ##YOLO.video_demo() return elif Main_State == 8: return elif Main_State == 9: return elif Main_State == 10: - Frame_Timer.Show() + Frame_Timer.Bind(wx.EVT_CLOSE, self.Function_410) + + if Frame_Timer.IsShown() == True: + Frame_Timer.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_Timer.Show() + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetLabel('正在运行中~') + self.B_F4.SetForegroundColour('white') + + def Function_11(self, event): + if Main_State == 1: + Frame_Pinyin.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Pinyin.Hide() + + def Function_12(self, event): + if Main_State == 2: + Frame_Pi.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Pi.Hide() + + def Function_13(self, event): + if Main_State == 3: + Frame_Capslook.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Capslook.Hide() + + def Function_14(self, event): + if Main_State == 4: + Frame_SSC.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_SSC.Hide() + + def Function_15(self, event): + if Main_State == 5: + Frame_History.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_History.Hide() + + def Function_16(self, event): + if Main_State == 6: + Frame_WALP.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_WALP.Hide() + + def Function_17(self, event): + if Main_State == 7: + Frame_Music.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Music.Hide() + + def Function_18(self, event): + if Main_State == 8: + Frame_Element.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Element.Hide() + + def Function_19(self, event): + if Main_State == 9: + Frame_Gene.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Gene.Hide() + + def Function_110(self, event): + if Main_State == 10: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + + def Function_21(self, event): + if Main_State == 1: + Frame_Traditional_Chinese.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Traditional_Chinese.Hide() + + def Function_22(self, event): + pass + ''' + if Main_State == 2: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + ''' + + def Function_23(self, event): + pass + ''' + if Main_State == 3: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + ''' + + def Function_24(self, event): + if Main_State == 4: + Frame_PPTNG.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_PPTNG.Hide() + + def Function_25(self, event): + if Main_State == 5: + Frame_BingWallPaper.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_BingWallPaper.Hide() + + def Function_26(self, event): + pass + ''' + if Main_State == 6: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + ''' + + def Function_27(self, event): + if Main_State == 7: + Frame_College.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_College.Hide() + + def Function_28(self, event): + pass + ''' + if Main_State == 8: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + ''' + + def Function_29(self, event): + pass + ''' + if Main_State == 9: + Frame_Roll.Hide() + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F1.SetForegroundColour('black') + else: + Frame_Roll.Hide() + ''' + + def Function_210(self, event): + if Main_State == 10: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + + def Function_31(self, event): + if Main_State == 1: + Frame_Idion.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Idion.Hide() + + def Function_32(self, event): + if Main_State == 2: + Frame_Trigonometric.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Trigonometric.Hide() + + def Function_33(self, event): + pass + ''' + if Main_State == 3: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_34(self, event): + if Main_State == 4: + Frame_BMI.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_BMI.Hide() + + def Function_35(self, event): + pass + ''' + if Main_State == 5: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_36(self, event): + pass + ''' + if Main_State == 6: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_37(self, event): + if Main_State == 7: + Frame_QRcode.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_QRcode.Hide() + + def Function_38(self, event): + pass + ''' + if Main_State == 8: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_39(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_310(self, event): + if Main_State == 10: + Frame_Roster.Hide() + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F3.SetForegroundColour('black') + else: + Frame_Roster.Hide() + + def Function_41(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_42(self, event): + if Main_State == 2: + Frame_Draw.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_Draw.Hide() + + def Function_43(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_44(self, event): + if Main_State == 4: + Frame_DDT.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_DDT.Hide() + + def Function_45(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_46(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_47(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_48(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_49(self, event): + pass + ''' + if Main_State == 9: + Frame_Base_conversion.Hide() + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F2.SetForegroundColour('black') + else: + Frame_Base_conversion.Hide() + ''' + + def Function_410(self, event): + if Main_State == 10: + Frame_Timer.Hide() + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + self.B_F4.SetForegroundColour('black') + else: + Frame_Timer.Hide() # -------------------------------------------------------------------- @@ -1083,9 +1766,16 @@ def G_1(self, event): self.Tip3.SetLabel('拥有一万对成语的接龙,你能顶得住吗?') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + # 功能主标题下方的四个按钮的设置(每四个一组,网络,文件) Function_icon(self, 0, 0, 0, 0, 1, 1, 1, 0) + BUT_CLFN(self, 1) # 检查该功能分区下的四个功能是否正在运行 + self.Refresh() # 刷新屏幕 def G_2(self, event): @@ -1125,8 +1815,15 @@ def G_2(self, event): self.Tip3.SetLabel('简单的三角函数计算器') self.Tip4.SetLabel('简易数学画板') + self.TIP1.SetLabel('') + self.TIP2.SetLabel('状态:测试中') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('状态:测试中') + Function_icon(self, 0, 0, 0, 0, 1, 0, 0, 0) + BUT_CLFN(self, 2) + self.Refresh() def G_3(self, event): @@ -1167,8 +1864,15 @@ def G_3(self, event): self.Tip3.SetLabel('什么都没有呢!') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + Function_icon(self, 0, 0, 0, 0, 0, 0, 0, 0) + BUT_CLFN(self, 3) + self.Refresh() def G_4(self, event): @@ -1209,8 +1913,15 @@ def G_4(self, event): self.Tip3.SetLabel('BMI计算器,简单,易用,但没人关心这个') self.Tip4.SetLabel('(DDT)破环性实验功能,谨慎使用,任何造成的损失后果自负') + self.TIP1.SetLabel('') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('状态:测试中') + Function_icon(self, 1, 0, 0, 1, 1, 1, 0, 0) + BUT_CLFN(self, 4) + self.Refresh() def G_5(self, event): @@ -1251,8 +1962,15 @@ def G_5(self, event): self.Tip3.SetLabel('什么都没有呢!') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('') + self.TIP2.SetLabel('状态:测试中') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + Function_icon(self, 0, 0, 0, 0, 0, 0, 0, 0) + BUT_CLFN(self, 5) + self.Refresh() def G_6(self, event): @@ -1292,8 +2010,15 @@ def G_6(self, event): self.Tip3.SetLabel('什么都没有呢!') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('状态:测试中') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + Function_icon(self, 0, 0, 0, 0, 0, 0, 0, 0) + BUT_CLFN(self, 6) + self.Refresh() def G_7(self, event): @@ -1326,15 +2051,22 @@ def G_7(self, event): self.T_F1.SetLabel("音频分析器") self.T_F2.SetLabel("大学评分数据库") self.T_F3.SetLabel("二维码") - self.T_F4.SetLabel("YOLO实时对象检测") + self.T_F4.SetLabel("None") self.Tip1.SetLabel('对于音频的可视化分析') self.Tip2.SetLabel('临时模块-数据库已完成20%') self.Tip3.SetLabel('二维码生成系统') - self.Tip4.SetLabel('基于openCV和YOLOV3数据集的\n深度神经网络算法') + self.Tip4.SetLabel('') + + self.TIP1.SetLabel('状态:测试中') + self.TIP2.SetLabel('状态:测试中') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') Function_icon(self, 0, 0, 0, 0, 0, 0, 0, 0) + BUT_CLFN(self, 7) + self.Refresh() def G_8(self, event): @@ -1374,7 +2106,14 @@ def G_8(self, event): self.Tip3.SetLabel('什么都没有呢!') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('状态:测试中') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + Function_icon(self, 0, 0, 0, 0, 0, 0, 0, 0) + + BUT_CLFN(self, 8) self.Refresh() @@ -1415,8 +2154,15 @@ def G_9(self, event): self.Tip3.SetLabel('什么都没有呢!') self.Tip4.SetLabel('什么都没有呢!') + self.TIP1.SetLabel('状态:测试中') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('') + self.TIP4.SetLabel('') + Function_icon(self, 0, 0, 0, 0, 1, 0, 0, 0) + BUT_CLFN(self, 9) + self.Refresh() def G_10(self, event): @@ -1456,9 +2202,16 @@ def G_10(self, event): self.Tip2.SetLabel('2进制/8进制/10进制/16进制转换') self.Tip3.SetLabel('将班级值日表显示在电脑壁纸上!') self.Tip4.SetLabel('简单的计时器,真的只是计时') + + self.TIP1.SetLabel('') + self.TIP2.SetLabel('') + self.TIP3.SetLabel('状态:测试中') + self.TIP4.SetLabel('状态:测试中') Function_icon(self, 0, 0, 0, 0, 0, 0, 1, 0) + BUT_CLFN(self, 10) + self.Refresh() ########################################################################### @@ -1515,7 +2268,7 @@ def run(self): x = self.system_mouse_pos[0] - self.frame.GetPosition()[0] y = self.system_mouse_pos[1] - self.frame.GetPosition()[1] while 1: - self.timeToQuit.wait(0.01) + self.timeToQuit.wait(0.001) if self.timeToQuit.isSet(): break self.system_mouse_pos = win32api.GetCursorPos() @@ -1540,7 +2293,7 @@ def main(): global Frame_Roll,Frame_Element,Frame_Pinyin,Frame_Roster,Frame_Gene,Frame_About,Frame_Pi,Frame_Capslook global Frame_Base_conversion,Frame_Traditional_Chinese,Frame_BMI,Frame_PPTNG,Frame_Timer,Frame_Idion,Frame_DDT,Frame_Music global Frame_WALP,Frame_Version,Frame_History,Frame_Date,Frame_File,Frame_QRcode,Frame_BingWallPaper,Frame_Trigonometric - global Frame_Draw,Frame_SSC + global Frame_Draw,Frame_SSC,Frame_College global Frame_User,Frame_Setting,Frame_Plug_in,Frame_Probe @@ -1548,7 +2301,7 @@ def main(): frame = CalcFrame(None) frame.Show(True) - app.SetTopWindow(frame=frame) + ##app.SetTopWindow(frame=frame) Frame_Roll = M_Roll.CalcFrame(None) Frame_Element = M_Element.CalcFrame(None) @@ -1576,6 +2329,7 @@ def main(): Frame_Trigonometric = M_Trigonometric.CalcFrame(None) Frame_Draw = M_Draw.CalcFrame(None) Frame_SSC = M_SSC.CalcFrame(None) + Frame_College = M_College.CalcFrame(None) Frame_User = User.CalcFrame(None) Frame_Setting = Setting.CalcFrame(None) @@ -1584,12 +2338,11 @@ def main(): app.MainLoop() - def Pre_main(): global Frame_Roll,Frame_Element,Frame_Pinyin,Frame_Roster,Frame_Gene,Frame_About,Frame_Pi,Frame_Capslook global Frame_Base_conversion,Frame_Traditional_Chinese,Frame_BMI,Frame_PPTNG,Frame_Timer,Frame_Idion,Frame_DDT,Frame_Music global Frame_WALP,Frame_Version,Frame_History,Frame_Date,Frame_File,Frame_QRcode,Frame_BingWallPaper,Frame_Trigonometric - global Frame_Draw,Frame_SSC + global Frame_Draw,Frame_SSC,Frame_College global Frame_User,Frame_Setting,Frame_Plug_in,Frame_Probe @@ -1622,6 +2375,7 @@ def Pre_main(): Frame_Trigonometric = M_Trigonometric.CalcFrame(None) Frame_Draw = M_Draw.CalcFrame(None) Frame_SSC = M_SSC.CalcFrame(None) + Frame_College = M_College.CalcFrame(None) Frame_User = User.CalcFrame(None) Frame_Setting = Setting.CalcFrame(None) @@ -1661,7 +2415,6 @@ def Colour_clean(self): BackGround_Colour = None Foreground_Colour = None - def Colour_Set(self, note, colour_Main, colour_Bottom, colour_SideL): ''' 用于设置主界面的颜色(GUI) ''' self.Note.SetLabel(note) # 主界面留言设置 @@ -1692,7 +2445,6 @@ def Colour_Set(self, note, colour_Main, colour_Bottom, colour_SideL): self.Side3.SetBackgroundColour(colour_SideL) self.Side4.SetBackgroundColour(colour_SideL) - def Log(): ''' Log日志输出 ''' cfg = configparser.ConfigParser() # 读取设置文件 @@ -1710,7 +2462,6 @@ def Log(): # format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s' # 命名规则 ) - def proc_exist(process_name): ''' 程序运行检查 ''' is_exist = False @@ -1721,7 +2472,6 @@ def proc_exist(process_name): is_exist = True return is_exist - def start(self): ''' 程序初始化界面 @@ -1770,6 +2520,11 @@ def start(self): self.Tip3.Show(buer) self.Tip4.Show(buer) + self.TIP1.Show(buer) + self.TIP2.Show(buer) + self.TIP3.Show(buer) + self.TIP4.Show(buer) + self.Side1.Show(buer) self.Side2.Show(buer) self.Side3.Show(buer) @@ -1844,6 +2599,11 @@ def start(self): self.Tip3.Show(buer) self.Tip4.Show(buer) + self.TIP1.Show(buer) + self.TIP2.Show(buer) + self.TIP3.Show(buer) + self.TIP4.Show(buer) + self.Side1.Show(buer) self.Side2.Show(buer) self.Side3.Show(buer) @@ -1870,7 +2630,6 @@ def start(self): elif setup == 2: return - def Home(self): ''' 返回初始界面 @@ -1924,6 +2683,11 @@ def Home(self): self.Tip3.Show(buer) self.Tip4.Show(buer) + self.TIP1.Show(buer) + self.TIP2.Show(buer) + self.TIP3.Show(buer) + self.TIP4.Show(buer) + self.Side1.Show(buer) self.Side2.Show(buer) self.Side3.Show(buer) @@ -1998,7 +2762,6 @@ def Home(self): self.Refresh() - def resize(self): ''' 通过更改窗口大小触发-->界面刷新 @@ -2007,7 +2770,6 @@ def resize(self): self.SetSize(screen_size_x + 1, screen_size_y) self.SetSize(screen_size_x, screen_size_y) - def Function_icon(self, Internet1, Internet2, Internet3, Internet4, LocalFile1, LocalFile2, LocalFile3, LocalFile4): ''' 功能图标的设置 @@ -2060,6 +2822,222 @@ def Function_icon(self, Internet1, Internet2, Internet3, Internet4, LocalFile1, else: self.File4.SetBitmap(File_OFF) +def BUT_CLFN(self, num): + if num == 1: + if Frame_Pinyin.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Traditional_Chinese.IsShown() == True: + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetForegroundColour('white') + self.B_F2.SetLabel('正在运行中~') + else: + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetForegroundColour('black') + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Idion.IsShown() == True: + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetForegroundColour('white') + self.B_F3.SetLabel('正在运行中~') + else: + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetForegroundColour('black') + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 2: + if Frame_Pi.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Trigonometric.IsShown() == True: + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetForegroundColour('white') + self.B_F3.SetLabel('正在运行中~') + else: + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetForegroundColour('black') + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Draw.IsShown() == True: + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetForegroundColour('white') + self.B_F4.SetLabel('正在运行中~') + else: + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetForegroundColour('black') + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 3: + if Frame_Capslook.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 4: + if Frame_SSC.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_PPTNG.IsShown() == True: + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetForegroundColour('white') + self.B_F2.SetLabel('正在运行中~') + else: + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetForegroundColour('black') + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_BMI.IsShown() == True: + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetForegroundColour('white') + self.B_F3.SetLabel('正在运行中~') + else: + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetForegroundColour('black') + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_DDT.IsShown() == True: + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetForegroundColour('white') + self.B_F4.SetLabel('正在运行中~') + else: + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetForegroundColour('black') + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 5: + if Frame_History.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_BingWallPaper.IsShown() == True: + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetForegroundColour('white') + self.B_F2.SetLabel('正在运行中~') + else: + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetForegroundColour('black') + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 6: + if Frame_WALP.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 7: + if Frame_Music.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_College.IsShown() == True: + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetForegroundColour('white') + self.B_F2.SetLabel('正在运行中~') + else: + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetForegroundColour('black') + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_QRcode.IsShown() == True: + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetForegroundColour('white') + self.B_F3.SetLabel('正在运行中~') + else: + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetForegroundColour('black') + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 8: + if Frame_Element.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + elif num == 9: + if Frame_Gene.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + elif num == 10: + if Frame_Roll.IsShown() == True: + self.B_F1.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F1.SetForegroundColour('white') + self.B_F1.SetLabel('正在运行中~') + else: + self.B_F1.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F1.SetForegroundColour('black') + self.B_F1.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Base_conversion.IsShown() == True: + self.B_F2.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F2.SetForegroundColour('white') + self.B_F2.SetLabel('正在运行中~') + else: + self.B_F2.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F2.SetForegroundColour('black') + self.B_F2.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Roster.IsShown() == True: + self.B_F3.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F3.SetForegroundColour('white') + self.B_F3.SetLabel('正在运行中~') + else: + self.B_F3.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F3.SetForegroundColour('black') + self.B_F3.SetLabel('<( ̄︶ ̄)↗[GO!]') + + if Frame_Timer.IsShown() == True: + self.B_F4.SetBackgroundColour(wx.Colour(252,135,5)) + self.B_F4.SetForegroundColour('white') + self.B_F4.SetLabel('正在运行中~') + else: + self.B_F4.SetBackgroundColour(wx.Colour(192,192,192)) + self.B_F4.SetForegroundColour('black') + self.B_F4.SetLabel('<( ̄︶ ̄)↗[GO!]') def Self_CMD(self, info): ''' diff --git a/Preparation.py b/Preparation.py index 88e7d92..2187dd5 100644 --- a/Preparation.py +++ b/Preparation.py @@ -92,8 +92,13 @@ def timer_Fast(self, event): def Timer_Normal(self, event): self.Text.SetLabel("加载主程序库") - import Main - Frame_main = Main.Pre_main() + import Main + + try: + Frame_main = Main.Pre_main() + except: + self.Text.SetLabel("加载错误:正在重试") + Frame_main = Main.Pre_main() self.Text.SetLabel("生成压缩文件") @@ -158,6 +163,7 @@ def Timer_Normal(self, event): Frame_main.Show() wx.CallAfter(self.Hide) wx.CallAfter(self.Colour_timer.Stop) + print('Pre_Finish') def Colour(self, event): diff --git a/WeaterAPI.py b/WeaterAPI.py index 99afc6b..d09c576 100644 --- a/WeaterAPI.py +++ b/WeaterAPI.py @@ -50,7 +50,7 @@ def Now_weather(): return now_weater except BaseException: print('请检查网络链接') - return 'No network' + return 'W:N/A' def Day3_Weather():