diff options
author | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 08:09:54 +0000 |
---|---|---|
committer | Dennis Syrovatsky <dennis@tightvnc.com> | 2005-11-07 08:09:54 +0000 |
commit | 9319604701009c9b7044e5dd0373c6817211aa9a (patch) | |
tree | 2c5488eb83f4dd113c3f358ecde52882f3f6818e /rfb_win32 | |
parent | ea9f91bab0cce9924955ccc7530b522cdc3cf5d4 (diff) | |
download | tigervnc-9319604701009c9b7044e5dd0373c6817211aa9a.tar.gz tigervnc-9319604701009c9b7044e5dd0373c6817211aa9a.zip |
Added methods to FTProgress class for creating, destroying
and intialization the progress bar controls.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@379 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'rfb_win32')
-rw-r--r-- | rfb_win32/ProgressControl.cxx | 13 | ||||
-rw-r--r-- | rfb_win32/ProgressControl.h | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/rfb_win32/ProgressControl.cxx b/rfb_win32/ProgressControl.cxx index dd6a79f9..1beced0d 100644 --- a/rfb_win32/ProgressControl.cxx +++ b/rfb_win32/ProgressControl.cxx @@ -45,7 +45,8 @@ ProgressControl::init(DWORD64 maxValue, DWORD64 position) m_dw64CurrentValue = position; m_dw64MaxValue = maxValue; - SendMessage(m_hwndProgress, PBM_SETRANGE, (WPARAM) 0, MAKELPARAM(0, MAX_RANGE)); + if (!SendMessage(m_hwndProgress, PBM_SETRANGE, (WPARAM) 0, MAKELPARAM(0, MAX_RANGE))) + return false; return true; } @@ -72,7 +73,15 @@ bool ProgressControl::show() { DWORD curPos = (DWORD) ((m_dw64CurrentValue * MAX_RANGE) / m_dw64MaxValue); - SendMessage(m_hwndProgress, PBM_SETPOS, (WPARAM) curPos, (LPARAM) 0); + + if (!SendMessage(m_hwndProgress, PBM_SETPOS, (WPARAM) curPos, (LPARAM) 0)) + return false; return true; } + +int +ProgressControl::getCurrentPercent() +{ + return ((int) ((m_dw64CurrentValue * 100) / m_dw64MaxValue)); +}
\ No newline at end of file diff --git a/rfb_win32/ProgressControl.h b/rfb_win32/ProgressControl.h index 480c4c89..ceeb153f 100644 --- a/rfb_win32/ProgressControl.h +++ b/rfb_win32/ProgressControl.h @@ -39,18 +39,16 @@ namespace rfb { bool increase(DWORD64 value); bool clear(); + + int getCurrentPercent(); private: HWND m_hwndProgress; - DWORD m_dwBarValue; - DWORD m_dwBarValueMax; - DWORD64 m_dw64MaxValue; DWORD64 m_dw64CurrentValue; bool show(); - }; } } |