1
0

xuiprogressgrid.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __PROGRESSGRID_H
  2. #define __PROGRESSGRID_H
  3. #include <api/wnd/wndclass/guiobjwnd.h>
  4. #include "xuigrid.h"
  5. #include <api/syscb/callbacks/corecbi.h>
  6. #define PROGRESSGRID_PARENT Grid
  7. enum {
  8. PROGRESSGRID_TOP = 0,
  9. PROGRESSGRID_LEFT = 1,
  10. PROGRESSGRID_RIGHT = 2,
  11. PROGRESSGRID_BOTTOM = 3,
  12. };
  13. // -----------------------------------------------------------------------
  14. class ProgressGrid : public PROGRESSGRID_PARENT, public CoreCallbackI {
  15. public:
  16. ProgressGrid();
  17. virtual ~ProgressGrid();
  18. virtual int setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);
  19. virtual void setOrientation(const wchar_t *or);
  20. virtual void getGridRect(RECT *r);
  21. virtual void setProgress(float p); // 0..1
  22. virtual int onInit();
  23. virtual int corecb_onSeeked(int newpos);
  24. virtual int corecb_onStarted();
  25. virtual int corecb_onStopped();
  26. virtual void timerCallback(int id);
  27. protected:
  28. /*static */void CreateXMLParameters(int master_handle);
  29. private:
  30. enum {
  31. PROGRESSGRID_SETORIENTATION = 0,
  32. PROGRESSGRID_SETINTERVAL = 1,
  33. };
  34. static XMLParamPair params[];
  35. int orientation;
  36. int myxuihandle;
  37. float progress;
  38. int started;
  39. int update_interval;
  40. };
  41. // -----------------------------------------------------------------------
  42. extern const wchar_t ProgressGridXuiObjectStr[];
  43. extern char ProgressGridXuiSvcName[];
  44. class ProgressGridXuiSvc : public XuiObjectSvc<ProgressGrid, ProgressGridXuiObjectStr, ProgressGridXuiSvcName> {};
  45. #endif