OverviewExamples
StatusDlg.Hide ( |
) |
StatusDlg.Hide();
Hides the built-in status dialog that is currently displayed.
-- Callback function for HTTP.Download
function DownloadCallback (nDownloaded, nTotal, TransferRate, SecondLeft, SecondsLeftFormat, Message)
-- Convert total and downloaded bytes into formatted strings
sDownloaded = String.GetFormattedSize(nDownloaded, FMTSIZE_AUTOMATIC, true);
sTotal = String.GetFormattedSize(nTotal, FMTSIZE_AUTOMATIC, true);
-- Set statusdlg title and message
StatusDlg.SetTitle("Downloading . . . ");
-- Output time left, formatted.
StatusDlg.SetMessage("Currently downloading file . . . Time Left: " .. SecondsLeftFormat);
-- Output formatted sizes to user through statusdlg status text
StatusDlg.SetStatusText("Downloaded: " .. sDownloaded .. " / " .. sTotal);
-- Set meter range (max range = 65534)
StatusDlg.SetMeterRange(0, 65534);
-- Set meter position (fraction downloaded * max meter range)
StatusDlg.SetMeterPos((nDownloaded / nTotal) * 65534);
end
-- Show the StatusDlg
StatusDlg.Show(0, false);
-- Download a file from the internet to the user's computer
-- Uses DownloadCallback() as the callback function
HTTP.Download("http://www.yourdomain.com/downloads/update.exe", _TempFolder .. "\\update.exe", MODE_BINARY, 20, 80, nil, nil, DownloadCallback);
-- Hide the StatusDlg
StatusDlg.Hide();
Downloads a file from the internet onto the user's computer. The callback function "DownloadCallback" controls the Status Dialog.
See also: Related Actions