StatusDlg.Show

StatusDlg.Show ( 

number  Icon = 0,

boolean Cancelled = false )

Example 1

StatusDlg.Show(MB_ICONINFORMATION, false);

Displays the built-in status dialog with the information icon. The "false" parameter indicates that the cancel button hasn't been pressed.

Example 2

StatusDlg.Show(MB_ICONNONE, true);

Displays the built-in status dialog with no icon. The "true" parameter indicates that the cancel button has been pressed.

Example 3

-- 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