diff --git a/res/animations/download_hc.avi b/res/animations/download_hc.avi new file mode 100644 index 0000000..b36639e Binary files /dev/null and b/res/animations/download_hc.avi differ diff --git a/res/animations/download_lc.avi b/res/animations/download_lc.avi new file mode 100644 index 0000000..187cf35 Binary files /dev/null and b/res/animations/download_lc.avi differ diff --git a/res/animations/upload_hc.avi b/res/animations/upload_hc.avi new file mode 100644 index 0000000..b0bf339 Binary files /dev/null and b/res/animations/upload_hc.avi differ diff --git a/res/animations/upload_lc.avi b/res/animations/upload_lc.avi new file mode 100644 index 0000000..26d07ce Binary files /dev/null and b/res/animations/upload_lc.avi differ diff --git a/src/resource.h b/src/resource.h index adfdd0f..7ebe8cb 100644 --- a/src/resource.h +++ b/src/resource.h @@ -88,6 +88,10 @@ #define IDI_HEADER_3 86 #define IDI_HEADER_4 87 #define IDI_HEADER_5 88 +#define IDR_AVI_DOWNLOAD_HC 91 +#define IDR_AVI_DOWNLOAD_LC 92 +#define IDR_AVI_UPLOAD_HC 93 +#define IDR_AVI_UPLOAD_LC 94 #define IDB_TARGET 200 #define IDB_CHANNEL 201 #define IDB_CATEGORY 202 @@ -304,6 +308,8 @@ #define IDC_UPLOADING_ETA 878 #define IDC_UPLOADING_XFERRATE 879 #define IDC_UPLOADING_ACTION 880 +#define IDC_ANIMATE1 881 +#define IDC_PROGRESS_ANIMATE 881 #define ID_FILE_PREFERENCES 1001 #define ID_FILE_STOPALLSPEECH 1002 #define ID_FILE_EXIT 1003 @@ -380,9 +386,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 91 +#define _APS_NEXT_RESOURCE_VALUE 95 #define _APS_NEXT_COMMAND_VALUE 1069 -#define _APS_NEXT_CONTROL_VALUE 881 +#define _APS_NEXT_CONTROL_VALUE 882 #define _APS_NEXT_SYMED_VALUE 40000 #endif #endif diff --git a/src/resource.rc b/src/resource.rc index 5d891d2..e0c7c67 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -590,19 +590,20 @@ BEGIN LTEXT "iProgramInCpp cannot see your IP address via the update service.",IDC_STATIC,12,219,231,10 END -IDD_DIALOG_UPLOADING DIALOGEX 0, 0, 309, 92 +IDD_DIALOG_UPLOADING DIALOGEX 0, 0, 275, 135 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "File Upload" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - PUSHBUTTON "Cancel",IDCANCEL,252,71,50,14 - LTEXT "Uploading:",IDC_UPLOADING_ACTION,7,7,295,8 - LTEXT "File Name Here",IDC_UPLOADING_FILENAME,7,17,295,8 - CONTROL "",IDC_UPLOADING_PROGRESS,"msctls_progress32",WS_BORDER,7,27,295,14 - LTEXT "Estimated time left:",IDC_STATIC,7,45,80,8 - LTEXT "Calculating...",IDC_UPLOADING_ETA,92,45,210,8 - LTEXT "Transfer rate",IDC_STATIC,7,56,80,8 - LTEXT "Calculating...",IDC_UPLOADING_XFERRATE,92,56,210,8 + PUSHBUTTON "Cancel",IDCANCEL,218,114,50,14 + LTEXT "Uploading:",IDC_UPLOADING_ACTION,6,46,261,12 + LTEXT "File Name Here",IDC_UPLOADING_FILENAME,6,58,261,12 + CONTROL "",IDC_UPLOADING_PROGRESS,"msctls_progress32",WS_BORDER,6,70,261,12 + LTEXT "Estimated time left:",IDC_STATIC,6,88,72,12 + LTEXT "Calculating...",IDC_UPLOADING_ETA,78,88,190,12 + LTEXT "Transfer rate",IDC_STATIC,6,100,72,12 + LTEXT "Calculating...",IDC_UPLOADING_XFERRATE,78,100,190,12 + CONTROL "",IDC_PROGRESS_ANIMATE,"SysAnimate32",ACS_CENTER | ACS_TRANSPARENT | ACS_AUTOPLAY | WS_TABSTOP,6,6,264,36 END @@ -710,9 +711,9 @@ BEGIN IDD_DIALOG_UPLOADING, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 302 + RIGHTMARGIN, 268 TOPMARGIN, 7 - BOTTOMMARGIN, 85 + BOTTOMMARGIN, 128 END END #endif // APSTUDIO_INVOKED @@ -911,6 +912,20 @@ BEGIN END +///////////////////////////////////////////////////////////////////////////// +// +// AVI +// + +IDR_AVI_DOWNLOAD_HC AVI "../res/animations\\download_hc.avi" + +IDR_AVI_DOWNLOAD_LC AVI "../res/animations\\download_lc.avi" + +IDR_AVI_UPLOAD_HC AVI "../res/animations\\upload_hc.avi" + +IDR_AVI_UPLOAD_LC AVI "../res/animations\\upload_lc.avi" + + ///////////////////////////////////////////////////////////////////////////// // // String Table diff --git a/src/windows/Main.cpp b/src/windows/Main.cpp index 1d33adf..237b80d 100644 --- a/src/windows/Main.cpp +++ b/src/windows/Main.cpp @@ -22,6 +22,7 @@ #include "StatusBar.hpp" #include "QuickSwitcher.hpp" #include "Frontend_Win32.hpp" +#include "ProgressDialog.hpp" #include "../discord/LocalSettings.hpp" #include "../discord/WebsocketClient.hpp" #include "../discord/UpdateChecker.hpp" @@ -1321,6 +1322,12 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam == VK_F8) { GetQRCodeDialog()->Show(); } + if (wParam == VK_F9) { + ProgressDialog::Show("Test!", 1234, true, g_Hwnd); + } + if (wParam == VK_F10) { + ProgressDialog::Show("Test!", 1234, false, g_Hwnd); + } #endif break; diff --git a/src/windows/ProgressDialog.cpp b/src/windows/ProgressDialog.cpp index 2e235ec..29fbbc7 100644 --- a/src/windows/ProgressDialog.cpp +++ b/src/windows/ProgressDialog.cpp @@ -112,6 +112,22 @@ BOOL ProgressDialog::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendMessage(GetDlgItem(hWnd, IDC_UPLOADING_PROGRESS), PBM_SETRANGE, 0, MAKELPARAM(0, 1000)); SendMessage(GetDlgItem(hWnd, IDC_UPLOADING_PROGRESS), PBM_SETPOS, 0, 0); + HDC hdc = GetDC(hWnd); + int bpp = GetDeviceCaps(hdc, BITSPIXEL); + ReleaseDC(hWnd, hdc); + + int res; + bool isHighColor = bpp > 8; + + if (m_bDirection) { + res = isHighColor ? IDR_AVI_UPLOAD_HC : IDR_AVI_UPLOAD_LC; + } + else { + res = isHighColor ? IDR_AVI_DOWNLOAD_HC : IDR_AVI_DOWNLOAD_LC; + } + + Animate_Open(GetDlgItem(hWnd, IDC_PROGRESS_ANIMATE), MAKEINTRESOURCE(res)); + CenterWindow(hWnd, g_Hwnd); break; } diff --git a/vs/DiscordMessenger.vcxproj b/vs/DiscordMessenger.vcxproj index b018cec..01c7cdf 100644 --- a/vs/DiscordMessenger.vcxproj +++ b/vs/DiscordMessenger.vcxproj @@ -313,6 +313,10 @@ + + + + diff --git a/vs/DiscordMessenger.vcxproj.filters b/vs/DiscordMessenger.vcxproj.filters index 36f9d66..048fcb8 100644 --- a/vs/DiscordMessenger.vcxproj.filters +++ b/vs/DiscordMessenger.vcxproj.filters @@ -52,6 +52,9 @@ {64b163e1-8714-4745-acb7-a73a12b8a7f3} + + {54d34c5a-4006-4852-a568-70c3248b47d3} + @@ -374,6 +377,18 @@ Resource Files\Resources\Cursors + + Resource Files\Resources\Animations + + + Resource Files\Resources\Animations + + + Resource Files\Resources\Animations + + + Resource Files\Resources\Animations +