|
2 | 2 |
|
3 | 3 | #import libs |
4 | 4 | import Page1_cmd |
5 | | -import Page1_sty |
6 | 5 | import Fun |
7 | | -import os |
8 | 6 | import tkinter |
9 | 7 | from tkinter import * |
10 | 8 | import tkinter.ttk |
11 | 9 | import tkinter.font |
| 10 | +ElementBGArray={} |
| 11 | +ElementBGArray_Resize={} |
| 12 | +ElementBGArray_IM={} |
| 13 | + |
12 | 14 | #Add your Varial Here: (Keep This Line of comments) |
13 | 15 | #Define UI Class |
14 | 16 | class Page1: |
15 | 17 | def __init__(self,root,isTKroot = True): |
16 | 18 | uiName = self.__class__.__name__ |
17 | 19 | Fun.Register(uiName,'UIClass',self) |
18 | 20 | self.root = root |
19 | | - style = Page1_sty.SetupStyle() |
| 21 | + Fun.Register(uiName,'root',root) |
20 | 22 | if isTKroot == True: |
21 | 23 | root.title("Form1") |
22 | | - Fun.CenterDlg(uiName,root,627,163) |
23 | | - root['background'] = '#efefef' |
| 24 | + root.geometry("574x150") |
24 | 25 | Form_1= tkinter.Canvas(root,width = 10,height = 4) |
25 | | - Form_1.place(x = 0,y = 0,width = 627,height = 163) |
| 26 | + Form_1.place(x = 0,y = 0,width = 574,height = 150) |
26 | 27 | Form_1.configure(bg = "#efefef") |
27 | | - Form_1.configure(highlightthickness = 0) |
28 | | - Fun.Register(uiName,'root',root) |
29 | 28 | Fun.Register(uiName,'Form_1',Form_1) |
30 | 29 | Group_1_Variable = Fun.AddTKVariable(uiName,'Group_1') |
31 | 30 | Group_1_Variable.set(1) |
32 | 31 | #Create the elements of root |
| 32 | + Label_2= tkinter.Label(root,text="姓名",width = 10,height = 4) |
| 33 | + Label_2.place(x = 18,y = 13,width = 82,height = 20) |
| 34 | + Fun.Register(uiName,'Label_2',Label_2) |
| 35 | + Entry_3_Variable = Fun.AddTKVariable(uiName,'Entry_3') |
| 36 | + Entry_3= tkinter.Entry(root,textvariable=Entry_3_Variable) |
| 37 | + Entry_3.place(x = 120,y = 14,width = 120,height = 20) |
| 38 | + Entry_3.configure(relief = "sunken") |
| 39 | + Fun.Register(uiName,'Entry_3',Entry_3) |
| 40 | + Label_4= tkinter.Label(root,text="性别",width = 10,height = 4) |
| 41 | + Label_4.place(x = 18,y = 44,width = 82,height = 20) |
| 42 | + Fun.Register(uiName,'Label_4',Label_4) |
| 43 | + RadioButton_5= tkinter.Radiobutton(root,variable=Group_1_Variable,value=1,text="男",anchor=tkinter.W) |
| 44 | + RadioButton_5.place(x = 116,y = 45,width = 68,height = 19) |
| 45 | + Fun.Register(uiName,'RadioButton_5',RadioButton_5,None,'Group_1') |
| 46 | + RadioButton_6= tkinter.Radiobutton(root,variable=Group_1_Variable,value=2,text="女",anchor=tkinter.W) |
| 47 | + RadioButton_6.place(x = 191,y = 44,width = 100,height = 20) |
| 48 | + Fun.Register(uiName,'RadioButton_6',RadioButton_6,None,'Group_1') |
| 49 | + Label_7= tkinter.Label(root,text="年龄",width = 10,height = 4) |
| 50 | + Label_7.place(x = 18,y = 78,width = 82,height = 20) |
| 51 | + Fun.Register(uiName,'Label_7',Label_7) |
| 52 | + Entry_8_Variable = Fun.AddTKVariable(uiName,'Entry_8') |
| 53 | + Entry_8= tkinter.Entry(root,textvariable=Entry_8_Variable) |
| 54 | + Entry_8.place(x = 121,y = 75,width = 120,height = 20) |
| 55 | + Entry_8.configure(relief = "sunken") |
| 56 | + Fun.Register(uiName,'Entry_8',Entry_8) |
| 57 | + Label_9= tkinter.Label(root,text="地址",width = 10,height = 4) |
| 58 | + Label_9.place(x = 18,y = 110,width = 82,height = 20) |
| 59 | + Fun.Register(uiName,'Label_9',Label_9) |
| 60 | + ComboBox_10_Variable = Fun.AddTKVariable(uiName,'ComboBox_10') |
| 61 | + ComboBox_10= tkinter.ttk.Combobox(root,textvariable=ComboBox_10_Variable, state="readonly") |
| 62 | + ComboBox_10.place(x = 120,y = 110,width = 124,height = 20) |
| 63 | + ComboBox_10.configure(state = "readonly") |
| 64 | + ComboBox_10["values"]=['北京','天津','上海'] |
| 65 | + ComboBox_10.current(0) |
| 66 | + Fun.Register(uiName,'ComboBox_10',ComboBox_10) |
| 67 | + Button_11= tkinter.Button(root,text="增加",width = 10,height = 4) |
| 68 | + Button_11.place(x = 448,y = 103,width = 100,height = 28) |
| 69 | + Button_11.configure(command=lambda:Page1_cmd.Button_11_onCommand(uiName,"Button_11")) |
| 70 | + Fun.Register(uiName,'Button_11',Button_11) |
33 | 71 | #Inital all element's Data |
34 | 72 | Fun.InitElementData(uiName) |
35 | 73 | #Add Some Logic Code Here: (Keep This Line of comments) |
36 | 74 |
|
37 | | - |
38 | 75 | #Create the root of Kinter |
39 | 76 | if __name__ == '__main__': |
40 | 77 | root = tkinter.Tk() |
|
0 commit comments