reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 7f0cb29f6cbc29061f94db03044632cb940faced
parent dda11fe4883b89922fbf96109f593061dd98a3f7
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Sat,  5 Dec 2015 20:12:43 -0800

show the download progress in the dialog title bar

Diffstat:
Msrc/progress.cpp | 8+++++++-
Msrc/resource.rc | 1-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/progress.cpp b/src/progress.cpp @@ -4,6 +4,8 @@ #include "resource.hpp" #include "transaction.hpp" +static const char *TITLE = "ReaPack: Download in progress"; + using namespace std; Progress::Progress() @@ -64,5 +66,9 @@ void Progress::addDownload(Download *dl) void Progress::updateProgress() { const double pos = m_done / m_total; - SendMessage(m_progress, PBM_SETPOS, (int)(pos * 100), 0); + const int percent = (int)(pos * 100); + const string title = string(TITLE) + " (" + to_string(percent) + "%)"; + + SendMessage(m_progress, PBM_SETPOS, percent, 0); + SetWindowText(handle(), title.c_str()); } diff --git a/src/resource.rc b/src/resource.rc @@ -6,7 +6,6 @@ IDD_PROGRESS_DIALOG DIALOGEX 0, 0, 260, 85 STYLE DS_MODALFRAME | DS_SHELLFONT | WS_POPUP | WS_SYSMENU | WS_CAPTION -CAPTION "ReaPack: Download in progress" FONT 8, "MS Shell Dlg" BEGIN LTEXT "File Name", IDC_LABEL, 5, 5, 250, 30