PolyUIHScrollBar.h 695 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * PolyUIHScrollBar.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 3/26/10.
  6. * Copyright 2010 Ivan Safrin. All rights reserved.
  7. *
  8. */
  9. #pragma once
  10. #include "PolyGlobals.h"
  11. #include "PolyUIBox.h"
  12. namespace Polycode {
  13. class _PolyExport UIHScrollBar : public ScreenEntity {
  14. public:
  15. UIHScrollBar(float width, float height, float initialRatio);
  16. ~UIHScrollBar();
  17. void Update();
  18. float getScrollValue();
  19. void handleEvent(Event *event);
  20. float minHandleSize;
  21. void setHandleRatio(float newRatio);
  22. private:
  23. float padding;
  24. float scrollValue;
  25. float lastPositionX;
  26. float scrollHandleWidth;
  27. float dragRectWidth;
  28. UIBox *bgBox;
  29. UIBox *handleBox;
  30. };
  31. }