-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfrmAgregarCTL.frm
More file actions
364 lines (326 loc) · 11 KB
/
Copy pathfrmAgregarCTL.frm
File metadata and controls
364 lines (326 loc) · 11 KB
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
VERSION 5.00
Begin VB.Form frmAgregarCTL
BorderStyle = 3 'Fixed Dialog
Caption = "Agregar Control"
ClientHeight = 3345
ClientLeft = 1710
ClientTop = 3135
ClientWidth = 6180
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmAgregarCTL.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 223
ScaleMode = 3 'Pixel
ScaleWidth = 412
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmd
Caption = "&Aceptar"
Default = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 4890
TabIndex = 11
Top = 105
Width = 1215
End
Begin VB.CommandButton cmd
Caption = "&Salir"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 4890
TabIndex = 10
Top = 540
Width = 1215
End
Begin VB.PictureBox picDraw
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H80000005&
ForeColor = &H00C0FFFF&
Height = 3210
Left = 15
ScaleHeight = 212
ScaleMode = 3 'Pixel
ScaleWidth = 22
TabIndex = 8
Top = 45
Width = 360
End
Begin VB.Frame fra
Caption = "Digite nomenclatura y clase de control"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3255
Index = 0
Left = 420
TabIndex = 0
Top = 15
Width = 4410
Begin VB.Frame fra
Caption = "Clase del Control"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1320
Index = 2
Left = 105
TabIndex = 5
Top = 1800
Width = 4185
Begin VB.TextBox txtClase
Height = 285
Left = 1365
TabIndex = 7
Top = 930
Width = 2715
End
Begin VB.Label lbl
Caption = $"frmAgregarCTL.frx":030A
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 3
Left = 120
TabIndex = 9
Top = 240
Width = 4005
WordWrap = -1 'True
End
Begin VB.Label lbl
AutoSize = -1 'True
Caption = "Clase del Control"
Height = 195
Index = 1
Left = 60
TabIndex = 6
Top = 975
Width = 1215
End
End
Begin VB.Frame fra
Caption = "Nomenclatura"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1470
Index = 1
Left = 105
TabIndex = 1
Top = 285
Width = 4185
Begin VB.TextBox txtNomen
Height = 285
Left = 1185
TabIndex = 3
Top = 1020
Width = 1230
End
Begin VB.Label lbl
AutoSize = -1 'True
Caption = "Nomenclatura"
Height = 195
Index = 2
Left = 135
TabIndex = 4
Top = 1065
Width = 990
End
Begin VB.Label lbl
Caption = "Digite la nomenclatura del control a analizar. Ejemplo nomenclatura de un Formulario frm , de un Combo cbo , de un ListBox lst."
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Index = 0
Left = 90
TabIndex = 2
Top = 285
Width = 4005
WordWrap = -1 'True
End
End
End
End
Attribute VB_Name = "frmAgregarCTL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mGradient As New clsGradient
Private Itmx As ListItem
Public Nomenclatura As String
Public Clase As String
Public ModoTrx As Integer
Public Indice As Integer
'agrega un nuevo control de usuario a lista de
'analisis de controles
Private Sub AgregarControl()
Dim total As Integer
total = UBound(glbAnaControles) + 1
ReDim Preserve glbAnaControles(total)
glbAnaControles(total).Nomenclatura = Nomenclatura
glbAnaControles(total).Clase = Clase
With frmNomenCtl
.lviewCtl.ListItems.Add , , CStr(.lviewCtl.ListItems.Count + 1)
Set Itmx = .lviewCtl.ListItems(.lviewCtl.ListItems.Count)
Itmx.SubItems(1) = Nomenclatura
Itmx.SubItems(2) = Clase
End With
MsgBox "Control agregado con éxito!", vbInformation
End Sub
'modifica datos del control a analizar
Private Sub ModificarControl()
With frmNomenCtl
.lviewCtl.ListItems(.lviewCtl.SelectedItem.Index).SubItems(1) = Nomenclatura
.lviewCtl.ListItems(.lviewCtl.SelectedItem.Index).SubItems(2) = Clase
End With
MsgBox "Control modificado con éxito!", vbInformation
End Sub
'valida que todos los datos esten okey
Private Function Valida() As Boolean
Dim ret As Boolean
Dim k As Integer
Dim Found As Boolean
ret = False
Nomenclatura = Trim$(txtNomen.Text)
Clase = Trim$(txtClase.Text)
Found = False
If Nomenclatura <> "" Then
If Clase <> "" Then
Found = False
If ModoTrx = 1 Then 'ingreso
For k = 1 To UBound(glbAnaControles)
If glbAnaControles(k).Nomenclatura = Nomenclatura Then
MsgBox "Nomenclatura ya existente.", vbCritical
txtNomen.SetFocus
Found = True
Exit For
ElseIf glbAnaControles(k).Clase = Clase Then
MsgBox "Clase de control ya existente.", vbCritical
txtClase.SetFocus
Found = True
Exit For
End If
Next k
Else
For k = 1 To UBound(glbAnaControles)
If glbAnaControles(k).Clase = Clase Then
MsgBox "Clase de control ya existente.", vbCritical
Found = True
Exit For
End If
Next k
End If
If Not Found Then
ret = True
Else
ret = False
End If
Else
MsgBox "Debe ingresar clase del control.", vbCritical
txtClase.SetFocus
End If
Else
MsgBox "Debe ingresar nomenclatura del control.", vbCritical
txtNomen.SetFocus
End If
Valida = ret
End Function
Private Sub cmd_Click(Index As Integer)
If Index = 0 Then
If Valida() Then
If ModoTrx = 1 Then 'nuevo
Call AgregarControl
Else 'modificar
Call ModificarControl
End If
Unload Me
End If
Else
Unload Me
End If
End Sub
Private Sub Form_Load()
Call Hourglass(hWnd, True)
CenterWindow hWnd
With mGradient
.Angle = 90
.Color1 = 16744448
.Color2 = 0
.Draw picDraw
End With
Call FontStuff(Me.Caption, picDraw)
picDraw.Refresh
If ModoTrx = 2 Then
txtNomen.Text = Nomenclatura
txtNomen.Locked = True
txtNomen.BackColor = vbButtonFace
txtClase.Text = Clase
End If
Call Hourglass(hWnd, False)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mGradient = Nothing
Set frmAgregarCTL = Nothing
End Sub