ScrollView.pkg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $#include "ScrollView.h"
  2. /// Scrollable %UI element for showing a (possibly large) child element.
  3. class ScrollView : public UIElement
  4. {
  5. public:
  6. /// Construct.
  7. ScrollView(Context* context);
  8. /// Destruct.
  9. virtual ~ScrollView();
  10. /// Set content element.
  11. void SetContentElement(UIElement* element);
  12. /// Set view offset from the top-left corner.
  13. void SetViewPosition(const IntVector2& position);
  14. /// Set view offset from the top-left corner.
  15. void SetViewPosition(int x, int y);
  16. /// Set scrollbars' visibility manually. Disables scrollbar autoshow/hide.
  17. void SetScrollBarsVisible(bool horizontal, bool vertical);
  18. /// Set whether to automatically show/hide scrollbars. Default true.
  19. void SetScrollBarsAutoVisible(bool enable);
  20. /// Set arrow key scroll step. Also sets it on the scrollbars.
  21. void SetScrollStep(float step);
  22. /// Set arrow key page step.
  23. void SetPageStep(float step);
  24. /// Return view offset from the top-left corner.
  25. const IntVector2& GetViewPosition() const { return viewPosition_; }
  26. /// Return content element.
  27. UIElement* GetContentElement() const { return contentElement_; }
  28. /// Return horizontal scroll bar.
  29. ScrollBar* GetHorizontalScrollBar() const { return horizontalScrollBar_; }
  30. /// Return vertical scroll bar.
  31. ScrollBar* GetVerticalScrollBar() const { return verticalScrollBar_; }
  32. /// Return scroll panel.
  33. BorderImage* GetScrollPanel() const { return scrollPanel_; }
  34. /// Return whether scrollbars are automatically shown/hidden.
  35. bool GetScrollBarsAutoVisible() const { return scrollBarsAutoVisible_; }
  36. /// Return arrow key scroll step.
  37. float GetScrollStep() const;
  38. /// Return arrow key page step.
  39. float GetPageStep() const { return pageStep_; }
  40. /// Set view position attribute.
  41. void SetViewPositionAttr(const IntVector2& value);
  42. };