dialogbox.adoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. = dialogbox
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == DialogBox Class
  5. The DialogBox extends AlertBox adding a Cancel button with event handlers.
  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. DialogBox dialog = new DialogBox(screen, "dialog", new Vector2f(15, 15));
  16. ----
  17. *Constructor 2:*
  18. [source,java]
  19. ----
  20. /** Additional Parameter:
  21. * Vector2f dimensions */
  22. DialogBox dialog = new DialogBox(screen, "dialog", 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. DialogBox dialog = new DialogBox(screen, "dialog", 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. public void onButtonCencelPressed(MouseButtonEvent evt, boolean toggled)
  43. ----
  44. === Methods specific to the DialogBox class:
  45. [source,java]
  46. ----
  47. dialog.setButtonCancelText(String text);
  48. ----