Menubar.File.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Menubar.File = function ( signals ) {
  2. var container = new UI.Panel();
  3. container.setFloat( 'left' );
  4. container.setWidth( '50px' );
  5. container.setCursor( 'pointer' );
  6. container.onMouseOver( function () { options.setDisplay( '' ) } );
  7. container.onMouseOut( function () { options.setDisplay( 'none' ) } );
  8. container.onClick( function () { options.setDisplay( 'none' ) } );
  9. var title = new UI.Panel();
  10. title.setTextContent( 'File' ).setColor( '#666' );
  11. title.setMargin( '0px' );
  12. title.setPadding( '8px' )
  13. container.add( title );
  14. //
  15. var options = new UI.Panel();
  16. options.setWidth( '140px' );
  17. options.setBackgroundColor( '#ddd' );
  18. options.setPadding( '10px' );
  19. options.setDisplay( 'none' );
  20. container.add( options );
  21. var option = new UI.Panel();
  22. option.setTextContent( 'Open' ).setColor( '#666' );
  23. option.onClick( function () { alert( 'Open' ) } );
  24. options.add( option );
  25. var option = new UI.Panel();
  26. option.setTextContent( 'Reset' ).setColor( '#666' );
  27. option.onClick( function () { alert( 'Reset' ) } );
  28. options.add( option );
  29. var option = new UI.Panel();
  30. option.setTextContent( 'Export Geometry' ).setColor( '#666' );
  31. option.onClick( function () { signals.exportGeometry.dispatch(); } );
  32. options.add( option );
  33. var option = new UI.Panel();
  34. option.setTextContent( 'Export Scene' ).setColor( '#666' );
  35. option.onClick( function () { signals.exportScene.dispatch(); } );
  36. options.add( option );
  37. var option = new UI.Panel();
  38. option.setTextContent( 'Export OBJ' ).setColor( '#666' );
  39. option.onClick( function () { alert( 'Export OBJ' ) } );
  40. options.add( option );
  41. return container;
  42. }
粤ICP备19079148号