dialogbox.adoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. = dialogbox
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == DialogBox Class
  9. The DialogBox extends AlertBox adding a Cancel button with event handlers.
  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. DialogBox dialog = new DialogBox(screen, “dialog”, new Vector2f(15, 15));
  20. ----
  21. *Constructor 2:*
  22. [source,java]
  23. ----
  24. /** Additional Parameter:
  25. * Vector2f dimensions */
  26. DialogBox dialog = new DialogBox(screen, “dialog”, 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. DialogBox dialog = new DialogBox(screen, “dialog”, 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. public void onButtonCencelPressed(MouseButtonEvent evt, boolean toggled)
  47. ----
  48. === Methods specific to the DialogBox class:
  49. [source,java]
  50. ----
  51. dialog.setButtonCancelText(String text);
  52. ----