gambas-source-code/app/examples/Networking/WebBrowser/.src/FDownload.class
Benoît Minisini c6a9cd69c2 [EXAMPLES]
* NEW: Add examples again. I hope correctly this time.


git-svn-id: svn://localhost/gambas/trunk@6726 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-12 19:58:52 +00:00

50 lines
823 B
Text

' Gambas class file
Private $hDownload As WebDownload
Public Sub Init(hDownload As WebDownload)
$hDownload = hDownload
Redraw
End
Public Sub Redraw()
Dim sTitle As String
Dim sStatus As String
If Not $hDownload Then Return
With $hDownload
sTitle = .Url
If .Status = .Cancelled Then
sStatus = "Cancelled"
Else If .Status = .Finished Then
sStatus = "Finished"
Else If .Status = .Error Then
sStatus = "Error: " & .ErrorText
Else
sStatus = "Downloading..."
Endif
lblTitle.Text = sTitle
lblStatus.Text = sStatus
pgbDownload.Value = .Progress
End With
End
Public Sub btnAbort_Click()
If $hDownload.Status = WebDownload.Downloading Then
$hDownload.Cancel
Else
$hDownload.Delete
Me.Delete
Endif
End