code_uimessagewindow.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // UIMessageWindow application source code
  2. 'use strict';
  3. var utils = require("Scripts/utils");
  4. exports.init = function(mylayout,mylogger) {
  5. //
  6. // widget event functions
  7. //
  8. var button1 = mylayout.getWidget("msgnone");
  9. button1.onClick = function () {
  10. var mess1 = new Atomic.UIMessageWindow(mylayout, "mymess1");
  11. mess1.show("MessageWindow - NONE", "this is a MessageWindow - None button", 0, 0, 0, 0);
  12. };
  13. var button2 = mylayout.getWidget("msgok");
  14. button2.onClick = function () {
  15. var mess2 = new Atomic.UIMessageWindow(mylayout, "mymess2");
  16. mess2.show("MessageWindow - OK", "this is a MessageWindow - OK button", Atomic.UI_MESSAGEWINDOW_SETTINGS_OK, 0, 0, 0);
  17. mess2.onEvent = function (ev) {
  18. mylogger.setText( "UIMessageWindow action : " + mess2.id + " was closed by " + ev.refID);
  19. };
  20. };
  21. var button3 = mylayout.getWidget("msgkcancel");
  22. button3.onClick = function () {
  23. var mess3 = new Atomic.UIMessageWindow(mylayout, "mymess3");
  24. mess3.show("MessageWindow - OK CANCEL", "this is a MessageWindow - OK CANCEL buttons", Atomic.UI_MESSAGEWINDOW_SETTINGS_OK_CANCEL, 0, 0, 0);
  25. mess3.onEvent = function (ev) {
  26. mylogger.setText( "UIMessageWindow action : " + mess3.id + " was closed by " + ev.refID);
  27. };
  28. };
  29. var button4 = mylayout.getWidget("msgyesno");
  30. button4.onClick = function () {
  31. var mess4 = new Atomic.UIMessageWindow(mylayout, "mymess4");
  32. mess4.show("MessageWindow - YES NO", "this is a MessageWindow - YES NO buttons", Atomic.UI_MESSAGEWINDOW_SETTINGS_YES_NO, 0, 0, 0);
  33. mess4.onEvent = function (ev) {
  34. mylogger.setText( "UIMessageWindow action : " +mess4.id + " was closed by " + ev.refID);
  35. };
  36. };
  37. //
  38. // support functions
  39. //
  40. var button5 = mylayout.getWidget("uimessagewindowcode");
  41. button5.onClick = function () {
  42. mylogger.setText( "UIMessageWindow support : " + button5.id + " was pressed ");
  43. utils.viewCode ( "Components/code_uimessagewindow.js", mylayout );
  44. };
  45. var button6 = mylayout.getWidget("uimessagewindowlayout");
  46. button6.onClick = function () {
  47. mylogger.setText( "UIMessageWindow support : " + button6.id + " was pressed ");
  48. utils.viewCode ( "Scenes/layout_uimessagewindow.ui.txt", mylayout );
  49. };
  50. };