code_uimessagewindow.js 2.2 KB

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