other-licenses/7zstub/src/Windows/Control/ProgressBar.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // Windows/Control/ProgressBar.h
     3 #ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
     4 #define __WINDOWS_CONTROL_PROGRESSBAR_H
     6 #include "Windows/Window.h"
     7 #include "Windows/Defs.h"
     9 namespace NWindows {
    10 namespace NControl {
    12 class CProgressBar: public CWindow
    13 {
    14 public:
    15   LRESULT SetPos(int pos)
    16     { return SendMessage(PBM_SETPOS, pos, 0); }
    17   LRESULT DeltaPos(int increment)
    18     { return SendMessage(PBM_DELTAPOS, increment, 0); }
    19   UINT GetPos()
    20     { return SendMessage(PBM_GETPOS, 0, 0); }
    21   LRESULT SetRange(unsigned short minValue, unsigned short maxValue)
    22     { return SendMessage(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
    23   DWORD SetRange32(int minValue, int maxValue)
    24     { return SendMessage(PBM_SETRANGE32, minValue, maxValue); }
    25   int SetStep(int aStep)
    26     { return SendMessage(PBM_SETSTEP, aStep, 0); }
    27   int StepIt()
    28     { return SendMessage(PBM_STEPIT, 0, 0); }
    30   int GetRange(bool minValue, PPBRANGE range)
    31     { return SendMessage(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
    33   COLORREF SetBarColor(COLORREF color)
    34     { return SendMessage(PBM_SETBARCOLOR, 0, color); }
    35   COLORREF SetBackgroundColor(COLORREF color)
    36     { return SendMessage(PBM_SETBKCOLOR, 0, color); }
    37 };
    39 }}
    41 #endif

mercurial