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

- Add asc_setGraphicObjectProps

- Add asc_CShapeProperty
- Add shapes defines
- В getGraphicObjectProps cделан переход на asc_классы
- Отправка эвента selectionChanged при клике по графическому объекту

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48101 954022d7-b5bf-4e40-9824-e11837661b57
parent 48aca428
......@@ -2165,6 +2165,39 @@ prot["asc_getShapeProperties"] = prot.asc_getShapeProperties;
prot["asc_putShapeProperties"] = prot.asc_putShapeProperties;
//}
//-----------------------------------------------------------------------------------
// CShapeProperty
//-----------------------------------------------------------------------------------
function asc_CShapeProperty() {
this.type = null; // custom
this.fill = null;
this.stroke = null;
}
asc_CShapeProperty.prototype = {
asc_getType: function() { return this.type; },
asc_putType: function(v) { this.type = v; },
asc_getFill: function() { return this.fill; },
asc_putFill: function(v) { this.fill = v; },
asc_getStroke: function() { return this.stroke; },
asc_putStroke: function(v) { this.stroke = v; }
}
//{ asc_CShapeProperty export
window["Asc"].asc_CShapeProperty = asc_CShapeProperty;
window["Asc"]["asc_CShapeProperty"] = asc_CShapeProperty;
prot = asc_CShapeProperty.prototype;
prot["asc_getType"] = prot.asc_getType;
prot["asc_putType"] = prot.asc_putType;
prot["asc_getFill"] = prot.asc_getFill;
prot["asc_putFill"] = prot.asc_putFill;
prot["asc_getStroke"] = prot.asc_getStroke;
prot["asc_putStroke"] = prot.asc_putStroke;
//}
//-----------------------------------------------------------------------------------
// Undo/Redo
//-----------------------------------------------------------------------------------
......@@ -4393,6 +4426,8 @@ function DrawingObjects() {
if ( _this.drawingDocument ) {
_this.controller.drawSelection(_this.drawingDocument);
_this.drawWorksheetHeaders();
//var xxx = _this.controller.getGraphicObjectProps();
}
}
......
......@@ -2104,6 +2104,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
return ws.objectRender.controller.getGraphicObjectProps();
},
asc_setGraphicObjectProps: function() {
// TODO
},
asyncImageStartLoaded: function() {
},
......@@ -2896,6 +2900,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_groupGraphicsObjects"] = prot.asc_groupGraphicsObjects;
prot["asc_unGroupGraphicsObjects"] = prot.asc_unGroupGraphicsObjects;
prot["asc_getGraphicObjectProps"] = prot.asc_getGraphicObjectProps;
prot["asc_setGraphicObjectProps"] = prot.asc_setGraphicObjectProps;
// Cell interface
prot["asc_getCellInfo"] = prot.asc_getCellInfo;
......
......@@ -329,13 +329,50 @@ var c_oAscFill = {
FILL_TYPE_SOLID : 3
};
var c_oAscFillBlipType = {
STRETCH : 1,
TILE : 2
};
var c_oAscStrokeType = {
STROKE_NONE: 0,
STROKE_COLOR: 1
};
var c_oAscTypeSelectElement =
{
var c_oAscLineJoinType = {
Round : 1,
Bevel : 2,
Miter : 3
};
var c_oAscLineCapType = {
Flat : 0,
Round : 1,
Square : 2
};
var c_oAscLineBeginType = {
None: 0,
Arrow: 1,
Diamond: 2,
Oval: 3,
Stealth: 4,
Triangle: 5
};
var c_oAscLineBeginSize = {
small_small : 0,
small_mid : 1,
small_large : 2,
mid_small : 3,
mid_mid : 4,
mid_large : 5,
large_small : 6,
large_mid : 7,
large_large : 8
};
var c_oAscTypeSelectElement = {
Paragraph : 0,
Table : 1,
Image : 2,
......
......@@ -280,7 +280,7 @@ DrawingObjectsController.prototype =
return this.curState.isPointInDrawingObjects(x, y);
},
getGraphicObjectProps: function()
getGraphicObjectProps: function() // Все свойства делаем чераз asc_классы
{
var shape_props, image_props;
......@@ -372,47 +372,51 @@ DrawingObjectsController.prototype =
if (!isRealObject(shape_props))
{
shape_props = {};
//shape_props = s_arr[i].Get_Props(null);
shape_props.ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
shape_props = c_obj.Get_Props(null);
shape_props.ShapeProperties = new asc_CShapeProperty();
shape_props.ShapeProperties.type = c_obj.getPresetGeom();
shape_props.ShapeProperties.fill = c_obj.getFill();
shape_props.ShapeProperties.stroke = c_obj.getStroke();
shape_props.ShapeProperties.canChangeArrows = c_obj.canChangeArrows();
//shape_props.verticalTextAlign = c_obj.bodyPr.anchor;
}
else
{
ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
shape_props = s_arr[i].Get_Props(shape_props);
/* TODO
ShapeProperties = new asc_CShapeProperty();
ShapeProperties.type = c_obj.getPresetGeom();
ShapeProperties.fill = c_obj.getFill();
ShapeProperties.stroke = c_obj.getStroke();
ShapeProperties.canChangeArrows = c_obj.canChangeArrows();
shape_props = c_obj.Get_Props(shape_props);
shape_props.ShapeProperties = CompareShapeProperties(ShapeProperties, shape_props.ShapeProperties);
shape_props.verticalTextAlign = undefined;
*/
}
}
if (c_obj.isImage())
{
if (!isRealObject(image_props))
{
image_props = {};
//image_props = s_arr[i].Get_Props(null);
image_props = new asc_CImgProperty;
image_props.Width = c_obj.extX;
image_props.Height = c_obj.extY;
image_props.ImageUrl = c_obj.getImageUrl();
}
/*else
else
{
image_props = s_arr[i].Get_Props(image_props);
/* TODO
image_props = c_obj.Get_Props(image_props);
if (image_props.ImageUrl != null && c_obj.getImageUrl() !== image_props.ImageUrl)
image_props.ImageUrl = null;
}*/
*/
}
}
if (c_obj.isGroup())
/*if (c_obj.isGroup())
{
var shape_props2 = c_obj.getShapeProps();
var image_props2 = c_obj.getImageProps2();
......@@ -477,7 +481,7 @@ DrawingObjectsController.prototype =
}
}
}
}*/
}
}
break;
......@@ -495,7 +499,7 @@ DrawingObjectsController.prototype =
this.drawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId);
}
shape_props.ShapeProperties = CreateAscShapePropFromProp(shape_props.ShapeProperties);
//shape_props.ShapeProperties = CreateAscShapePropFromProp(shape_props.ShapeProperties); // уже не надо, т.к. это asc_класс
}
ret.push(shape_props);
......@@ -503,8 +507,8 @@ DrawingObjectsController.prototype =
if (isRealObject(image_props))
{
if (image_props.ShapeProperties)
image_props.ShapeProperties = CreateAscShapePropFromProp(image_props.ShapeProperties);
//if (image_props.ShapeProperties)
// image_props.ShapeProperties = CreateAscShapePropFromProp(image_props.ShapeProperties); // уже не надо, т.к. это asc_класс
ret.push(image_props);
}
......
......@@ -725,6 +725,15 @@ CImage.prototype =
{
},
Get_Props: function(OtherProps)
{
var Props = new Object();
Props.Width = this.extX;
Props.Height = this.extY;
return Props;
},
Undo: function(type, data)
{
switch (type)
......
......@@ -1114,7 +1114,7 @@ CShape.prototype =
return this.brush;
},
getStroke: function()
getStroke: function()
{
if(!isRealObject(this.pen))
return null;
......@@ -1436,7 +1436,15 @@ CShape.prototype =
}
},
Get_Props: function(OtherProps)
{
var Props = new Object();
Props.Width = this.extX;
Props.Height = this.extY;
return Props;
},
Undo: function(type, data)
{
switch (type)
......
......@@ -5943,8 +5943,11 @@
if ( index < 0 )
this.drawDepCells();
else
else {
// отправляем евент для получения свойств картинки, шейпа или группы
this._trigger("setFocusDrawingObject", true);
this._trigger("selectionChanged", this.getSelectionInfo());
}
this.cellCommentator.drawCommentCells(false);
......
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