|
| 1 | +#coding=utf-8 |
| 2 | +#import libs |
| 3 | +import sys |
| 4 | +import codecs |
| 5 | +sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) |
| 6 | +import GirlImages_cmd |
| 7 | +import GirlImages_sty |
| 8 | +import Fun |
| 9 | +import os |
| 10 | +import LeftTreeBar |
| 11 | +import RightTextBar |
| 12 | +import tkinter |
| 13 | +from tkinter import * |
| 14 | +import tkinter.ttk |
| 15 | +import tkinter.font |
| 16 | +#Add your Varial Here: (Keep This Line of comments) |
| 17 | +#Define UI Class |
| 18 | +class GirlImages: |
| 19 | + def __init__(self,root,isTKroot = True): |
| 20 | + uiName = self.__class__.__name__ |
| 21 | + Fun.Register(uiName,'UIClass',self) |
| 22 | + self.root = root |
| 23 | + style = GirlImages_sty.SetupStyle() |
| 24 | + if isTKroot == True: |
| 25 | + root.title("Form1") |
| 26 | + Fun.CenterDlg(uiName,root,820,660) |
| 27 | + root['background'] = '#efefef' |
| 28 | + root.bind('<Configure>',self.Configure) |
| 29 | + Form_1= tkinter.Canvas(root,width = 10,height = 4) |
| 30 | + Form_1.place(x = 0,y = 0,width = 820,height = 660) |
| 31 | + Form_1.configure(bg = "#efefef") |
| 32 | + Form_1.configure(highlightthickness = 0) |
| 33 | + Fun.Register(uiName,'root',root) |
| 34 | + Fun.Register(uiName,'Form_1',Form_1) |
| 35 | + #Create the elements of root |
| 36 | + Label_2= tkinter.Label(root,text="网址",width = 10,height = 4) |
| 37 | + Fun.Register(uiName,'Label_2',Label_2) |
| 38 | + Label_2.place(x = 10,y = 2,width = 50,height = 24) |
| 39 | + Label_2.configure(relief = "flat") |
| 40 | + Entry_3_Variable = Fun.AddTKVariable(uiName,'Entry_3','') |
| 41 | + Entry_3= tkinter.Entry(root,textvariable=Entry_3_Variable) |
| 42 | + Fun.Register(uiName,'Entry_3',Entry_3) |
| 43 | + Entry_3.place(x = 60,y = 2,width = 500,height = 24) |
| 44 | + Entry_3.configure(relief = "sunken") |
| 45 | + Label_4= tkinter.Label(root,text="最大数量",width = 10,height = 4) |
| 46 | + Fun.Register(uiName,'Label_4',Label_4) |
| 47 | + Label_4.place(x = 560,y = 2,width = 60,height = 24) |
| 48 | + Label_4.configure(relief = "flat") |
| 49 | + Entry_5_Variable = Fun.AddTKVariable(uiName,'Entry_5','') |
| 50 | + Entry_5= tkinter.Entry(root,textvariable=Entry_5_Variable) |
| 51 | + Fun.Register(uiName,'Entry_5',Entry_5) |
| 52 | + Entry_5.place(x = 620,y = 2,width = 70,height = 24) |
| 53 | + Entry_5.configure(relief = "sunken") |
| 54 | + Button_6= tkinter.Button(root,text="开始",width = 10,height = 4) |
| 55 | + Fun.Register(uiName,'Button_6',Button_6) |
| 56 | + Button_6.place(x = 710,y = 2,width = 50,height = 24) |
| 57 | + Button_6.configure(command=lambda:GirlImages_cmd.Button_6_onCommand(uiName,"Button_6")) |
| 58 | + Button_7= tkinter.Button(root,text="停止",width = 10,height = 4) |
| 59 | + Fun.Register(uiName,'Button_7',Button_7) |
| 60 | + Button_7.place(x = 770,y = 2,width = 50,height = 24) |
| 61 | + Button_7.configure(command=lambda:GirlImages_cmd.Button_7_onCommand(uiName,"Button_7")) |
| 62 | + PanedWindow_8= tkinter.PanedWindow(root) |
| 63 | + Fun.Register(uiName,'PanedWindow_8',PanedWindow_8) |
| 64 | + PanedWindow_8.place(x = 0,y = 30,width = 871,height = 610) |
| 65 | + PanedWindow_8.configure(orient = tkinter.HORIZONTAL) |
| 66 | + PanedWindow_8.configure(showhandle = "0") |
| 67 | + PanedWindow_8.configure(sashrelief = "flat") |
| 68 | + PanedWindow_8.configure(sashwidth = "4") |
| 69 | + PanedWindow_8_child1= tkinter.Canvas(PanedWindow_8,bg="#FFDD94",name="child1") |
| 70 | + PanedWindow_8_child1.place(x = 1,y = 1,width = 261,height = 608) |
| 71 | + LeftTreeBar.LeftTreeBar(PanedWindow_8_child1,False) |
| 72 | + PanedWindow_8.add(PanedWindow_8_child1,width =261) |
| 73 | + PanedWindow_8_child2= tkinter.Canvas(PanedWindow_8,bg="#D0E6A5",name="child2") |
| 74 | + Fun.Register(uiName,'PanedWindow_8_child1',PanedWindow_8_child1) |
| 75 | + Fun.Register(uiName,'PanedWindow_8_child2',PanedWindow_8_child2) |
| 76 | + PanedWindow_8_child2.place(x = 266,y = 1,width = 604,height = 608) |
| 77 | + RightTextBar.RightTextBar(PanedWindow_8_child2,False) |
| 78 | + PanedWindow_8.add(PanedWindow_8_child2,width =604) |
| 79 | + Fun.Register(uiName,'PanedWindow_8_child1',PanedWindow_8_child1) |
| 80 | + Fun.Register(uiName,'PanedWindow_8_child2',PanedWindow_8_child2) |
| 81 | + Label_9= tkinter.Label(root,text="Label",width = 10,height = 4) |
| 82 | + Fun.Register(uiName,'Label_9',Label_9) |
| 83 | + Label_9.place(x = 0,y = 640,width = 820,height = 20) |
| 84 | + Label_9.configure(relief = "flat") |
| 85 | + #Inital all element's Data |
| 86 | + Fun.InitElementData(uiName) |
| 87 | + #Call Form_1's OnLoad Function |
| 88 | + GirlImages_cmd.Form_1_onLoad(uiName) |
| 89 | + #Add Some Logic Code Here: (Keep This Line of comments) |
| 90 | + |
| 91 | + def Configure(self,event): |
| 92 | + if self.root == event.widget: |
| 93 | + PanedWindow_8 = Fun.GetElement(self.__class__.__name__,'PanedWindow_8') |
| 94 | + Label_9 = Fun.GetElement(self.__class__.__name__,'Label_9') |
| 95 | + PanedWindow_8.place(x = 0,y = 50,width = event.width,height = event.height - 51 - 20) |
| 96 | + Label_9.place(x = 0,y = event.height - 20,width = event.width,height = 20) |
| 97 | + |
| 98 | +#Create the root of Kinter |
| 99 | +if __name__ == '__main__': |
| 100 | + root = tkinter.Tk() |
| 101 | + MyDlg = GirlImages(root) |
| 102 | + root.mainloop() |
0 commit comments