Commit 982393bc authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47816 954022d7-b5bf-4e40-9824-e11837661b57
parent 096d4ccd
......@@ -2100,7 +2100,9 @@ function DrawingObjects() {
drawingCtx = currentSheet.drawingCtx;
overlayCtx = currentSheet.overlayCtx;
shapeCtx = currentSheet.shapeCtx;
shapeCtx.m_oFontManager = api.wb.fmgrGraphics[2];
shapeOverlayCtx = currentSheet.shapeOverlayCtx;
shapeOverlayCtx.m_oFontManager = api.wb.fmgrGraphics[2];
trackOverlay = new COverlay();
trackOverlay.init( shapeOverlayCtx.m_oContext, "ws-canvas-overlay", 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM );
......@@ -4044,15 +4046,15 @@ function DrawingObjects() {
// Graphic object mouse events
//-----------------------------------------------------------------------------------
_this.shapeMouseDown = function(e, x, y) {
_this.graphicObjectMouseDown = function(e, x, y) {
_this.controller.onMouseDown( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
}
_this.shapeMouseMove = function(e, x, y) {
_this.graphicObjectMouseMove = function(e, x, y) {
_this.controller.onMouseMove( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
}
_this.shapeMouseUp = function(e, x, y) {
_this.graphicObjectMouseUp = function(e, x, y) {
_this.controller.onMouseUp( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
}
......
......@@ -617,7 +617,7 @@
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
t.handlers.trigger("shapeWindowKeyDown", event);
t.handlers.trigger("graphicObjectWindowKeyDown", event);
return true;
}
......@@ -918,7 +918,7 @@
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
t.handlers.trigger("shapeWindowKeyPress", event);
t.handlers.trigger("graphicObjectWindowKeyPress", event);
return true;
}
......@@ -1080,9 +1080,11 @@
if ( asc["editor"].isStartAddShape ) {
event.ClickCount = 1;
t.handlers.trigger("shapeMouseDown", event, coord.x, coord.y);
t.handlers.trigger("graphicObjectMouseDown", event, coord.x, coord.y);
return;
}
else
t.handlers.trigger("resetSelectedGraphicObjects");
if (t.handlers.trigger("isGlobalLockEditCell"))
return;
......@@ -1220,7 +1222,7 @@
// shapes
var coord = this._getCoordinates(event);
if ( asc["editor"].isStartAddShape ) {
this.handlers.trigger("shapeMouseUp", event, coord.x, coord.y);
this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y);
return;
}
......@@ -1269,7 +1271,7 @@
// shapes
if ( asc["editor"].isStartAddShape ) {
t.handlers.trigger("shapeMouseMove", event, coord.x, coord.y);
t.handlers.trigger("graphicObjectMouseMove", event, coord.x, coord.y);
t.handlers.trigger("updateWorksheet", t.element[0], coord.x, coord.y, event.ctrlKey, function(info){t.targetInfo = info;});
return;
}
......
......@@ -71,13 +71,15 @@
this._lockDraw = false;
// Теперь у нас 2 FontManager-а на весь документ (а не на каждом листе свой)
// Теперь у нас 2 FontManager-а на весь документ + 1 для автофигур (а не на каждом листе свой)
this.fmgrGraphics = []; // FontManager for draw (1 для обычного + 1 для поворотного текста)
this.fmgrGraphics.push(new CFontManager()); // Для обычного
this.fmgrGraphics.push(new CFontManager()); // Для поворотного
this.fmgrGraphics.push(new CFontManager()); // Для автофигур
this.fmgrGraphics[0].Initialize(true); // IE memory enable
this.fmgrGraphics[1].Initialize(true); // IE memory enable
this.fmgrGraphics[2].Initialize(true); // IE memory enable
this.buffers = {};
this.drawingCtx = undefined;
......@@ -198,14 +200,15 @@
"commentCellClick": function () {self._onCommentCellClick.apply(self, arguments);},
"isGlobalLockEditCell": function () {return self.collaborativeEditing.getGlobalLockEditCell();},
// shapes
"shapeMouseDown": function () {self._onShapeMouseDown.apply(self, arguments);},
"shapeMouseMove": function () {self._onShapeMouseMove.apply(self, arguments);},
"shapeMouseUp": function () {self._onShapeMouseUp.apply(self, arguments);},
"shapeWindowKeyDown": function () {self._onShapeWindowKeyDown.apply(self, arguments);},
"shapeWindowKeyPress": function () {self._onShapeWindowKeyPress.apply(self, arguments);},
"getGraphicsInfo": function () {return self._onGetGraphicsInfo.apply(self, arguments);},
"getSelectedGraphicObjects": function () {return self._onGetSelectedGraphicObjects.apply(self, arguments);}
// Shapes
"graphicObjectMouseDown": function () {self._onGraphicObjectMouseDown.apply(self, arguments);},
"graphicObjectMouseMove": function () {self._onGraphicObjectMouseMove.apply(self, arguments);},
"graphicObjectMouseUp": function () {self._onGraphicObjectMouseUp.apply(self, arguments);},
"graphicObjectWindowKeyDown": function () {self._onGraphicObjectWindowKeyDown.apply(self, arguments);},
"graphicObjectWindowKeyPress": function () {self._onGraphicObjectWindowKeyPress.apply(self, arguments);},
"getGraphicsInfo": function () {return self._onGetGraphicsInfo.apply(self, arguments);},
"getSelectedGraphicObjects": function () {return self._onGetSelectedGraphicObjects.apply(self, arguments);},
"resetSelectedGraphicObjects": function () {return self._onResetSelectedGraphicObjects.apply(self, arguments);}
});
this.model.handlers.add("cleanCellCache", function (wsId, range, canChangeColWidth) {
......@@ -660,27 +663,28 @@
ws.cellCommentator.asc_showComment(comments[0].asc_getId());
},
_onShapeMouseDown: function (e, x, y) {
// Shapes
_onGraphicObjectMouseDown: function (e, x, y) {
var ws = this.getWorksheet();
ws.objectRender.shapeMouseDown(e, x, y);
ws.objectRender.graphicObjectMouseDown(e, x, y);
},
_onShapeMouseMove: function (e, x, y) {
_onGraphicObjectMouseMove: function (e, x, y) {
var ws = this.getWorksheet();
ws.objectRender.shapeMouseMove(e, x, y);
ws.objectRender.graphicObjectMouseMove(e, x, y);
},
_onShapeMouseUp: function (e, x, y) {
_onGraphicObjectMouseUp: function (e, x, y) {
var ws = this.getWorksheet();
ws.objectRender.shapeMouseUp(e, x, y);
ws.objectRender.graphicObjectMouseUp(e, x, y);
},
_onShapeWindowKeyDown: function (e) {
_onGraphicObjectWindowKeyDown: function (e) {
var ws = this.getWorksheet();
ws.objectRender.controller.onKeyDown(e);
},
_onShapeWindowKeyPress: function (e) {
_onGraphicObjectWindowKeyPress: function (e) {
var ws = this.getWorksheet();
ws.objectRender.controller.onKeyPress(e);
},
......@@ -695,6 +699,12 @@
return ws.objectRender.getSelectedGraphicObjects();
},
_onResetSelectedGraphicObjects: function () {
var ws = this.getWorksheet();
return ws.objectRender.controller.resetSelection();
},
// Double click
_onMouseDblClick: function (x, y, isHideCursor, isCoord, callback) {
var res = false;
var ws = this.getWorksheet();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment