Skip to content

Commit

Permalink
* Add animations based on Windows XP for downloading and uploading.
Browse files Browse the repository at this point in the history
In the event that this causes a copyright violation these will be changed. But I believe it is fair use.
  • Loading branch information
iProgramMC committed Jun 1, 2024
1 parent 9509a09 commit d0b53c4
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 13 deletions.
Binary file added res/animations/download_hc.avi
Binary file not shown.
Binary file added res/animations/download_lc.avi
Binary file not shown.
Binary file added res/animations/upload_hc.avi
Binary file not shown.
Binary file added res/animations/upload_lc.avi
Binary file not shown.
10 changes: 8 additions & 2 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
37 changes: 26 additions & 11 deletions src/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/windows/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 16 additions & 0 deletions src/windows/ProgressDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions vs/DiscordMessenger.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@
<Image Include="..\res\bitmaps\target.bmp" />
</ItemGroup>
<ItemGroup>
<None Include="..\res\animations\download_hc.avi" />
<None Include="..\res\animations\download_lc.avi" />
<None Include="..\res\animations\upload_hc.avi" />
<None Include="..\res\animations\upload_lc.avi" />
<None Include="..\res\cursors\cur_zoomin.cur" />
<None Include="..\res\cursors\cur_zoomout.cur" />
</ItemGroup>
Expand Down
15 changes: 15 additions & 0 deletions vs/DiscordMessenger.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<Filter Include="Resource Files\Resources\Cursors">
<UniqueIdentifier>{64b163e1-8714-4745-acb7-a73a12b8a7f3}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files\Resources\Animations">
<UniqueIdentifier>{54d34c5a-4006-4852-a568-70c3248b47d3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Image Include="..\res\bitmaps\bmp_voice.bmp">
Expand Down Expand Up @@ -374,6 +377,18 @@
<None Include="..\res\cursors\cur_zoomin.cur">
<Filter>Resource Files\Resources\Cursors</Filter>
</None>
<None Include="..\res\animations\upload_lc.avi">
<Filter>Resource Files\Resources\Animations</Filter>
</None>
<None Include="..\res\animations\download_hc.avi">
<Filter>Resource Files\Resources\Animations</Filter>
</None>
<None Include="..\res\animations\download_lc.avi">
<Filter>Resource Files\Resources\Animations</Filter>
</None>
<None Include="..\res\animations\upload_hc.avi">
<Filter>Resource Files\Resources\Animations</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Manifest Include="..\res\app.manifest">
Expand Down

0 comments on commit d0b53c4

Please sign in to comment.