Example #1
0
 def __init__(self, root, isTKroot=True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className] = {}
     Fun.G_ElementBindingDataArray[className] = {}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className, 'UIClass', self)
     self.root = root
     if isTKroot == True:
         root.title("Form1")
         root.geometry("543x244")
     Form_1 = tkinter.Canvas(root, width=10, height=4)
     Form_1.place(x=0, y=0, width=543, height=244)
     Form_1.configure(bg="#efefef")
     Fun.AddElement(className, 'root', root)
     Fun.AddElement(className, 'Form_1', Form_1)
     #Create the elements of root
     Entry_2_Variable = Fun.AddElementVariable(className, 'Entry_2')
     Entry_2 = tkinter.Entry(root, textvariable=Entry_2_Variable)
     Entry_2.place(x=93, y=20, width=120, height=20)
     Entry_2.configure(bg="#ffffff")
     Entry_2.configure(relief="sunken")
     Fun.AddUIData(className, 'Entry_2', 'IPAddr', 'string', '127.0.0.1', 1)
     Fun.AddElement(className, 'Entry_2', Entry_2)
     Label_3 = tkinter.Label(root, text="端口", width=10, height=4)
     Label_3.place(x=216, y=19, width=74, height=20)
     Fun.AddElement(className, 'Label_3', Label_3)
     Entry_4_Variable = Fun.AddElementVariable(className, 'Entry_4')
     Entry_4 = tkinter.Entry(root, textvariable=Entry_4_Variable)
     Entry_4.place(x=294, y=19, width=120, height=20)
     Entry_4.configure(relief="sunken")
     Fun.AddUIData(className, 'Entry_4', 'Port', 'int', 8888, 1)
     Fun.AddElement(className, 'Entry_4', Entry_4)
     Button_5 = tkinter.Button(root, text="启动", width=10, height=4)
     Button_5.place(x=433, y=16, width=100, height=28)
     Button_5.configure(command=lambda: Server_cmd.Button_5_onCommand(
         className, "Button_5"))
     Fun.AddElement(className, 'Button_5', Button_5)
     ListBox_6 = tkinter.Listbox(root)
     ListBox_6.place(x=21, y=57, width=394, height=160)
     Fun.AddElement(className, 'ListBox_6', ListBox_6)
     Label_7 = tkinter.Label(root, text="IP地址", width=10, height=4)
     Label_7.place(x=4, y=21, width=74, height=20)
     Fun.AddElement(className, 'Label_7', Label_7)
     import MySocket
     MySocket_9 = MySocket.MySocket()
     #MySocket_9.xy(4,21)
     MySocket_9.set_HOST('127.0.0.1')
     MySocket_9.set_PORT('8888')
     MySocket_9.set_LISTBOX(ListBox_6)
     Fun.AddElement(className, 'MySocket_9', MySocket_9)
     #Inital all element's Data
     Fun.InitElementData(className)
Example #2
0
 def __init__(self, root, isTKroot=True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className] = {}
     Fun.G_ElementBindingDataArray[className] = {}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className, 'UIClass', self)
     self.root = root
     style = Server_sty.SetupStyle()
     if isTKroot == True:
         root.title("Form1")
         root.geometry("543x244")
     Form_1 = tkinter.Canvas(root, width=10, height=4)
     Form_1.place(x=0, y=0, width=543, height=244)
     Form_1.configure(bg="#efefef")
     Fun.AddElement(className, 'root', root)
     Fun.AddElement(className, 'Form_1', Form_1)
     #Create the elements of root
     Entry_2_Variable = Fun.AddElementVariable(className, 'Entry_2')
     Entry_2 = tkinter.Entry(root, textvariable=Entry_2_Variable)
     Entry_2.place(x=93, y=20, width=120, height=20)
     Entry_2.configure(bg="#ffffff")
     Entry_2.configure(relief="sunken")
     Fun.AddUIData(className, 'Entry_2', 'IPAddr', 'string', '127.0.0.1', 1)
     Fun.AddElement(className, 'Entry_2', Entry_2)
     Label_3 = tkinter.Label(root, text="端口", width=10, height=4)
     Label_3.place(x=216, y=19, width=74, height=20)
     Label_3_Ft
