bool Download_Manager_Window::progress_indecator ( int x, int all ) { static int timer = 0; static int data = 0; progress_bar.Set ( x, all ); timer = clock() - timer; data = x - data; label_DownloadSpeed.SetText ( DblStr ( ( data / timer ) * 1.0 ) + " KB/S" ); timer = clock(); data = x; if (x == all) return true; else return false; } void Download_Manager_Window::Download_File ( String link ) { client.URL ( link ); String file = client.ExecuteRedirect ( HttpClient::DEFAULT_MAX_REDIRECT, HttpClient::DEFAULT_RETRIES, THISBACK ( progress_indecator ) ); }
(new Thread)->Run ( THISBACK1 ( Download_File, "http://cisclub.com/tecno/bta3/vector.rar" ) );
Download_Manager_Window::Download_Manager_Window() { CtrlLayout ( *this, "Download" ); label_DownloadDirectory.SetReadOnly(); (new Thread)->Run ( THISBACK1 ( Download_File, "http://cisclub.com/tecno/bta3/vector.rar" ) ); }
Report message to a moderator