window.adoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. = window
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == Window Class
  5. The window class provides a movable, resizable window with a Drag Bar.
  6. It provides the 3 standard constructors as shown in the xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide].
  7. *Constructor 1:*
  8. [source,java]
  9. ----
  10. /** Parameters:
  11. * Screen screen,
  12. * String UID,
  13. * Vector2f position
  14. */
  15. Window win = new Window(screen, xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide]win”, new Vector2f(15, 15));
  16. ----
  17. *Constructor 2:*
  18. [source,java]
  19. ----
  20. /** Additional Parameter:
  21. * Vector2f dimensions */
  22. Window win = new Window(screen, "win", new Vector2f(15, 15),
  23. new Vector2f(400, 300)
  24. );
  25. ----
  26. *Constructor 3:*
  27. [source,java]
  28. ----
  29. /** Additional Parameters:
  30. * Vector4f resizeBorders,
  31. * String defaultImg
  32. */
  33. Window win = new Window(screen, "win", new Vector2f(15, 15), new Vector2f(400, 300),
  34. new Vector4f(14,14,14,14),
  35. "tonegod/gui/style/def/Window/panel_x.png"
  36. );
  37. ----
  38. [NOTE]
  39. ====
  40. Once again, default behaviors, such as moving, and resizing can be disabled calling the appropriate setters from the xref:gui/tonegodgui/element.adoc[Element] class.
  41. ====
  42. === Methods specific to the Window Class:
  43. [source,java]
  44. ----
  45. win.getDragBar(); // returns a pointer to the dragbar Element
  46. win.getDragBarHeight(); // returns the height of the dragbar
  47. win.setWindowTitle(String title); // Sets the title displayed in the dragbar
  48. ----