code_uiscrollbar.js 937 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var utils = require("Scripts/utils");
  3. exports.init = function(mylayout,mylogger) {
  4. var sb = mylayout.getWidget("scrollbardemo");
  5. sb.subscribeToEvent( "WidgetEvent", function (ev) {
  6. if ( ev.type == Atomic.UI_EVENT_TYPE_CHANGED && sb == ev.target )
  7. mylogger.setText( "UIScrollBar action : " + sb.id + " changed value = `" + sb.value + "` event type = " + ev.type);
  8. });
  9. var button5 = mylayout.getWidget("uiscrollbarcode");
  10. button5.onClick = function () {
  11. mylogger.setText( "UIScrollBar action : " + button5.id + " was pressed ");
  12. utils.viewCode ( "Components/code_uiscrollbar.js", mylayout );
  13. };
  14. var button6 = mylayout.getWidget("uiscrollbarlayout");
  15. button6.onClick = function () {
  16. mylogger.setText( "UIScrollBar action : " + button6.id + " was pressed ");
  17. utils.viewCode ( "Scenes/layout_uiscrollbar.ui.txt", mylayout );
  18. };
  19. };