Skip to content

Commit 6ca49c6

Browse files
V1.5.0
1. Set shortcut button of background picture 2. Add code debugging function button. 3. Fix bugs that cannot be deleted 4. It supports dragging controls into lableframe and dragging controls out. 5. Revise the project instance again and add the database SQLite instance.
1 parent 14e1d04 commit 6ca49c6

File tree

114 files changed

+6749
-1121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+6749
-1121
lines changed

Examples/CallTest/CallTest.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,41 @@
22

33
#import libs
44
import CallTest_cmd
5+
import CallTest_sty
56
import Fun
67
import tkinter
78
from tkinter import *
89
import tkinter.ttk
910
import tkinter.font
10-
ElementBGArray={}
11-
ElementBGArray_Resize={}
12-
ElementBGArray_IM={}
13-
1411
#Add your Varial Here: (Keep This Line of comments)
1512
#Define UI Class
1613
class CallTest:
1714
def __init__(self,root,isTKroot = True):
18-
className = self.__class__.__name__
19-
Fun.G_UIElementArray[className]={}
20-
Fun.G_ElementBindingDataArray[className]={}
21-
global ElementBGArray
22-
global ElementBGArray_Resize
23-
global ElementBGArray_IM
24-
Fun.AddElement(className,'UIClass',self)
15+
uiName = self.__class__.__name__
16+
Fun.G_UIElementArray[uiName]={}
17+
Fun.G_UIElementUserDataArray[uiName]={}
18+
Fun.Register(uiName,'UIClass',self)
2519
self.root = root
20+
style = CallTest_sty.SetupStyle()
2621
if isTKroot == True:
2722
root.title("Form1")
28-
root.geometry("500x400")
23+
Fun.CenterDlg(uiName,root,500,400)
2924
Form_1= tkinter.Canvas(root,width = 10,height = 4)
3025
Form_1.place(x = 0,y = 0,width = 500,height = 400)
3126
Form_1.configure(bg = "#efefef")
32-
Fun.AddElement(className,'root',root)
33-
Fun.AddElement(className,'Form_1',Form_1)
27+
Form_1.configure(highlightthickness = 0)
28+
Fun.Register(uiName,'root',root)
29+
Fun.Register(uiName,'Form_1',Form_1)
3430
#Create the elements of root
3531
Button_2= tkinter.Button(root,text="调用注册",width = 10,height = 4)
3632
Button_2.place(x = 190,y = 139,width = 100,height = 28)
37-
Button_2.configure(command=lambda:CallTest_cmd.Button_2_onCommand(className,"Button_2"))
38-
Fun.AddElement(className,'Button_2',Button_2)
33+
Button_2.configure(command=lambda:CallTest_cmd.Button_2_onCommand(uiName,"Button_2"))
34+
Fun.Register(uiName,'Button_2',Button_2)
3935
#Inital all element's Data
40-
Fun.InitElementData(className)
36+
Fun.InitElementData(uiName)
4137
#Add Some Logic Code Here: (Keep This Line of comments)
4238

39+
4340
#Create the root of Kinter
4441
if __name__ == '__main__':
4542
root = tkinter.Tk()

Examples/CallTest/CallTest_cmd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
import tkinter.filedialog
88
from tkinter import *
99
import Fun
10-
def Button_2_onCommand(className,widgetName):
10+
ElementBGArray={}
11+
ElementBGArray_Resize={}
12+
ElementBGArray_IM={}
13+
14+
def Button_2_onCommand(uiName,widgetName):
1115
topLevel = tkinter.Toplevel()
1216
topLevel.attributes("-toolwindow", 1)
1317
topLevel.wm_attributes("-topmost", 1)

Examples/CallTest/CallTest_sty.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import tkinter
2+
import tkinter.ttk
3+
def SetupStyle():
4+
style = tkinter.ttk.Style()
5+
return style

Examples/CallTest/Fun.py

Lines changed: 696 additions & 61 deletions
Large diffs are not rendered by default.

