forked from renehamburger/blinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBX_ProcessInputForm.frm
More file actions
111 lines (97 loc) · 2.92 KB
/
Copy pathBX_ProcessInputForm.frm
File metadata and controls
111 lines (97 loc) · 2.92 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
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} BX_ProcessInputForm
OleObjectBlob = "BX_ProcessInputForm.frx":0000
Caption = "Blinx"
ClientHeight = 990
ClientLeft = 45
ClientTop = 375
ClientWidth = 4935
TypeInfoVer = 13
End
Attribute VB_Name = "BX_ProcessInputForm"
Attribute VB_Base = "0{BB3D309B-F401-4B19-BDFB-4CB25D430640}{650EDC6F-E4DF-4D30-9592-17667614B57B}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = False
Option Explicit
Option Base 1
'==============================================================================
' See https://github.com/renehamburger/blinx for source code, manual & license
'==============================================================================
Public sRef As String
Public bProcess As Boolean
Public bAcceptAll As Boolean
Public bAbort As Boolean
Private bFirstRun As Boolean
Public oWindow As Window
'==============================================================================
' Public Functions
'==============================================================================
Public Function SetWindow(ByVal oWindowIn As Window)
Set oWindow = oWindowIn
oWindow.Activate
End Function
'==============================================================================
' Private Functions
'==============================================================================
Private Sub UserForm_Initialize()
sRef = ""
bFirstRun = True
End Sub
Private Sub UserForm_Activate()
If (bFirstRun) Then
bFirstRun = False
Top = 4
Left = ActiveWindow.Left + (ActiveWindow.Width / 2) - Width / 2
If (Left < 0) Then Left = 10
End If
tbx_Input.Text = sRef
tbx_Input.SelStart = 0
tbx_Input.SelLength = tbx_Input.TextLength
tbx_Input.SetFocus
bAcceptAll = False
bAbort = False
If (bProcess) Then
btn_AcceptAll.Enabled = True
btn_Abort.Enabled = True
Else
btn_AcceptAll.Enabled = False
btn_Abort.Enabled = False
End If
End Sub
Private Sub btn_Accept_Click()
sRef = tbx_Input.Text
UserInput
End Sub
Private Sub btn_AcceptAll_Click()
sRef = tbx_Input.Text
bAcceptAll = True
UserInput
End Sub
Private Sub btn_Skip_Click()
sRef = ""
UserInput
End Sub
Private Sub btn_Abort_Click()
bAbort = True
UserInput
End Sub
Private Sub UserInput()
Me.hide
If (Not oWindow Is Nothing And IsObject(oWindow)) Then oWindow.Activate
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If (CloseMode = vbFormControlMenu) Then
Cancel = 1
If (bProcess) Then
btn_Abort_Click
Else
btn_Skip_Click
End If
End If
On Error Resume Next 'Next line often causes an "object has been deleted error", but can't see how to avoid that
If (Not oWindow Is Nothing And IsObject(oWindow)) Then oWindow.Activate
End Sub