ScrollView.pkg 1.8 KB

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