Menubar.File.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Menubar.File = function ( signals ) {
  2. var container = new UI.Panel();
  3. container.setClass( 'menu' );
  4. var title = new UI.Panel();
  5. title.setTextContent( 'File' ).setColor( '#666' );
  6. title.setMargin( '0px' );
  7. title.setPadding( '8px' );
  8. container.add( title );
  9. //
  10. var options = new UI.Panel();
  11. options.setClass( 'options' );
  12. container.add( options );
  13. // open
  14. var option = new UI.Panel();
  15. option.setClass( 'option' );
  16. option.setTextContent( 'Open' );
  17. option.onClick( function () { alert( 'Open' ) } );
  18. options.add( option );
  19. // reset scene
  20. var option = new UI.Panel();
  21. option.setClass( 'option' );
  22. option.setTextContent( 'Reset' );
  23. option.onClick( function () { signals.resetScene.dispatch(); } );
  24. options.add( option );
  25. // export geometry
  26. var option = new UI.Panel();
  27. option.setClass( 'option' );
  28. option.setTextContent( 'Export Geometry' );
  29. option.onClick( function () { signals.exportGeometry.dispatch(); } );
  30. options.add( option );
  31. // export scene
  32. var option = new UI.Panel();
  33. option.setClass( 'option' );
  34. option.setTextContent( 'Export Scene' );
  35. option.onClick( function () { signals.exportScene.dispatch(); } );
  36. options.add( option );
  37. // export OBJ
  38. var option = new UI.Panel();
  39. option.setClass( 'option' );
  40. option.setTextContent( 'Export OBJ' );
  41. option.onClick( function () { alert( 'Export OBJ' ) } );
  42. options.add( option );
  43. //
  44. return container;
  45. }
粤ICP备19079148号