Example #3
0
 def __init__(self, root, isTKroot=True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className] = {}
     Fun.G_ElementBindingDataArray[className] = {}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className, 'UIClass', self)
     self.root = root
     if isTKroot == True:
         root.title("Form1")
         root.geometry("216x215")
     Form_1 = tkinter.Canvas(root, width=10, height=4)
     Form_1.place(x=0, y=0, width=216, height=215)
     Form_1.configure(bg="#efefef")
     Fun.AddElement(className, 'root', root)
     Fun.AddElement(className, 'Form_1', Form_1)
     #Create the elements of root
     Label_2 = tkinter.Label(root, text="", width=10, height=4)
     Label_2.place(x=10, y=10, width=190, height=30)
     Label_2.configure(bg="#808080")
     Label_2.configure(fg="#ffffff")
     Fun.AddUIData(className, 'Label_2', 'Count', 'float', 0.0, 1)
     Fun.AddUIData(className, 'Label_2', 'MidCount', 'float', 0.0, 0)
     Fun.AddUIData(className, 'Label_2', 'OpType', 'int', 0, 0)
     Fun.AddElement(className, 'Label_2', Label_2)
     Button_3 = tkinter.Button(root, text="1", width=10, height=4)
     Button_3.place(x=10, y=50, width=40, height=30)
     Button_3.configure(relief="groove")
     Button_3.configure(
         command=lambda: JSQ_cmd.Button_3_onCommand(className, "Button_3"))
     Fun.AddElement(className, 'Button_3', Button_3)
     Button_4 = tkinter.Button(root, text="2", width=10, height=4)
     Button_4.place(x=60, y=50, width=40, height=30)
     Button_4.configure(relief="groove")
     Button_4.configure(
         command=lambda: JSQ_cmd.Button_4_onCommand(className, "Button_4"))
     Fun.AddElement(className, 'Button_4', Button_4)
     Button_5 = tkinter.Button(root, text="3", width=10, height=4)
     Button_5.place(x=110, y=50, width=40, height=30)
     Button_5.configure(relief="groove")
     Button_5.configure(
         command=lambda: JSQ_cmd.Button_5_onCommand(className, "Button_5"))
     Fun.AddElement(className, 'Button_5', Button_5)
     Button_6 = tkinter.Button(root, text="4", width=10, height=4)
     Button_6.place(x=10, y=90, width=40, height=30)
     Button_6.configure(relief="groove")
     Button_6.configure(
         command=lambda: JSQ_cmd.Button_6_onCommand(className, "Button_6"))
     Fun.AddElement(className, 'Button_6', Button_6)
     Button_7 = tkinter.Button(root, text="5", width=10, height=4)
     Button_7.place(x=60, y=90, width=40, height=30)
     Button_7.configure(relief="groove")
     Button_7.configure(
         command=lambda: JSQ_cmd.Button_7_onCommand(className, "Button_7"))
     Fun.AddElement(className, 'Button_7', Button_7)
     Button_8 = tkinter.Button(root, text="6", width=10, height=4)
     Button_8.place(x=110, y=90, width=40, height=30)
     Button_8.configure(relief="groove")
     Button_8.configure(
         command=lambda: JSQ_cmd.Button_8_onCommand(className, "Button_8"))
     Fun.AddElement(className, 'Button_8', Button_8)
     Button_9 = tkinter.Button(root, text="7", width=10, height=4)
     Button_9.place(x=10, y=130, width=40, height=30)
     Button_9.configure(relief="groove")
     Button_9.configure(
         command=lambda: JSQ_cmd.Button_9_onCommand(className, "Button_9"))
     Fun.AddElement(className, 'Button_9', Button_9)
     Button_10 = tkinter.Button(root, text="8", width=10, height=4)
     Button_10.place(x=60, y=130, width=40, height=30)
     Button_10.configure(relief="groove")
     Button_10.configure(command=lambda: JSQ_cmd.Button_10_onCommand(
         className, "Button_10"))
     Fun.AddElement(className, 'Button_10', Button_10)
     Button_11 = tkinter.Button(root, text="9", width=10, height=4)
     Button_11.place(x=110, y=130, width=40, height=30)
     Button_11.configure(relief="groove")
     Button_11.configure(command=lambda: JSQ_cmd.Button_11_onCommand(
         className, "Button_11"))
     Fun.AddElement(className, 'Button_11', Button_11)
     Button_12 = tkinter.Button(root, text="0", width=10, height=4)
     Button_12.place(x=10, y=170, width=40, height=30)
     Button_12.configure(relief="groove")
     Button_12.configure(command=lambda: JSQ_cmd.Button_12_onCommand(
         className, "Button_12"))
     Fun.AddElement(className, 'Button_12', Button_12)
     Button_13 = tkinter.Button(root, text="C", width=10, height=4)
     Button_13.place(x=60, y=170, width=40, height=30)
     Button_13.configure(relief="groove")
     Button_13.configure(command=lambda: JSQ_cmd.Button_13_onCommand(
         className, "Button_13"))
     Fun.AddElement(className, 'Button_13', Button_13)
     Button_14 = tkinter.Button(root, text="=", width=10, height=4)
     Button_14.place(x=110, y=169, width=40, height=30)
     Button_14.configure(relief="groove")
     Button_14.configure(command=lambda: JSQ_cmd.Button_14_onCommand(
         className, "Button_14"))
     Fun.AddElement(className, 'Button_14', Button_14)
     Button_15 = tkinter.Button(root, text="+", width=10, height=4)
     Button_15.place(x=160, y=50, width=40, height=30)
     Button_15.configure(relief="groove")
     Button_15.configure(command=lambda: JSQ_cmd.Button_15_onCommand(
         className, "Button_15"))
     Fun.AddElement(className, 'Button_15', Button_15)
     Button_16 = tkinter.Button(root, text="-", width=10, height=4)
     Button_16.place(x=160, y=90, width=40, height=30)
     Button_16.configure(relief="groove")
     Button_16.configure(command=lambda: JSQ_cmd.Button_16_onCommand(
         className, "Button_16"))
     Fun.AddElement(className, 'Button_16', Button_16)
     Button_17 = tkinter.Button(root, text="X", width=10, height=4)
     Button_17.place(x=160, y=130, width=40, height=30)
     Button_17.configure(relief="groove")
     Button_17.configure(command=lambda: JSQ_cmd.Button_17_onCommand(
         className, "Button_17"))
     Fun.AddElement(className, 'Button_17', Button_17)
     Button_18 = tkinter.Button(root, text="/", width=10, height=4)
     Button_18.place(x=160, y=170, width=40, height=30)
     Button_18.configure(relief="groove")
     Button_18.configure(command=lambda: JSQ_cmd.Button_18_onCommand(
         className, "Button_18"))
     Fun.AddElement(className, 'Button_18', Button_18)
     #Create the Menu of root
     MainMenu = tkinter.Menu(root)
     root.config(menu=MainMenu)
     A = tkinter.Menu(MainMenu, tearoff=0)
     A1 = tkinter.Menu(A, tearoff=0)
     A1.add_command(label="A11",
                    command=lambda: JSQ_cmd.Menu_A11(className, "A11"))
     A.add_cascade(label="A1", menu=A1)
     MainMenu.add_cascade(label="A", menu=A)
     B = tkinter.Menu(MainMenu, tearoff=0)
     B.add_command(label="B2",
                   command=lambda: JSQ_cmd.Menu_B2(className, "B2"))
     MainMenu.add_cascade(label="B", menu=B)
     #Inital all element's Data
     Fun.InitElementData(className)
