Commit d92b2e58 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48567 954022d7-b5bf-4e40-9824-e11837661b57
parent 344af95d
......@@ -266,6 +266,14 @@ DrawingObjectsController.prototype =
{
this.curState.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
}
else
{
this.drawingObjects.drawingDocument.UpdateTargetTransform(null);
this.drawingObjects.drawingDocument.TargetEnd();
this.drawingObjects.drawingDocument.SelectEnabled(false);
this.drawingObjects.drawingDocument.SelectClear();
this.drawingObjects.drawingDocument.SelectShow();
}
},
onMouseDown: function(e, x, y)
......@@ -304,12 +312,15 @@ DrawingObjectsController.prototype =
while(this.selectedObjects.length > 0)
this.selectedObjects[0].deselect(this);
this.changeCurrentState(new NullState(this, this.drawingObjects));
this.updateSelectionState();
},
resetSelection: function()
{
while(this.selectedObjects.length > 0)
this.selectedObjects[0].deselect(this);
this.drawingObjects.drawingDocument.UpdateTargetTransform(null);
this.drawingObjects.drawingDocument.TargetEnd();
},
clearPreTrackObjects: function()
......
......@@ -451,6 +451,10 @@ CGroupShape.prototype =
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].recalculateTransform();
if(typeof this.spTree[i].calculateContent === "function")
this.spTree[i].calculateContent();
if(typeof this.spTree[i].calculateTransformTextMatrix === "function")
this.spTree[i].calculateTransformTextMatrix();
}
},
......
......@@ -101,6 +101,8 @@ CImage.prototype =
return true;//TODO
},
isChart: function()
{
return false;/*TODO*/
......@@ -111,6 +113,21 @@ CImage.prototype =
return true;
},
deleteDrawingBase: function()
{
var position = this.drawingObjects.deleteDrawingBase(this.Get_Id());
if(isRealNumber(position))
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_DeleteDrawingBase, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(position, null)), null);
}
},
addToDrawingObjects: function(pos)
{
var position = this.drawingObjects.addGraphicObject(this, pos);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(position, null)), null);
},
initDefault: function(x, y, extX, extY, imageId)
{
this.setXfrmObject(new CXfrm());
......@@ -975,11 +992,7 @@ CImage.prototype =
return Props;
},
addToDrawingObjects: function()
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataClosePath()), null);
this.drawingObjects.addGraphicObject(this);
},
Undo: function(type, data)
......
......@@ -189,7 +189,14 @@ function NullState(drawingObjectsController, drawingObjects)
}
else if(hit_in_text_rect)
{
//TODO
this.drawingObjectsController.resetSelection();
cur_grouped_object.select(this.drawingObjectsController);
grouped_objects[i].select(cur_grouped_object);
grouped_objects[i].selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, cur_drawing, grouped_objects[i]));
if(e.ClickCount < 2)
grouped_objects[i].updateSelectionState(this.drawingObjects.drawingDocument);
return;
}
}
}
......@@ -2417,7 +2424,6 @@ function ChangeAdjState(drawingObjectsController, drawingObjects)
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
drawingObjects.showDrawingObjects(true);
}
};
......@@ -2430,7 +2436,6 @@ function ChangeAdjState(drawingObjectsController, drawingObjects)
this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape();
};
this.onKeyDown = function(e)
......@@ -2617,7 +2622,13 @@ function GroupState(drawingObjectsController, drawingObjects, group)
}
else if(hit_in_text_rect)
{
//TODO
this.drawingObjectsController.resetSelection();
this.group.select(this.drawingObjectsController);
cur_drawing.select(this.group);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
}
}
}
......@@ -2647,7 +2658,13 @@ function GroupState(drawingObjectsController, drawingObjects, group)
}
else if(hit_in_text_rect)
{
//TODO
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
cur_grouped_object.select(this.group);
cur_grouped_object.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
}
}
}
......
......@@ -174,9 +174,13 @@ function MoveGroupTrack(originalObject)
this.trackEnd = function()
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.originalObject.setPosition(this.x, this.y);
this.originalObject.recalculateTransform();
this.originalObject.recalculate();
this.originalObject.updateDrawingBaseCoordinates();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
};
}
......
......@@ -1149,6 +1149,8 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
{
this.original = originalObject;
this.originalObject = originalObject;
this.parentTrack = parentTrack;
var numberHandle;
if(isRealNumber(cardDirection))
......@@ -1760,6 +1762,9 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
this.trackEnd = function()
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.original.setPosition(this.x, this.y);
this.original.setExtents(this.extX, this.extY);
this.original.setChildExtents(this.extX, this.extY);
......@@ -1769,7 +1774,10 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
this.childs[i].trackEnd();
}
if(this.parentTrack == null)
this.original.recalculateTransform();
this.original.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
};
......
......@@ -270,7 +270,11 @@ function RotateTrackGroup(originalObject)
this.trackEnd = function()
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.originalObject.setRotate(this.angle);
this.originalObject.recalculateTransform();
this.originalObject.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}
}
\ No newline at end of file
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