forked from cdhigh/Vb6Tkinter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmOption.frm
231 lines (220 loc) · 6.88 KB
/
frmOption.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
VERSION 5.00
Begin VB.Form frmOption
BorderStyle = 3 'Fixed Dialog
Caption = "配置"
ClientHeight = 1275
ClientLeft = 2565
ClientTop = 1500
ClientWidth = 7710
Icon = "frmOption.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1275
ScaleWidth = 7710
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin TkinterDesigner.xpcmdbutton cmdOptionCancel
Height = 375
Left = 5640
TabIndex = 11
Top = 720
Width = 1695
_ExtentX = 2990
_ExtentY = 661
Caption = "取消(&C)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin TkinterDesigner.xpcmdbutton cmdOptionOK
Height = 375
Left = 3000
TabIndex = 10
Top = 720
Width = 1695
_ExtentX = 2990
_ExtentY = 661
Caption = "确定(&O)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin TkinterDesigner.xpcmdbutton cmdOptionApply
Height = 375
Left = 360
TabIndex = 9
Top = 720
Width = 1695
_ExtentX = 2990
_ExtentY = 661
Caption = "应用(&A)"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin TkinterDesigner.xpcmdbutton cmdPythonExe
Height = 255
Left = 7080
TabIndex = 8
Top = 120
Width = 495
_ExtentX = 873
_ExtentY = 450
Caption = "..."
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.ComboBox cmbPythonExe
Height = 300
Left = 1440
TabIndex = 1
Top = 120
Width = 5535
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 3
Left = -20000
ScaleHeight = 3780
ScaleWidth = 5685
TabIndex = 4
TabStop = 0 'False
Top = 480
Width = 5685
Begin VB.Frame fraSample4
Caption = "示例 4"
Height = 1785
Left = 2100
TabIndex = 7
Top = 840
Width = 2055
End
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 2
Left = -20000
ScaleHeight = 3780
ScaleWidth = 5685
TabIndex = 3
TabStop = 0 'False
Top = 480
Width = 5685
Begin VB.Frame fraSample3
Caption = "示例 3"
Height = 1785
Left = 1545
TabIndex = 6
Top = 675
Width = 2055
End
End
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Height = 3780
Index = 1
Left = -20000
ScaleHeight = 3780
ScaleWidth = 5685
TabIndex = 2
TabStop = 0 'False
Top = 480
Width = 5685
Begin VB.Frame fraSample2
Caption = "示例 2"
Height = 1785
Left = 645
TabIndex = 5
Top = 300
Width = 2055
End
End
Begin VB.Label lblPythonExe
Caption = "Python主文件"
Height = 255
Left = 120
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "frmOption"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdOptionApply_Click()
ApplySetting
End Sub
Private Sub cmdOptionOK_Click()
If ApplySetting() Then
Unload Me
End If
End Sub
Private Sub cmdOptionCancel_Click()
Unload Me
End Sub
'应用配置,返回true表示成功
Private Function ApplySetting() As Boolean
Dim sExe As String
sExe = Trim$(cmbPythonExe.Text)
If Len(sExe) Then
If Dir(sExe) = "" Then
MsgBox L_F("l_msgFileNotExist", "{0} 文件不存在!", sExe), vbInformation
Exit Function
End If
Else
MsgBox L("l_msgFileFieldNull", "文件不能为空!"), vbInformation
Exit Function
End If
g_PythonExe = sExe
SaveSetting App.Title, "Settings", "PythonExe", sExe
ApplySetting = True
End Function
Private Sub cmdPythonExe_Click()
Dim sF As String
sF = FileDialog(Me, False, L("l_fdOpen", "请选择文件"), "python(w).exe|python*.exe", cmbPythonExe.Text)
If Len(sF) Then
cmbPythonExe.Text = sF
End If
End Sub
Private Sub Form_Load()
Dim ctl As Control
'多语种支持
Me.Caption = L(Me.Name, Me.Caption)
For Each ctl In Me.Controls
If TypeName(ctl) = "xpcmdbutton" Or TypeName(ctl) = "Label" Then
ctl.Caption = L(ctl.Name, ctl.Caption)
End If
Next
End Sub