Skip to content
Snippets Groups Projects
Commit 3b3805b0 authored by Sergey Linev's avatar Sergey Linev
Browse files

[rcanvas] let store RCanvas in ROOT file via context menu

Disable menu for PDF, PS or C file - not yet implemented for RCanvas
parent 0f6f11a3
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@
#include "TList.h"
#include "TEnv.h"
#include "TROOT.h"
#include "TFile.h"
#include "TClass.h"
#include "TBufferJSON.h"
#include "TBase64.h"
......@@ -512,6 +513,12 @@ void RCanvasPainter::ProcessData(unsigned connid, const std::string &arg)
}
} else if (check_header("SAVE:")) {
SaveCreatedFile(cdata);
} else if (check_header("PRODUCE:")) {
R__LOG_DEBUG(0, CanvasPainerLog()) << "Create file " << cdata;
TFile *f = TFile::Open(cdata.c_str(), "RECREATE");
f->WriteObject(&fCanvas, "Canvas");
delete f;
} else if (check_header("REQ:")) {
auto req = TBufferJSON::FromJSON<RDrawableRequest>(cdata);
if (req) {
......
......@@ -32,7 +32,8 @@ sap.ui.define([
StatusIcon: chk_icon(false),
ToolbarIcon: chk_icon(false),
TooltipIcon: chk_icon(true),
StatusLbl1:"", StatusLbl2:"", StatusLbl3:"", StatusLbl4:"", Standalone: true });
StatusLbl1:"", StatusLbl2:"", StatusLbl3:"", StatusLbl4:"",
Standalone: true, isRoot6: true });
this.getView().setModel(model);
let vd = this.getView().getViewData();
......@@ -65,11 +66,18 @@ sap.ui.define([
cp.drawInUI5ProjectionArea = this.drawInProjectionArea.bind(this);
cp.showUI5Panel = this.showPanelInLeftArea.bind(this);
if (cp.v7canvas) model.setProperty("/isRoot6", false);
}
// this.toggleGedEditor();
},
isv7: function() {
let cp = this.getCanvasPainter();
return cp && cp.v7canvas;
},
executeObjectMethod: function(painter, method, menu_obj_id) {
if (method.fArgs!==undefined) {
......@@ -288,7 +296,8 @@ sap.ui.define([
p = this.getCanvasPainter();
if (p) p.registerForPadEvents(null);
if (ged) ged.cleanupGed();
if (p && p.processChanges) p.processChanges("sbits", p);
if (p && p.processChanges)
p.processChanges("sbits", p);
},
getLeftController: function(name) {
......
......@@ -22,9 +22,9 @@
<MenuItem text="Canvas.svg" tooltip="Creates SVG snapshot of browser window"/>
<MenuItem text="Canvas.jpeg" tooltip="Creates JPEG snapshot of browser window"/>
<MenuItem text="Canvas.root" startsSection="true" tooltip="Produces ROOT output on C++ side"/>
<MenuItem text="Canvas.pdf" tooltip="Produces PDF output on C++ side"/>
<MenuItem text="Canvas.ps" tooltip="Produces PS output on C++ side"/>
<MenuItem text="Canvas.C" tooltip="Produces C output on server side"/>
<MenuItem text="Canvas.pdf" enabled="{/isRoot6}" tooltip="Produces PDF output on C++ side"/>
<MenuItem text="Canvas.ps" enabled="{/isRoot6}" tooltip="Produces PS output on C++ side"/>
<MenuItem text="Canvas.C" enabled="{/isRoot6}" tooltip="Produces C output on server side"/>
</items>
</MenuItem>
<MenuItem text="Save as ..." icon="sap-icon://save" enabled="false"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment