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

- Добавлены asc_классы для текстовых свойств автофигур

- Сделана передача этих свойств в меню

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48803 954022d7-b5bf-4e40-9824-e11837661b57
parent a653dcee
......@@ -1881,6 +1881,167 @@ prot["asc_addTab"] = prot.asc_addTab;
prot["asc_clear"] = prot.asc_clear;
//}
//-----------------------------------------------------------------------------------
// CParagraphBorders
//-----------------------------------------------------------------------------------
function asc_CParagraphBorders(obj) {
if (obj) {
this.Left = (undefined != obj.Left && null != obj.Left) ? new asc_CBorder (obj.Left) : null;
this.Top = (undefined != obj.Top && null != obj.Top) ? new asc_CBorder (obj.Top) : null;
this.Right = (undefined != obj.Right && null != obj.Right) ? new asc_CBorder (obj.Right) : null;
this.Bottom = (undefined != obj.Bottom && null != obj.Bottom) ? new asc_CBorder (obj.Bottom) : null;
this.Between = (undefined != obj.Between && null != obj.Between) ? new asc_CBorder (obj.Between) : null;
}
else {
this.Left = null;
this.Top = null;
this.Right = null;
this.Bottom = null;
this.Between = null;
}
}
asc_CParagraphBorders.prototype = {
asc_getLeft: function(){return this.Left; },
asc_putLeft: function(v){this.Left = (v) ? new asc_CBorder (v) : null;},
asc_getTop: function(){return this.Top; },
asc_putTop: function(v){this.Top = (v) ? new asc_CBorder (v) : null;},
asc_getRight: function(){return this.Right; },
asc_putRight: function(v){this.Right = (v) ? new asc_CBorder (v) : null;},
asc_getBottom: function(){return this.Bottom; },
asc_putBottom: function(v){this.Bottom = (v) ? new asc_CBorder (v) : null;},
asc_getBetween: function(){return this.Between; },
asc_putBetween: function(v){this.Between = (v) ? new asc_CBorder (v) : null;}
}
//{ asc_CParagraphBorders export
window["Asc"].asc_CParagraphBorders = asc_CParagraphBorders;
window["Asc"]["asc_CParagraphBorders"] = asc_CParagraphBorders;
prot = asc_CParagraphBorders.prototype;
prot["asc_getLeft"] = prot.asc_getLeft;
prot["asc_putLeft"] = prot.asc_putLeft;
prot["asc_getTop"] = prot.asc_getTop;
prot["asc_putTop"] = prot.asc_putTop;
prot["asc_getRight"] = prot.asc_getRight;
prot["asc_putRight"] = prot.asc_putRight;
prot["asc_getBottom"] = prot.asc_getBottom;
prot["asc_putBottom"] = prot.asc_putBottom;
prot["asc_getBetween"] = prot.asc_getBetween;
prot["asc_putBetween"] = prot.asc_putBetween;
//}
//-----------------------------------------------------------------------------------
// CBorder
//-----------------------------------------------------------------------------------
function asc_CBorder(obj) {
if (obj) {
this.Color = (undefined != obj.Color && null != obj.Color) ? CreateAscColorCustomEx(obj.Color.r, obj.Color.g, obj.Color.b) : null;
this.Size = (undefined != obj.Size) ? obj.Size : null;
this.Value = (undefined != obj.Value) ? obj.Value : null;
this.Space = (undefined != obj.Space) ? obj.Space : null;
}
else {
this.Color = CreateAscColorCustomEx(0,0,0);
this.Size = 0.5 * g_dKoef_pt_to_mm;
this.Value = border_Single;
this.Space = 0;
}
}
asc_CBorder.prototype = {
asc_getColor: function(){return this.Color; },
asc_putColor: function(v){this.Color = v;},
asc_getSize: function(){return this.Size; },
asc_putSize: function(v){this.Size = v;},
asc_getValue: function(){return this.Value; },
asc_putValue: function(v){this.Value = v;},
asc_getSpace: function(){return this.Space; },
asc_putSpace: function(v){this.Space = v;},
asc_getForSelectedCells: function(){return this.ForSelectedCells; },
asc_putForSelectedCells: function(v){this.ForSelectedCells = v;}
}
//{ asc_CBorder export
window["Asc"].asc_CBorder = asc_CBorder;
window["Asc"]["asc_CBorder"] = asc_CBorder;
prot = asc_CBorder.prototype;
prot["asc_getColor"] = prot.asc_getColor;
prot["asc_putColor"] = prot.asc_putColor;
prot["asc_getSize"] = prot.asc_getSize;
prot["asc_putSize"] = prot.asc_putSize;
prot["asc_getValue"] = prot.asc_getValue;
prot["asc_putValue"] = prot.asc_putValue;
prot["asc_getSpace"] = prot.asc_getSpace;
prot["asc_putSpace"] = prot.asc_putSpace;
prot["asc_getForSelectedCells"] = prot.asc_getForSelectedCells;
prot["asc_putForSelectedCells"] = prot.asc_putForSelectedCells;
//}
//-----------------------------------------------------------------------------------
// CListType
//-----------------------------------------------------------------------------------
function asc_CListType(obj) {
if (obj) {
this.Type = (undefined == obj.Type) ? null : obj.Type;
this.SubType = (undefined == obj.Type) ? null : obj.SubType;
}
else {
this.Type = null;
this.SubType = null;
}
}
asc_CListType.prototype = {
asc_getListType: function() { return this.Type; },
asc_getListSubType: function() { return this.SubType; }
}
//{ asc_CListType export
window["Asc"].asc_CListType = asc_CListType;
window["Asc"]["asc_CListType"] = asc_CListType;
prot = asc_CListType.prototype;
prot["asc_getListType"] = prot.asc_getListType;
prot["asc_getListSubType"] = prot.asc_getListSubType;
//}
//-----------------------------------------------------------------------------------
// CTextFontFamily
//-----------------------------------------------------------------------------------
function asc_CTextFontFamily(obj) {
if (obj) {
this.Name = (undefined != obj.Name) ? obj.Name : null; // "Times New Roman"
this.Index = (undefined != obj.Index) ? obj.Index : null; // -1
}
else {
this.Name = "Times New Roman";
this.Index = -1;
}
}
asc_CTextFontFamily.prototype = {
asc_getName: function () { return this.Name; },
asc_getIndex: function () { return this.Index; }
}
//{ asc_CTextFontFamily export
window["Asc"].asc_CTextFontFamily = asc_CTextFontFamily;
window["Asc"]["asc_CTextFontFamily"] = asc_CTextFontFamily;
prot = asc_CTextFontFamily.prototype;
prot["asc_getName"] = prot.asc_getName;
prot["asc_getIndex"] = prot.asc_getIndex;
//}
//-----------------------------------------------------------------------------------
// Manager
......
......@@ -749,88 +749,6 @@ DrawingObjectsController.prototype =
{
var shape_props, image_props, chart_props;
ascSelectedObjects = [];
// Текстовые свойства объекта
var flag = false;
if(this.curState.id === STATES_ID_TEXT_ADD || this.curState.id === STATES_ID_TEXT_ADD_IN_GROUP)
{
flag = true;
}
else
{
if(this.curState.id != STATES_ID_GROUP)
{
var s_arr2 = this.selectedObjects;
if(s_arr2.length === 1 && s_arr2[0] instanceof CShape && !isRealObject(s_arr2[0].txBody))
flag = true;
for(var i = 0; i < this.selectedObjects.length; ++i)
{
if(this.selectedObjects[i].isShape() && this.selectedObjects[i].txBody)
{
flag = true;
break;
}
}
}
else
{
var gr_sel_array = this.curState.group.selectionInfo.selectionArray;
for(var i = 0; i < gr_sel_array.length; ++i)
{
if(gr_sel_array[i].isShape() && gr_sel_array[i].textBoxContent)
{
flag = true;
break;
}
}
}
}
if(flag)
{
var cur_state = this.curState;
switch(this.curState.id)
{
case STATES_ID_TEXT_ADD:
{
var text_object = cur_state.textObject;
if(text_object != null && text_object != null && text_object.txBody.content != null)
text_object.txBody.content.Document_UpdateInterfaceState();
break;
}
case STATES_ID_TEXT_ADD_IN_GROUP:
{
text_object = cur_state.textObject;
if(text_object != null && text_object.txBody.content != null)
text_object.txBody.content.Document_UpdateInterfaceState();
break;
}
default:
{
var para_pr = this.getParagraphParaPr();
if(this.selectedObjects.length === 1
&& this.selectedObjects[0] instanceof CShape
&& !isRealObject(this.selectedObjects[0].textBoxContent))
{
if(isRealObject(this.selectedObjects[0].Parent) && typeof this.selectedObjects[0].Parent.Get_CompiledPr2 === "function")
{
var para_pr2 = this.selectedObjects[0].Parent.Get_CompiledPr2(false).ParaPr;
if(isRealObject(para_pr2) && isRealObject(para_pr2.Ind))
{
para_pr.Ind = para_pr2.Ind;
}
}
}
//editor.UpdateParagraphProp(para_pr);
//editor.UpdateTextPr(this.getParagraphTextPr());
break;
}
}
//ascSelectedObjects.push(new asc_CSelectedObject( c_oAscTypeSelectElement.Paragraph, new asc_CParagraphProperty( prProp ) );
}
// Основные свойства объекта
if(isRealObject(this.curState.group))
......@@ -1091,9 +1009,101 @@ DrawingObjectsController.prototype =
ascSelectedObjects.push(new asc_CSelectedObject( c_oAscTypeSelectElement.Image, new asc_CImgProperty(ret[i]) ));
}
// Текстовые свойства объекта
var ParaPr = this.getParagraphParaPr();
var TextPr = this.getParagraphTextPr();
if ( ParaPr && TextPr ) {
this.prepareTextProperties(TextPr);
this.prepareParagraphProperties(ParaPr, TextPr);
}
return ascSelectedObjects;
},
prepareTextProperties: function(TextPr)
{
var _this = this;
var trigger = this.drawingObjects.callTrigger;
if ( "undefined" != typeof(TextPr) )
{
var oTextPrMap =
{
Bold : function(_this, v){ trigger("asc_onBold", v); },
Italic : function(_this, v){ trigger("asc_onItalic", v); },
Underline : function(_this, v){ trigger("asc_onUnderline", v); },
Strikeout : function(_this, v){ trigger("asc_onStrikeout", v); },
FontSize : function(_this, v){ trigger("asc_onFontSize", v); },
FontFamily : function(_this, v){ (v != undefined) ? trigger("asc_onFontFamily", new asc_CTextFontFamily(v)) : new asc_CTextFontFamily( { Name : "", Index : -1 } ); },
VertAlign : function(_this, v){ trigger("asc_onVerticalAlign", v); },
Color : function(_this, v){ if (v != undefined) trigger("asc_onTextColor", CreateAscColorCustomEx(v.r, v.g, v.b)); },
HighLight : function(_this, v){ if (v != undefined) trigger("asc_onTextHighLight", new asc_CColor(v.r, v.g, v.b)); },
Spacing : function(_this, v){ trigger("asc_onTextSpacing", v); },
DStrikeout : function(_this, v){ trigger("asc_onTextDStrikeout", v); },
Caps : function(_this, v){ trigger("asc_onTextDStrikeout", v); },
SmallCaps : function(_this, v){ trigger("asc_onTextSmallCaps", v); },
Position : function(_this, v){ trigger("asc_onTextPosition", v); },
Lang : function(_this, v){ trigger("asc_onTextLanguage", v);}
}
for ( var Item in oTextPrMap )
{
oTextPrMap[Item]( this, TextPr[Item] );
}
}
},
prepareParagraphProperties: function(ParaPr, TextPr)
{
var _this = this;
var trigger = this.drawingObjects.callTrigger;
ParaPr.Subscript = ( TextPr.VertAlign === vertalign_SubScript ? true : false );
ParaPr.Superscript = ( TextPr.VertAlign === vertalign_SuperScript ? true : false );
ParaPr.Strikeout = TextPr.Strikeout;
ParaPr.DStrikeout = TextPr.DStrikeout;
ParaPr.AllCaps = TextPr.Caps;
ParaPr.SmallCaps = TextPr.SmallCaps;
ParaPr.TextSpacing = TextPr.Spacing;
ParaPr.Position = TextPr.Position;
//-----------------------------------------------------------------------------
if ( true === ParaPr.Spacing.AfterAutoSpacing )
ParaPr.Spacing.After = spacing_Auto;
else if ( undefined === ParaPr.Spacing.AfterAutoSpacing )
ParaPr.Spacing.After = UnknownValue;
if ( true === ParaPr.Spacing.BeforeAutoSpacing )
ParaPr.Spacing.Before = spacing_Auto;
else if ( undefined === ParaPr.Spacing.BeforeAutoSpacing )
ParaPr.Spacing.Before = UnknownValue;
if ( -1 === ParaPr.PStyle )
ParaPr.StyleName = "";
if ( null == ParaPr.NumPr || 0 === ParaPr.NumPr.NumId )
ParaPr.ListType = {Type: -1, SubType : -1};
// ParaPr.Spacing
if ( true === ParaPr.Spacing.AfterAutoSpacing )
ParaPr.Spacing.After = spacing_Auto;
else if ( undefined === ParaPr.Spacing.AfterAutoSpacing )
ParaPr.Spacing.After = UnknownValue;
if ( true === ParaPr.Spacing.BeforeAutoSpacing )
ParaPr.Spacing.Before = spacing_Auto;
else if ( undefined === ParaPr.Spacing.BeforeAutoSpacing )
ParaPr.Spacing.Before = UnknownValue;
trigger("asc_onParaSpacingLine", new asc_CParagraphSpacing( ParaPr.Spacing ));
// ParaPr.Jc
trigger("asc_onPrAlign", ParaPr.Jc);
ascSelectedObjects.push(new asc_CSelectedObject( c_oAscTypeSelectElement.Paragraph, new asc_CParagraphProperty( ParaPr ) ));
},
setGraphicObjectProps: function(props)
{
History.Create_NewPoint();
......
......@@ -483,7 +483,7 @@ function NullState(drawingObjectsController, drawingObjects)
}
else if(hit_in_text_rect)
{
return {objectId: cur_drawing.Id, cursorType: "move"};
return {objectId: cur_drawing.Id, cursorType: "text"};
}
}
else if(cur_drawing.isGroup())
......
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