tonegodgui_scrollarea.adoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. = tonegodgui_scrollarea
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../
  6. :imagesdir: ../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == ScrollArea class
  9. Utilizes the standard 3 constructors as shown in the with the addition of a single boolean:
  10. * isTextOnly – appended to the end of the param list for each constructor
  11. *NOTE:*+
  12. The scrollArea implement Vertical Scrolling only. Why? Because I was lazy. Eventually I will add Horizontal scrolling as well.+
  13. +
  14. ScrollArea s can be implemented in two ways: Text Only, or an inner element that can contain nested Elements.
  15. . The text only version uses the Element setText() method for adding to the scrollable content.
  16. . The inner Element method uses addScrollableChild() as well as setText() to add scrollable content
  17. When using a scroll area for building Custom Controls, consider the potential uses of the ScrollArea to alleviate unnecessary overhead. If the text only version will suffice… USE IT! No reason to create the extra Element if it will not be used.+
  18. === Methods specific to the ScrollArea class:
  19. [source,java]
  20. ----
  21. // Config methods
  22. getIsTextOnly();
  23. setPadding(float padding);
  24. getPadding();
  25. getScrollableHeight();
  26. // Pointer to VScrollBar
  27. getVScrollBar();
  28. //Scrolling methods
  29. scrollYTo(float y);
  30. scrollYBy(float yInc);
  31. scrollToTop();
  32. scrollToBottom();
  33. ----