code_uiradiobutton.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. var utils = require("Scripts/utils");
  3. exports.init = function(mylayout,mylogger) {
  4. var button1 = mylayout.getWidget("demoradio");
  5. button1.onClick = function () {
  6. mylogger.setText( "UIRadioButton action : " + button1.id + " state is " + button1.value);
  7. };
  8. var button2 = mylayout.getWidget("radioset");
  9. button2.onClick = function () {
  10. mylayout.getWidget("demoradio").value = 1;
  11. mylogger.setText( "UIRadioButton action : " + button1.id + " set to 1");
  12. };
  13. var button3 = mylayout.getWidget("radiounset");
  14. button3.onClick = function () {
  15. mylayout.getWidget("demoradio").value = 0;
  16. mylogger.setText( "UIRadioButton action : " + button1.id + " set to 0");
  17. };
  18. var button5 = mylayout.getWidget("uiradiobuttoncode");
  19. button5.onClick = function () {
  20. mylogger.setText( "UIRadioButton action : " + button5.id + " was pressed ");
  21. utils.viewCode ( "Components/code_uiradiobutton.js", mylayout );
  22. };
  23. var button6 = mylayout.getWidget("uiradiobuttonlayout");
  24. button6.onClick = function () {
  25. mylogger.setText( "UIRadioButton action : " + button6.id + " was pressed ");
  26. utils.viewCode ( "Scenes/layout_uiradiobutton.ui.txt", mylayout );
  27. };
  28. };