Commit db8bba0b authored by SergeyLuzyanin's avatar SergeyLuzyanin

notes

parent 3d7cb789
......@@ -3801,6 +3801,9 @@ CShape.prototype.hitInTextRectWord = function(x, y)
CShape.prototype.hitInTextRect = function (x, y) {
var oController = this.getDrawingObjectsController && this.getDrawingObjectsController();
if(this.parent && this.parent.kind === AscFormat.TYPE_KIND.NOTES){
return true;
}
if(!this.txWarpStruct || !this.recalcInfo.warpGeometry ||
this.recalcInfo.warpGeometry.preset === "textNoShape" ||
oController && (AscFormat.getTargetTextObject(oController) === this || (oController.curState.startTargetTextObject === this)))
......
......@@ -47,7 +47,7 @@ DrawingObjectsController.prototype.getTheme = function()
DrawingObjectsController.prototype.getDrawingArray = function()
{
return this.drawingObjects.cSld.spTree;
return this.drawingObjects.getDrawingsForController();
};
DrawingObjectsController.prototype.recalculateCurPos = function(){
......
......@@ -256,6 +256,29 @@
return oBodyShape.isEmptyPlaceholder();
};
CNotes.prototype.showDrawingObjects = function(){
if(this.slide){
editor.WordControl.m_oDrawingDocument.Notes_OnRecalculate(this.slide.num, this.slide.NotesWidth, this.slide.getNotesHeight());
}
};
CNotes.prototype.OnUpdateOverlay = function()
{
editor.WordControl.OnUpdateOverlay();
};
CNotes.prototype.getDrawingsForController = function()
{
var _ret = [];
var oBodyShape = this.getBodyShape();
if(oBodyShape){
_ret.push(oBodyShape);
}
return _ret;
};
CNotes.prototype.sendGraphicObjectProps = function()
{
editor.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
};
function CreateNotes(){
var oN = new CNotes();
......
......@@ -3331,18 +3331,11 @@ CPresentation.prototype =
this.CurPage = PageIndex;
e.ctrlKey = e.CtrlKey;
e.shiftKey = e.ShiftKey;
//if(e.Button === 0)
var ret = this.Slides[this.CurPage].graphicObjects.onMouseDown(e, X, Y);
if(!ret)
{
var ret = this.Slides[this.CurPage].graphicObjects.onMouseDown(e, X, Y);
if(!ret)
{
this.Document_UpdateSelectionState();
}
this.Document_UpdateSelectionState();
}
//else if(e.Button === 2 && this.viewMode === false )
//{
// this.Slides[this.CurPage].graphicObjects.onMouseDown2(e, X, Y);
//}
this.Document_UpdateInterfaceState();
},
......@@ -3410,9 +3403,12 @@ CPresentation.prototype =
}
}
if(oCurSlide.notesShape){
oCurSlide.notesShape.selectionSetStart(e, X, Y, 0);
if(e.ClickCount < 2){
if(oCurSlide.notes){
e.ctrlKey = e.CtrlKey;
e.shiftKey = e.ShiftKey;
var ret = oCurSlide.notes.graphicObjects.onMouseDown(e, X, Y);
if(!ret)
{
this.Document_UpdateSelectionState();
}
this.Document_UpdateInterfaceState();
......@@ -3423,13 +3419,22 @@ CPresentation.prototype =
Notes_OnMouseUp : function(e, X, Y)
{
var oCurSlide = this.Slides[this.CurPage];
if(oCurSlide){
if(oCurSlide.notesShape){
oCurSlide.notesShape.selectionSetEnd(e, X, Y, 0);
this.Document_UpdateSelectionState();
this.Document_UpdateInterfaceState();
this.Api.sendEvent("asc_onSelectionEnd");
}
if(oCurSlide && oCurSlide.notes){
e.ctrlKey = e.CtrlKey;
e.shiftKey = e.ShiftKey;
oCurSlide.notes.graphicObjects.onMouseUp(e, X, Y);
if(e.Button === AscCommon.g_mouse_button_right && !this.noShowContextMenu)
{
var ContextData = new AscCommonSlide.CContextMenuData();
var ConvertedPos = this.DrawingDocument.ConvertCoordsToCursorWR( X, Y, this.CurPage );
ContextData.X_abs = ConvertedPos.X;
ContextData.Y_abs = ConvertedPos.Y;
ContextData.IsSlideSelect = false;
editor.sync_ContextMenuCallback( ContextData );
}
this.noShowContextMenu = false;
this.Document_UpdateInterfaceState();
this.Api.sendEvent("asc_onSelectionEnd");
}
},
......@@ -3437,13 +3442,16 @@ CPresentation.prototype =
{
var oCurSlide = this.Slides[this.CurPage];
if(oCurSlide){
if(oCurSlide.notesShape){
if(e.IsLocked){
oCurSlide.notesShape.selectionSetEnd(e, X, Y, 0);
this.Document_UpdateSelectionState();
this.UpdateCursorType(X, Y, e );
editor.sync_MouseMoveEndCallback();
}
if(oCurSlide.notes){
e.ctrlKey = e.CtrlKey;
e.shiftKey = e.ShiftKey;
editor.sync_MouseMoveStartCallback();
oCurSlide.notes.graphicObjects.onMouseMove(e, X, Y);
var bOldFocus = this.FocusOnNotes;
this.FocusOnNotes = true;
this.UpdateCursorType(X, Y, e );
this.FocusOnNotes = bOldFocus;
editor.sync_MouseMoveEndCallback();
}
}
},
......
......@@ -1060,6 +1060,8 @@ Slide.prototype =
var Width = AscCommonSlide.GetNotesWidth();
oDocContent.Reset(0, 0, Width, 2000);
oDocContent.Recalculate_Page(0, true);
this.notesShape.contentWidth = Width;
this.notesShape.contentHeight = 2000;
}
}
}, this, []);
......@@ -1427,6 +1429,10 @@ Slide.prototype =
spTree[i].Restart_CheckSpelling();
}
}
},
getDrawingsForController: function(){
return this.cSld.spTree;
}
};
......
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