-
Notifications
You must be signed in to change notification settings - Fork 0
/
progressDialog.bas
59 lines (51 loc) · 1.22 KB
/
progressDialog.bas
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
B4J=true
Group=Default Group
ModulesStructureVersion=1
Type=StaticCode
Version=6.51
@EndOfDesignText@
'Static code module
Sub Process_Globals
Private fx As JFX
Private frm As Form
Private Label1 As Label
Private ProgressBar1 As ProgressBar
Private progressTypeValue As String
End Sub
'input a random type name
Sub Show(title As String,progressType As String)
frm.Initialize("frm",600,200)
frm.RootPane.LoadLayout("progress")
frm.Title=title
progressTypeValue=progressType
frm.Show
End Sub
Sub ShowWithoutProgressBar(title As String,progressType As String)
frm.Initialize("frm",400,120)
frm.RootPane.LoadLayout("progress")
frm.Title=title
Label1.Top=60-Label1.Height/2
ProgressBar1.Visible=False
progressTypeValue=progressType
frm.Show
End Sub
Sub update(completed As Int,segmentSize As Int)
ProgressBar1.Visible=True
Label1.Text=completed&"/"&segmentSize
ProgressBar1.Progress=completed/segmentSize
End Sub
Sub update2(info As String)
Label1.Text=info
End Sub
Sub delayedInfo(info As String)
Label1.Text=info
Sleep(2000)
close
End Sub
Sub close
If frm.IsInitialized Then
frm.Close
End If
End Sub
Sub frm_CloseRequest (EventData As Event)
End Sub