code_uibutton.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. var utils = require("Scripts/utils");
  3. exports.init = function(mylayout,mylogger) {
  4. var button1 = mylayout.getWidget("demobutton");
  5. button1.onClick = function () {
  6. mylogger.setText( "UIButton action : " + button1.id + " was pressed ");
  7. };
  8. var button2 = mylayout.getWidget("buttonducky");
  9. button2.onClick = function () {
  10. mylogger.setText( "UIButton action : " + button2.id + " was pressed ");
  11. };
  12. var button3 = mylayout.getWidget("buttonready");
  13. button3.onClick = function () {
  14. mylogger.setText( "UIButton action : " + button3.id + " was pressed ");
  15. };
  16. var button4 = mylayout.getWidget("buttonatomic");
  17. button4.onClick = function () {
  18. mylogger.setText( "UIButton action : " + button4.id + " was pressed ");
  19. };
  20. var button7 = mylayout.getWidget("buttongreen");
  21. button7.onClick = function () {
  22. mylogger.setText( "UIButton action : " + button7.id + " was pressed ");
  23. };
  24. var button5 = mylayout.getWidget("uibuttoncode");
  25. button5.onClick = function () {
  26. mylogger.setText( "UIButton action : " + button5.id + " was pressed ");
  27. utils.viewCode ( "Components/code_uibutton.js", mylayout );
  28. };
  29. var button6 = mylayout.getWidget("uibuttonlayout");
  30. button6.onClick = function () {
  31. mylogger.setText( "UIButton action : " + button6.id + " was pressed ");
  32. utils.viewCode ( "Scenes/layout_uibutton.ui.txt", mylayout );
  33. };
  34. };