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 "../../Common/MyWindows.h"
      7 
      8 #include <commctrl.h>
      9 
     10 #include "../Window.h"
     11 
     12 namespace NWindows {
     13 namespace NControl {
     14 
     15 class CProgressBar: public CWindow
     16 {
     17 public:
     18   LRESULT SetPos(int pos) { return SendMsg(PBM_SETPOS, pos, 0); }
     19   LRESULT DeltaPos(int increment) { return SendMsg(PBM_DELTAPOS, increment, 0); }
     20   UINT GetPos() { return (UINT)SendMsg(PBM_GETPOS, 0, 0); }
     21   LRESULT SetRange(unsigned short minValue, unsigned short maxValue) { return SendMsg(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
     22   DWORD SetRange32(int minValue, int maxValue) { return (DWORD)SendMsg(PBM_SETRANGE32, minValue, maxValue); }
     23   int SetStep(int step) { return (int)SendMsg(PBM_SETSTEP, step, 0); }
     24   LRESULT StepIt() { return SendMsg(PBM_STEPIT, 0, 0); }
     25   INT GetRange(bool minValue, PPBRANGE range) { return (INT)SendMsg(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
     26 
     27   #ifndef UNDER_CE
     28   COLORREF SetBarColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBARCOLOR, 0, color); }
     29   COLORREF SetBackgroundColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBKCOLOR, 0, color); }
     30   #endif
     31 };
     32 
     33 }}
     34 
     35 #endif
     36