Commit 31c2290b 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@58070 954022d7-b5bf-4e40-9824-e11837661b57
parent 81aa155a
......@@ -231,6 +231,18 @@ DrawingObjectsController.prototype =
}
},
handleSlideComments: function(e, x, y, pageIndex)
{
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
return null;
}
else
{
return false;
}
},
checkChartForProps: function(bStart)
{
if(bStart)
......
......@@ -161,6 +161,11 @@ NullState.prototype =
start_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
}
var ret;
ret = this.drawingObjects.handleSlideComments(e, x, y, pageIndex);
if(ret)
{
return ret;
}
var selection = this.drawingObjects.selection;
var b_no_handle_selected = false;
if(selection.groupSelection)
......
......@@ -129,3 +129,132 @@ DrawingObjectsController.prototype.editChart = function(binary)
this.sendGraphicObjectProps();
}
};
DrawingObjectsController.prototype.handleSlideComments = function(e, x, y, pageIndex)
{
var comments = this.drawingObjects.slideComments.comments, i;
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
editor.asc_hideComments();
for(i = comments.length - 1; i > -1; --i)
{
comments[i].selected = false;
}
}
for(i = comments.length - 1; i > -1; --i)
{
if(comments[i].hit(x, y))
{
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
comments[i].selected = true;
this.addPreTrackObject(new MoveComment(comments[i]));
this.changeCurrentState(new PreMoveCommentState(this, x, y, comments[i]));
this.drawingObjects.showDrawingObjects(true);
return true;
}
else
{
return {objectId: comments[i], cursorType: "move"}
}
}
}
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
this.drawingObjects.showDrawingObjects(true);
return false;
}
else
{
return null;
}
};
function PreMoveCommentState(drawingObjects, startX, startY, comment)
{
this.drawingObjects = drawingObjects;
this.startX = startX;
this.startY = startY;
this.comment = comment;
}
PreMoveCommentState.prototype =
{
onMouseDown: function(e, x, y, pageIndex)
{
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
return true;
}
else
{
return {objectId: this.comment, cursorType: "move"}
}
},
onMouseMove: function(e, x, y, pageIndex)
{
if(Math.abs(this.startX - x) < MOVE_DELTA && Math.abs(this.startY - y) < MOVE_DELTA)
return;
this.drawingObjects.swapTrackObjects();
this.drawingObjects.changeCurrentState(new MoveCommentState(this.drawingObjects, this.startX, this.startY, this.comment));
this.drawingObjects.onMouseMove(e, x, y);
},
onMouseUp: function(e, x, y, pageIndex)
{
var Coords = editor.WordControl.m_oDrawingDocument.ConvertCoordsToCursorWR_Comment( this.comment.x, this.comment.y, this.drawingObjects.num);
editor.sync_HideComment();
editor.sync_ShowComment(this.comment.Id, Coords.X, Coords.Y );
this.drawingObjects.clearPreTrackObjects();
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
}
};
function MoveCommentState(drawingObjects, startX, startY, comment)
{
this.drawingObjects = drawingObjects;
this.startX = startX;
this.startY = startY;
this.comment = comment;
}
MoveCommentState.prototype =
{
onMouseDown: function(e, x, y, pageIndex)
{
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
return true;
}
else
{
return {objectId: this.comment, cursorType: "move"}
}
},
onMouseMove: function(e, x, y, pageIndex)
{
var dx = x - this.startX;
var dy = y - this.startY;
this.drawingObjects.arrTrackObjects[0].track(dx, dy);
this.drawingObjects.updateOverlay();
},
onMouseUp: function(e, x, y, pageIndex)
{
if(!this.drawingObjects.isViewMode() && editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_MoveComment, this.comment.Get_Id()) === false)
{
History.Create_NewPoint();
this.drawingObjects.trackEnd();
this.drawingObjects.startRecalculate();
}
this.drawingObjects.clearTrackObjects();
this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
}
};
\ No newline at end of file
......@@ -3619,7 +3619,7 @@ CPresentation.prototype =
this.DrawingDocument.m_oWordControl.GoToPage(i);
var Coords = this.DrawingDocument.ConvertCoordsToCursorWR_Comment(comments[j].x, comments[j].y, i);
this.Slides[i].graphicObjects.showComment(Id, Coords.X, Coords.Y);
this.Slides[i].showComment(Id, Coords.X, Coords.Y);
return;
}
}
......
......@@ -994,6 +994,12 @@ Slide.prototype =
editor.WordControl.m_oDrawingDocument.OnRecalculatePage(this.num, this);
},
showComment: function(Id, x, y)
{
editor.sync_HideComment();
editor.sync_ShowComment(Id, x, y );
},
getWorksheet: function()
......@@ -1339,6 +1345,8 @@ SlideComments.prototype =
this.comments.splice(this.comments.length, 0, comment);
},
changeComment: function(id, commentData)
{
for(var i = 0; i < this.comments.length; ++i)
......
......@@ -1224,9 +1224,9 @@ asc_docs_api.prototype.UpdateTextPr = function(TextPr)
oTextPrMap[Item]( this, TextPr[Item] );
}
if (TextPr.Color !== undefined && TextPr.unifill !== undefined)
if (TextPr.Unifill !== undefined)
{
this.sync_TextColor2(TextPr.unifill, TextPr.Color);
this.sync_TextColor2(TextPr.Unifill);
}
}
}
......@@ -2286,7 +2286,7 @@ asc_docs_api.prototype.put_TextColor = function(color)
_unifill.fill = new CSolidFill();
_unifill.fill.color = CorrectUniColor(color, _unifill.fill.color);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { unifill : _unifill } ) );
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Unifill : _unifill } ) );
}
asc_docs_api.prototype.put_ParagraphShade = function(is_flag, r, g, b)
{
......@@ -2338,32 +2338,36 @@ asc_docs_api.prototype.sync_ListType = function(NumPr){
asc_docs_api.prototype.sync_TextColor = function(Color){
this.asc_fireCallback("asc_onTextColor", new CColor( Color.r, Color.g, Color.b ));
}
asc_docs_api.prototype.sync_TextColor2 = function(unifill, _color)
asc_docs_api.prototype.sync_TextColor2 = function(unifill)
{
var _color;
if (unifill.fill == null)
return;
else if (unifill.fill.type == FILL_TYPE_SOLID)
{
_color = unifill.getRGBAColor();
var color = CreateAscColor(unifill.fill.color);
color.put_r(_color.r);
color.put_g(_color.g);
color.put_b(_color.b);
color.put_r(_color.R);
color.put_g(_color.G);
color.put_b(_color.B);
this.asc_fireCallback("asc_onTextColor", color);
}
else if (unifill.fill.type == FILL_TYPE_GRAD)
{
_color = unifill.getRGBAColor();
var color = CreateAscColor(unifill.fill.colors[0].color);
color.put_r(_color.r);
color.put_g(_color.g);
color.put_b(_color.b);
color.put_r(_color.R);
color.put_g(_color.G);
color.put_b(_color.B);
this.asc_fireCallback("asc_onTextColor", color);
}
else
{
_color = unifill.getRGBAColor();
var color = new CAscColor();
color.put_r(_color.r);
color.put_g(_color.g);
color.put_b(_color.b);
color.put_r(_color.R);
color.put_g(_color.G);
color.put_b(_color.B);
this.asc_fireCallback("asc_onTextColor", color);
}
}
......
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