Home | History | Annotate | Download | only in Control
      1 // Windows/Control/ProgressBar.h
      2 
      3 #ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
      4 #define __WINDOWS_CONTROL_PROGRESSBAR_H
      5 
      6 #include "../Window.h"
      7 
      8 namespace NWindows {
      9 namespace NControl {
     10 
     11 class CProgressBar: public CWindow
     12 {
     13 public:
     14   LRESULT SetPos(int pos) { return SendMessage(PBM_SETPOS, pos, 0); }
     15   LRESULT DeltaPos(int increment) { return SendMessage(PBM_DELTAPOS, increment, 0); }
     16   UINT GetPos() { return (UINT)SendMessage(PBM_GETPOS, 0, 0); }
     17   LRESULT SetRange(unsigned short minValue, unsigned short maxValue) { return SendMessage(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
     18   DWORD SetRange32(int minValue, int maxValue) { return (DWORD)SendMessage(PBM_SETRANGE32, minValue, maxValue); }
     19   int SetStep(int step) { return (int)SendMessage(PBM_SETSTEP, step, 0); }
     20   LRESULT StepIt() { return SendMessage(PBM_STEPIT, 0, 0); }
     21   INT GetRange(bool minValue, PPBRANGE range) { return (INT)SendMessage(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
     22 
     23   #ifndef UNDER_CE
     24   COLORREF SetBarColor(COLORREF color) { return (COLORREF)SendMessage(PBM_SETBARCOLOR, 0, color); }
     25   COLORREF SetBackgroundColor(COLORREF color) { return (COLORREF)SendMessage(PBM_SETBKCOLOR, 0, color); }
     26   #endif
     27 };
     28 
     29 }}
     30 
     31 #endif
     32