Examples/CallTest/RegDlg.py

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#coding=utf-8
2-
32
#import libs
43
import RegDlg_cmd
54
import Fun
@@ -8,32 +7,30 @@
87
import tkinter.ttk
98
import tkinter.font
109
from PIL import Image,ImageTk
11-
1210
ElementBGArray={}
1311
ElementBGArray_Resize={}
1412
ElementBGArray_IM={}
15-
1613
#Add your Varial Here: (Keep This Line of comments)
1714
#Define UI Class
1815
class RegDlg:
1916
def __init__(self,root,isTKroot = True):
20-
className = self.__class__.__name__
21-
Fun.G_UIElementArray[className]={}
22-
Fun.G_ElementBindingDataArray[className]={}
17+
uiName = self.__class__.__name__
18+
Fun.G_UIElementArray[uiName]={}
19+
Fun.G_UIElementUserDataArray[uiName]={}
2320
global ElementBGArray
2421
global ElementBGArray_Resize
2522
global ElementBGArray_IM
26-
Fun.AddElement(className,'UIClass',self)
23+
Fun.Register(uiName,'UIClass',self)
2724
self.root = root
2825
if isTKroot == True:
2926
root.title("Form1")
3027
root.geometry("454x410")
3128
Form_1= tkinter.Canvas(root,width = 10,height = 4)
3229
Form_1.place(x = 0,y = 0,width = 454,height = 410)
3330
Form_1.configure(bg = "#efefef")
34-
Fun.AddElement(className,'root',root)
35-
Fun.AddElement(className,'Form_1',Form_1)
36-
Group_1_Variable = Fun.AddElementVariable(className,'Group_1')
31+
Fun.Register(uiName,'root',root)
32+
Fun.Register(uiName,'Form_1',Form_1)
33+
Group_1_Variable = Fun.AddTKVariable(uiName,'Group_1')
3734
Group_1_Variable.set(1)
3835
#Create the elements of root
3936
Label_2= tkinter.Label(root,text="",width = 10,height = 4)
@@ -44,56 +41,55 @@ def __init__(self,root,isTKroot = True):
4441
Label_2.configure(image = ElementBGArray_IM[2])
4542
Label_2_Ft=tkinter.font.Font(family='System', size=24,weight='bold',slant='roman',underline=0,overstrike=0)
4643
Label_2.configure(font = Label_2_Ft)
47-
Fun.AddElement(className,'Label_2',Label_2)
44+
Fun.Register(uiName,'Label_2',Label_2)
4845
Label_3= tkinter.Label(root,text="注册信息",width = 10,height = 4)
4946
Label_3.place(x = 150,y = 34,width = 206,height = 45)
5047
Label_3_Ft=tkinter.font.Font(family='System', size=29,weight='bold',slant='roman',underline=0,overstrike=0)
5148
Label_3.configure(font = Label_3_Ft)
52-
Fun.AddElement(className,'Label_3',Label_3)
49+
Fun.Register(uiName,'Label_3',Label_3)
5350
Label_4= tkinter.Label(root,text="姓名",width = 10,height = 4)
5451
Label_4.place(x = 53,y = 111,width = 100,height = 20)
55-
Fun.AddElement(className,'Label_4',Label_4)
56-
Entry_5_Variable = Fun.AddElementVariable(className,'Entry_5')
52+
Fun.Register(uiName,'Label_4',Label_4)
53+
Entry_5_Variable = Fun.AddTKVariable(uiName,'Entry_5')
5754
Entry_5= tkinter.Entry(root,textvariable=Entry_5_Variable)
5855
Entry_5.place(x = 175,y = 110,width = 120,height = 20)
5956
Entry_5.configure(relief = "sunken")
60-
Fun.AddElement(className,'Entry_5',Entry_5)
57+
Fun.Register(uiName,'Entry_5',Entry_5)
6158
Label_6= tkinter.Label(root,text="性别",width = 10,height = 4)
6259
Label_6.place(x = 54,y = 146,width = 100,height = 20)
63-
Fun.AddElement(className,'Label_6',Label_6)
60+
Fun.Register(uiName,'Label_6',Label_6)
6461
RadioButton_7= tkinter.Radiobutton(root,variable=Group_1_Variable,value=1,text="男",anchor=tkinter.W)
6562
RadioButton_7.place(x = 173,y = 147,width = 48,height = 20)
66-
Fun.AddElement(className,'RadioButton_7',RadioButton_7)
63+
Fun.Register(uiName,'RadioButton_7',RadioButton_7)
6764
RadioButton_8= tkinter.Radiobutton(root,variable=Group_1_Variable,value=2,text="女",anchor=tkinter.W)
6865
RadioButton_8.place(x = 243,y = 149,width = 48,height = 20)
69-
Fun.AddElement(className,'RadioButton_8',RadioButton_8)
66+
Fun.Register(uiName,'RadioButton_8',RadioButton_8)
7067
Label_9= tkinter.Label(root,text="邮箱",width = 10,height = 4)
7168
Label_9.place(x = 54,y = 181,width = 100,height = 20)
72-
Fun.AddElement(className,'Label_9',Label_9)
73-
Entry_10_Variable = Fun.AddElementVariable(className,'Entry_10')
69+
Fun.Register(uiName,'Label_9',Label_9)
70+
Entry_10_Variable = Fun.AddTKVariable(uiName,'Entry_10')
7471
Entry_10= tkinter.Entry(root,textvariable=Entry_10_Variable)
7572
Entry_10.place(x = 175,y = 185,width = 195,height = 20)
7673
Entry_10.configure(relief = "sunken")
77-
Fun.AddElement(className,'Entry_10',Entry_10)
74+
Fun.Register(uiName,'Entry_10',Entry_10)
7875
Label_11= tkinter.Label(root,text="个人简介",width = 10,height = 4)
7976
Label_11.place(x = 55,y = 220,width = 100,height = 20)
80-
Fun.AddElement(className,'Label_11',Label_11)
77+
Fun.Register(uiName,'Label_11',Label_11)
8178
Text_12= tkinter.Text(root)
8279
Text_12.place(x = 175,y = 220,width = 240,height = 120)
8380
Text_12.configure(relief = "sunken")
84-
Fun.AddElement(className,'Text_12',Text_12)
81+
Fun.Register(uiName,'Text_12',Text_12)
8582
Button_13= tkinter.Button(root,text="确定",width = 10,height = 4)
8683
Button_13.place(x = 176,y = 354,width = 100,height = 28)
87-
Button_13.configure(command =lambda:RegDlg_cmd.Button_13_onCommand(className,"Button_13"))
88-
Fun.AddElement(className,'Button_13',Button_13)
84+
Button_13.configure(command =lambda:RegDlg_cmd.Button_13_onCommand(uiName,"Button_13"))
85+
Fun.Register(uiName,'Button_13',Button_13)
8986
Button_14= tkinter.Button(root,text="取消",width = 10,height = 4)
9087
Button_14.place(x = 310,y = 354,width = 100,height = 28)
91-
Button_14.configure(command =lambda:RegDlg_cmd.Button_14_onCommand(className,"Button_14"))
92-
Fun.AddElement(className,'Button_14',Button_14)
88+
Button_14.configure(command =lambda:RegDlg_cmd.Button_14_onCommand(uiName,"Button_14"))
89+
Fun.Register(uiName,'Button_14',Button_14)
9390
#Inital all element's Data
94-
Fun.InitElementData(className)
91+
Fun.InitElementData(uiName)
9592
#Add Some Logic Code Here: (Keep This Line of comments)
96-
9793
#Create the root of Kinter
9894
if __name__ == '__main__':
9995
root = tkinter.Tk()

Examples/CallTest/RegDlg_cmd.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import tkinter
44
from tkinter import *
55
import Fun
6-
7-
def Button_13_onCommand(className,widgetName):
8-
root = Fun.GetUIEle(className,'root')
9-
UIInputDataArray = Fun.UpdateUIInputDataArray(className)
6+
def Button_13_onCommand(uiName,widgetName):
7+
root = Fun.GetElement(uiName,'root')
8+
UIInputDataArray = Fun.GetInputDataArray(uiName)
109
# print(UIInputDataArray)
1110
root.destroy()
12-
def Button_14_onCommand(className,widgetName):
13-
root = Fun.GetUIEle(className,'root')
11+
def Button_14_onCommand(uiName,widgetName):
12+
root = Fun.GetElement(uiName,'root')
1413
root.destroy()
1.01 KB
Binary file not shown.
319 Bytes
Binary file not shown.
23.2 KB
Binary file not shown.
3.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)