diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h')
-rw-r--r-- | Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h b/Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h new file mode 100644 index 00000000..a476f788 --- /dev/null +++ b/Src/external_dependencies/openmpt-trunk/mptrack/ProgressDialog.h @@ -0,0 +1,55 @@ +/* + * ProgressDialog.h + * ---------------- + * Purpose: An abortable, progress-indicating dialog, e.g. for showing conversion progress. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#include "openmpt/all/BuildSettings.hpp" + +OPENMPT_NAMESPACE_BEGIN + +class CProgressDialog : public CDialog +{ +private: + ITaskbarList3 *m_taskBarList = nullptr; + uint64 m_min = 0, m_max = 0, m_shift = 0; + const bool m_customDialog; + +public: + bool m_abort = false; + + CProgressDialog(CWnd *parent = nullptr, UINT resourceID = 0); + ~CProgressDialog(); + + // Set the window title + void SetTitle(const TCHAR *title); + // Set the text on abort button + void SetAbortText(const TCHAR *abort); + // Set the text to be displayed along the progress bar. + void SetText(const TCHAR *text); + // Set the minimum and maximum value of the progress bar. + void SetRange(uint64 min, uint64 max); + // Set the current progress. + void SetProgress(uint64 progress); + // Show the progress in the task bar as well + void EnableTaskbarProgress(); + // Process all queued Windows messages + void ProcessMessages(); + // Run method for this dialog that must implement the action to be carried out - unless a custom resourceID was provided, + // in which case the user is responsible for running the dialog and the implementation of this function may be a no-op. + virtual void Run() = 0; + +protected: + BOOL OnInitDialog() override; + void OnCancel() override { m_abort = true; } + + DECLARE_MESSAGE_MAP() +}; + +OPENMPT_NAMESPACE_END |