alertbox.adoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. = alertbox
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == AlertBox Class
  9. The AlertBox class extends Window, adding a scroll area for displaying messages, as well as a configurable button for closing the AlertBox.
  10. It utilizes the 3 standard constructors as shown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.
  11. *Constructor 1:*
  12. [source,java]
  13. ----
  14. /** Parameters:
  15. * Screen screen,
  16. * String UID,
  17. * Vector2f position
  18. */
  19. AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15));
  20. ----
  21. *Constructor 2:*
  22. [source,java]
  23. ----
  24. /** Additional Parameter:
  25. * Vector2f dimensions */
  26. AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15),
  27. new Vector2f(400, 300)
  28. );
  29. ----
  30. *Constructor 3:*
  31. [source,java]
  32. ----
  33. /** Additional Parameters:
  34. * Vector4f resizeBorders,
  35. * String defaultImg
  36. */
  37. AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15), new Vector2f(400, 300),
  38. new Vector4f(14,14,14,14),
  39. “tonegod/gui/style/def/Window/panel_x.png”
  40. );
  41. ----
  42. === Abstract Event Methods:
  43. [source,java]
  44. ----
  45. public void onButtonOkPressed(MouseButtonEvent evt, boolean toggled);
  46. ----
  47. === AlertBox specific methods:
  48. [source,java]
  49. ----
  50. alert.setMsg(String text); // Set the alert message
  51. alert.setButtonOkText(String text); // Sets the text for the ok button of the AlertBox
  52. ----