Export Manager

This commit is contained in:
Val Erastov 2015-07-17 23:17:12 -07:00
parent ed2c85dd3c
commit 5a9497a703
3 changed files with 23 additions and 3 deletions

View file

@ -1,12 +1,15 @@
TCAD.STORAGE_PREFIX = "TCAD.projects.";
TCAD.App2D = function() {
var app = this;
this.viewer = new TCAD.TWO.Viewer(document.getElementById('viewer'));
this.initSketchManager();
this._exportWin = new TCAD.ui.Window($('#exportManager'));
$('#exportManager li').click(function() {TCAD.ui.closeWin(app._exportWin);});
var app = this;
this.actions = {};
@ -31,6 +34,10 @@ TCAD.App2D = function() {
app.cloneSketch();
});
this.registerAction('export', "Export", function (e) {
TCAD.ui.openWin(app._exportWin, e);
});
this.registerAction('exportSVG', "Export To SVG", function () {
app.exportTextData(app.viewer.io.svgExport(), "svg");
});

View file

@ -26,6 +26,10 @@ TCAD.ui.createActionsWinBuilder = function(win) {
};
};
TCAD.ui.closeWin = function(win) {
win.root.hide();
};
TCAD.ui.openWin = function(win, mouseEvent) {
var x = mouseEvent.pageX;

View file

@ -330,8 +330,7 @@
--><button class="btn tbtn act-clone" ><i class="fa fa-files-o"></i></button><!--
--><button class="btn tbtn act-open" ><i class="fa fa-folder-open-o"></i></button><!--
--><button class="btn tbtn act-save" ><i class="fa fa-floppy-o"></i></button><!--
--><button class="btn tbtn act-exportSVG" ><i class="fa fa-upload"></i></button><!--
--><button class="btn tbtn act-exportDXF sep" ><i class="fa fa-upload"></i></button><!--
--><button class="btn tbtn act-export sep" ><i class="fa fa-upload"></i></button><!--
--><button class="btn tbtn sep act-pan" ><i class="fa fa-arrows"></i></button><!--
--><button class="btn tbtn act-addPoint" style="background-image: url(img/dot.png);" type="submit" value=""></button><!--
--><button class="btn tbtn act-addSegment" style="background-image: url(img/line.png);" type="submit" value=""></button><!--
@ -392,6 +391,16 @@
</div>
</div>
<div id="exportManager" class="scroll win" style="display: none; min-width: 100px;">
<div class="tool-caption" >FORMAT<div class="rm pseudo-btn" style="float: right;"></div></div>
<div class="content panel" style="padding: 0;">
<ul class="tlist">
<li class="act-exportSVG">SVG</li>
<li class="act-exportDXF">DXF</li>
</ul>
</div>
</div>
<!--<div id="log" style="position:absolute; width: 500px; height: 300px; top:500px; pxleft:0; overflow: scroll;background-color: salmon;">-->
</body>
</html>