Commit 402e6a97 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Теперь селект через DrawingDocument

Сброс cellEdit при вводе текста в автофигуру

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47825 954022d7-b5bf-4e40-9824-e11837661b57
parent 49bfcabe
......@@ -2109,6 +2109,9 @@ function DrawingObjects() {
autoShapeTrack = new CAutoshapeTrack();
autoShapeTrack.init( trackOverlay, 0, 0, shapeOverlayCtx.m_lWidthPix, shapeOverlayCtx.m_lHeightPix, shapeOverlayCtx.m_dWidthMM, shapeOverlayCtx.m_dHeightMM );
_this.drawingDocument = new CDrawingDocument();
_this.drawingDocument.AutoShapesTrack = autoShapeTrack;
isViewerMode = function() { return worksheet._trigger("getViewerMode"); };
......@@ -4001,8 +4004,8 @@ function DrawingObjects() {
}
_this.selectGraphicObject = function() {
if ( autoShapeTrack )
_this.controller.drawSelection(autoShapeTrack);
if ( _this.drawingDocument )
_this.controller.drawSelection(_this.drawingDocument);
}
_this.setScrollOffset = function(x_px, y_px) {
......@@ -4047,15 +4050,15 @@ function DrawingObjects() {
//-----------------------------------------------------------------------------------
_this.graphicObjectMouseDown = function(e, x, y) {
_this.controller.onMouseDown( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
_this.controller.onMouseDown( e, pxToMm(x + scrollOffset.x), pxToMm(y + scrollOffset.y) );
}
_this.graphicObjectMouseMove = function(e, x, y) {
_this.controller.onMouseMove( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
_this.controller.onMouseMove( e, pxToMm(x + scrollOffset.x), pxToMm(y + scrollOffset.y) );
}
_this.graphicObjectMouseUp = function(e, x, y) {
_this.controller.onMouseUp( e, pxToMm(x - scrollOffset.x), pxToMm(y - scrollOffset.y) );
_this.controller.onMouseUp( e, pxToMm(x + scrollOffset.x), pxToMm(y + scrollOffset.y) );
}
//-----------------------------------------------------------------------------------
......@@ -5148,7 +5151,6 @@ function DrawingObjects() {
//-----------------------------------------------------------------------------------
_this.controller = new DrawingObjectsController(_this);
_this.drawingDocument = new CDrawingDocument();
//-----------------------------------------------------------------------------------
// Private Misc Methods
......
......@@ -1068,9 +1068,16 @@
var t = this;
var coord = t._getCoordinates(event);
this.handlers.trigger("setShiftKey", event.shiftKey);
this.handlers.trigger("setShiftKey", event.shiftKey);
if (t.handlers.trigger("isGlobalLockEditCell"))
return;
if (!this.enableKeyEvents) {
t.handlers.trigger("canvasClick");
}
// shapes
// Shapes
var graphicsInfo = t.handlers.trigger("getGraphicsInfo", coord.x, coord.y);
if ( graphicsInfo && graphicsInfo.isShape ) {
asc["editor"].isStartAddShape = true;
......@@ -1081,18 +1088,13 @@
if ( asc["editor"].isStartAddShape ) {
event.ClickCount = 1;
t.handlers.trigger("graphicObjectMouseDown", event, coord.x, coord.y);
if ( t.isCellEditMode )
t.handlers.trigger("stopCellEditing");
return;
}
else
t.handlers.trigger("resetSelectedGraphicObjects");
if (t.handlers.trigger("isGlobalLockEditCell"))
return;
if (!this.enableKeyEvents) {
t.handlers.trigger("canvasClick");
}
if (event.originalEvent && 2 === event.originalEvent.detail) {
// Это означает, что это MouseDown для dblClick эвента (его обрабатывать не нужно)
// Порядок эвентов для dblClick - http://javascript.ru/tutorial/events/mouse#dvoynoy-levyy-klik
......@@ -1219,7 +1221,7 @@
/** @param event {jQuery.Event} */
_onMouseUp: function (event) {
// shapes
// Shapes
var coord = this._getCoordinates(event);
if ( asc["editor"].isStartAddShape ) {
this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y);
......@@ -1269,7 +1271,7 @@
var coord = t._getCoordinates(event);
t.hasCursor = true;
// shapes
// Shapes
if ( asc["editor"].isStartAddShape ) {
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;});
......
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