Example #4
0
 def __init__(self, root, isTKroot=True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className] = {}
     Fun.G_ElementBindingDataArray[className] = {}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className, 'UIClass', self)
     self.root = root
     if isTKroot == True:
         root.title("Form1")
         root.geometry("564x296")
     Form_1 = tkinter.Canvas(root, width=10, height=4)
     Form_1.place(x=0, y=0, width=564, height=296)
     Form_1.configure(bg="#efefef")
     Fun.AddElement(className, 'root', root)
     Fun.AddElement(className, 'Form_1', Form_1)
     #Create the elements of root
     Label_2 = tkinter.Label(root, text="服务器IP", width=10, height=4)
     Label_2.place(x=15, y=15, width=69, height=20)
     Label_2.configure(bg="#efefef")
     Fun.AddElement(className, 'Label_2', Label_2)
     Entry_3_Variable = Fun.AddElementVariable(className, 'Entry_3')
     Entry_3 = tkinter.Entry(root, textvariable=Entry_3_Variable)
     Entry_3.place(x=99, y=15, width=120, height=20)
     Entry_3.configure(relief="sunken")
     Fun.AddUIData(className, 'Entry_3', 'IPAddr', 'string', '127.0.0.1', 1)
     Fun.AddElement(className, 'Entry_3', Entry_3)
     Label_4 = tkinter.Label(root, text="服务器端口", width=10, height=4)
     Label_4.place(x=235, y=14, width=69, height=20)
     Fun.AddElement(className, 'Label_4', Label_4)
     Entry_5_Variable = Fun.AddElementVariable(className, 'Entry_5')
     Entry_5 = tkinter.Entry(root, textvariable=Entry_5_Variable)
     Entry_5.place(x=315, y=13, width=120, height=20)
     Entry_5.configure(relief="sunken")
     Fun.AddUIData(className, 'Entry_5', 'Port', 'int', '8888', 1)
     Fun.AddElement(className, 'Entry_5', Entry_5)
     Label_6 = tkinter.Label(root, text="发送内容", width=10, height=4)
     Label_6.place(x=14, y=49, width=69, height=20)
     Fun.AddElement(className, 'Label_6', Label_6)
     Entry_7_Variable = Fun.AddElementVariable(className, 'Entry_7')
     Entry_7 = tkinter.Entry(root, textvariable=Entry_7_Variable)
     Entry_7.place(x=99, y=49, width=335, height=20)
     Entry_7.configure(relief="sunken")
     Fun.AddElement(className, 'Entry_7', Entry_7)
     Button_8 = tkinter.Button(root, text="连接", width=10, height=4)
     Button_8.place(x=448, y=10, width=100, height=28)
     Button_8.configure(command=lambda: Client_cmd.Button_8_onCommand(
         className, "Button_8"))
     Fun.AddElement(className, 'Button_8', Button_8)
     Button_9 = tkinter.Button(root, text="发送", width=10, height=4)
     Button_9.place(x=448, y=45, width=100, height=28)
     Button_9.configure(command=lambda: Client_cmd.Button_9_onCommand(
         className, "Button_9"))
     Fun.AddElement(className, 'Button_9', Button_9)
     ListBox_10 = tkinter.Listbox(root)
     ListBox_10.place(x=21, y=87, width=528, height=197)
     Fun.AddElement(className, 'ListBox_10', ListBox_10)
     import MySocket
     MySocket_11 = MySocket.MySocket()
     #MySocket_11.xy(21,87)
     MySocket_11.set_HOST('127.0.0.1')
     MySocket_11.set_PORT('8888')
     MySocket_11.set_LISTBOX(ListBox_10)
     Fun.AddElement(className, 'MySocket_11', MySocket_11)
     #Inital all element's Data
     Fun.InitElementData(className)
Example #5
0
 def __init__(self,root,isTKroot = True):
     className = self.__class__.__name__
     Fun.G_UIElementArray[className]={}
     Fun.G_ElementBindingDataArray[className]={}
     global ElementBGArray
     global ElementBGArray_Resize
     global ElementBGArray_IM
     Fun.AddElement(className,'UIClass',self)
     self.root = root
     if isTKroot == True:
         root.title("股票监控")
         root.geometry("906x363")
     Form_1= tkinter.Canvas(root,width = 10,height = 4)
     Form_1.place(x = 0,y = 0,width = 906,height = 363)
     Form_1.configure(bg = "#efefef")
     Fun.AddElement(className,'root',root)
     Fun.AddElement(className,'Form_1',Form_1)
     #Create the elements of root 
     Label_2= tkinter.Label(root,text="股票代码",width = 10,height = 4)
     Label_2.place(x = -22,y = 27,width = 107,height = 22)
     Fun.AddElement(className,'Label_2',Label_2)
     Entry_3_Variable = Fun.AddElementVariable(className,'Entry_3')
     Entry_3= tkinter.Entry(root,textvariable=Entry_3_Variable)
     Entry_3.place(x = 68,y = 29,width = 164,height = 20)
     Entry_3.configure(relief = "sunken")
     Fun.AddElement(className,'Entry_3',Entry_3)
     Button_4= tkinter.Button(root,text="增加股票",width = 10,height = 4)
     Button_4.place(x = 463,y = 24,width = 100,height = 28)
     Button_4.configure(command=lambda:StockPrice_cmd.Button_4_onCommand(className,"Button_4"))
     Fun.AddElement(className,'Button_4',Button_4)
     Button_6= tkinter.Button(root,text="启动监控",width = 10,height = 4)
     Button_6.place(x = 790,y = 25,width = 100,height = 28)
     Button_6.configure(command=lambda:StockPrice_cmd.Button_6_onCommand(className,"Button_6"))
     Fun.AddElement(className,'Button_6',Button_6)
     Label_9= tkinter.Label(root,text="最高价",width = 10,height = 4)
     Label_9.place(x = 179,y = 27,width = 55,height = 20)
     Fun.AddElement(className,'Label_9',Label_9)
     Entry_10_Variable = Fun.AddElementVariable(className,'Entry_10')
     Entry_10= tkinter.Entry(root,textvariable=Entry_10_Variable)
     Entry_10.place(x = 380,y = 28,width = 76,height = 20)
     Entry_10.configure(relief = "sunken")
     Fun.AddElement(className,'Entry_10',Entry_10)
     Label_11= tkinter.Label(root,text="最低价",width = 10,height = 4)
     Label_11.place(x = 315,y = 25,width = 55,height = 20)
     Fun.AddElement(className,'Label_11',Label_11)
     Entry_12_Variable = Fun.AddElementVariable(className,'Entry_12')
     Entry_12= tkinter.Entry(root,textvariable=Entry_12_Variable)
     Entry_12.place(x = 235,y = 26,width = 70,height = 20)
     Entry_12.configure(relief = "sunken")
     Fun.AddElement(className,'Entry_12',Entry_12)
     TreeView_13= tkinter.ttk.Treeview(root,show="tree")
     TreeView_13.place(x = 17,y = 65,width = 875,height = 291)
     TreeView_13.configure(show = "headings")
     TreeView_13.configure(selectmode = "extended")
     TreeView_13.configure(columns = ["股票代码","股票名称","当前时间","当前价","限制最高","限制最低","警报"])
     TreeView_13.column("股票代码",anchor="center",width=90)
     TreeView_13.heading("股票代码",text="股票代码")
     TreeView_13.column("股票名称",anchor="center",width=90)
     TreeView_13.heading("股票名称",text="股票名称")
     TreeView_13.column("当前时间",anchor="center",width=90)
     TreeView_13.heading("当前时间",text="当前时间")
     TreeView_13.column("当前价",anchor="center",width=80)
     TreeView_13.heading("当前价",text="当前价")
     TreeView_13.column("限制最高",anchor="center",width=80)
     TreeView_13.heading("限制最高",text="限制最高")
     TreeView_13.column("限制最低",anchor="center",width=80)
     TreeView_13.heading("限制最低",text="限制最低")
     TreeView_13.column("警报",anchor="center",width=100)
     TreeView_13.heading("警报",text="警报")
     Fun.AddUIData(className,'TreeView_13','StockArray','list',[],0)
     Fun.AddElement(className,'TreeView_13',TreeView_13)
     Label_16= tkinter.Label(root,text="通知手机",width = 10,height = 4)
     Label_16.place(x = 571,y = 26,width = 81,height = 23)
     Fun.AddElement(className,'Label_16',Label_16)
     Entry_17_Variable = Fun.AddElementVariable(className,'Entry_17')
     Entry_17= tkinter.Entry(root,textvariable=Entry_17_Variable)
     Entry_17.place(x = 652,y = 28,width = 126,height = 20)
     Entry_17.configure(relief = "sunken")
     Fun.AddElement(className,'Entry_17',Entry_17)
     #Inital all element's Data 
     Fun.InitElementData(className)