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

git-svn-id:...

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 = ...@@ -266,6 +266,14 @@ DrawingObjectsController.prototype =
{ {
this.curState.textObject.updateSelectionState(this.drawingObjects.drawingDocument); 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) onMouseDown: function(e, x, y)
...@@ -304,12 +312,15 @@ DrawingObjectsController.prototype = ...@@ -304,12 +312,15 @@ DrawingObjectsController.prototype =
while(this.selectedObjects.length > 0) while(this.selectedObjects.length > 0)
this.selectedObjects[0].deselect(this); this.selectedObjects[0].deselect(this);
this.changeCurrentState(new NullState(this, this.drawingObjects)); this.changeCurrentState(new NullState(this, this.drawingObjects));
this.updateSelectionState();
}, },
resetSelection: function() resetSelection: function()
{ {
while(this.selectedObjects.length > 0) while(this.selectedObjects.length > 0)
this.selectedObjects[0].deselect(this); this.selectedObjects[0].deselect(this);
this.drawingObjects.drawingDocument.UpdateTargetTransform(null);
this.drawingObjects.drawingDocument.TargetEnd();
}, },
clearPreTrackObjects: function() clearPreTrackObjects: function()
......
...@@ -451,6 +451,10 @@ CGroupShape.prototype = ...@@ -451,6 +451,10 @@ CGroupShape.prototype =
for(var i = 0; i < this.spTree.length; ++i) for(var i = 0; i < this.spTree.length; ++i)
{ {
this.spTree[i].recalculateTransform(); 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 = ...@@ -101,6 +101,8 @@ CImage.prototype =
return true;//TODO return true;//TODO
}, },
isChart: function() isChart: function()
{ {
return false;/*TODO*/ return false;/*TODO*/
...@@ -111,6 +113,21 @@ CImage.prototype = ...@@ -111,6 +113,21 @@ CImage.prototype =
return true; 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) initDefault: function(x, y, extX, extY, imageId)
{ {
this.setXfrmObject(new CXfrm()); this.setXfrmObject(new CXfrm());
...@@ -975,11 +992,7 @@ CImage.prototype = ...@@ -975,11 +992,7 @@ CImage.prototype =
return Props; 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) Undo: function(type, data)
......
...@@ -189,7 +189,14 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -189,7 +189,14 @@ function NullState(drawingObjectsController, drawingObjects)
} }
else if(hit_in_text_rect) 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) ...@@ -2417,7 +2424,6 @@ function ChangeAdjState(drawingObjectsController, drawingObjects)
for(var i = 0; i < track_objects2.length; ++i) for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd(); track_objects2[i].trackEnd();
drawingObjects.showDrawingObjects(true); drawingObjects.showDrawingObjects(true);
} }
}; };
...@@ -2430,7 +2436,6 @@ function ChangeAdjState(drawingObjectsController, drawingObjects) ...@@ -2430,7 +2436,6 @@ function ChangeAdjState(drawingObjectsController, drawingObjects)
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
}; };
this.onKeyDown = function(e) this.onKeyDown = function(e)
...@@ -2617,7 +2622,13 @@ function GroupState(drawingObjectsController, drawingObjects, group) ...@@ -2617,7 +2622,13 @@ function GroupState(drawingObjectsController, drawingObjects, group)
} }
else if(hit_in_text_rect) 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) ...@@ -2647,7 +2658,13 @@ function GroupState(drawingObjectsController, drawingObjects, group)
} }
else if(hit_in_text_rect) 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) ...@@ -174,9 +174,13 @@ function MoveGroupTrack(originalObject)
this.trackEnd = function() 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.setPosition(this.x, this.y);
this.originalObject.recalculateTransform(); this.originalObject.recalculate();
this.originalObject.updateDrawingBaseCoordinates(); 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) ...@@ -1149,6 +1149,8 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
function ResizeTrackGroup(originalObject, cardDirection, parentTrack) function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
{ {
this.original = originalObject; this.original = originalObject;
this.originalObject = originalObject;
this.parentTrack = parentTrack; this.parentTrack = parentTrack;
var numberHandle; var numberHandle;
if(isRealNumber(cardDirection)) if(isRealNumber(cardDirection))
...@@ -1760,6 +1762,9 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack) ...@@ -1760,6 +1762,9 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
this.trackEnd = function() 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.setPosition(this.x, this.y);
this.original.setExtents(this.extX, this.extY); this.original.setExtents(this.extX, this.extY);
this.original.setChildExtents(this.extX, this.extY); this.original.setChildExtents(this.extX, this.extY);
...@@ -1769,7 +1774,10 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack) ...@@ -1769,7 +1774,10 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
this.childs[i].trackEnd(); this.childs[i].trackEnd();
} }
if(this.parentTrack == null) 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) ...@@ -270,7 +270,11 @@ function RotateTrackGroup(originalObject)
this.trackEnd = function() 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.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