alertbox.adoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. = alertbox
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == AlertBox Class
  5. The AlertBox class extends Window, adding a scroll area for displaying messages, as well as a configurable button for closing the AlertBox.
  6. It utilizes 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. AlertBox alert = new AlertBox(screen, "alert", new Vector2f(15, 15));
  16. ----
  17. *Constructor 2:*
  18. [source,java]
  19. ----
  20. /** Additional Parameter:
  21. * Vector2f dimensions */
  22. AlertBox alert = new AlertBox(screen, "alert", 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. AlertBox alert = new AlertBox(screen, "alert", 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. === Abstract Event Methods:
  39. [source,java]
  40. ----
  41. public void onButtonOkPressed(MouseButtonEvent evt, boolean toggled);
  42. ----
  43. === AlertBox specific methods:
  44. [source,java]
  45. ----
  46. alert.setMsg(String text); // Set the alert message
  47. alert.setButtonOkText(String text); // Sets the text for the ok button of the AlertBox
  48. ----