Commit fd1ef5f3 authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

поправлено меню формул

прокинут механизм создания формулы внутри формулы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52948 954022d7-b5bf-4e40-9824-e11837661b57
parent bc606d5b
......@@ -7580,8 +7580,12 @@ ParaMath.prototype =
else if ( para_Space === Type )
this.Math.AddLetter( 0x0020 );
else if ( para_Math === Type )
{
// TODO: реализовать
{
var oCorContent = this.Math.CurrentContent;
var rPr = oCorContent.getRpr();
Item.Root.setRPrp(rPr);
oCorContent.AddContentToContent(Item.Math.Root);
oCorContent.verifyRPrp_MC_2(rPr);
}
},
......
......@@ -3242,7 +3242,6 @@
<div style="float: left; background-image: url(Math/img/logarithm_2.png); width: 112px; height: 104px; background-position: 112px 104px;" value="187"></div>
</div>
<div class="operator mathContainer" style="display:none;width:480px;background-color:#fff;top: 80px; right: -4px;z-index:100;position:absolute;padding-top: 5px;border: 4px ridge silver;overflow-y:scroll;">
<div style="float: left; background-image: url(Math/img/operators.png); width: 56px; height: 80px; background-position: 224px 160px;" value="188"></div>
<div style="float: left; background-image: url(Math/img/operators.png); width: 56px; height: 80px; background-position: 168px 160px;" value="189"></div>
<div style="float: left; background-image: url(Math/img/operators.png); width: 56px; height: 80px; background-position: 112px 160px;" value="190"></div>
......@@ -3265,7 +3264,31 @@
<div style="float: left; background-image: url(Math/img/operators_2.png); width: 104px; height: 80px; background-position: 104px 80px;" value="207"></div>
<div style="float: left; background-image: url(Math/img/operators_3.png); width: 56px; height: 80px; background-position: 56px 80px;" value="208"></div>
</div>
</div>
<div class="matrix mathContainer" style="display:none;width:480px;height:480px;background-color:#fff;top: 80px; right: -4px;z-index:100;position:absolute;padding-top: 5px;border: 4px ridge silver;overflow-y:scroll;">
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 320px 520px;" value="209"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 240px 520px;" value="210"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 160px 520px;" value="211"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 80px 520px;" value="212"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 320px 416px;" value="213"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 240px 416px;" value="214"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 160px 416px;" value="215"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 80px 416px;" value="216"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 320px 312px;" value="217"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 240px 312px;" value="218"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 160px 312px;" value="219"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 80px 312px;" value="220"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 320px 208px;" value="221"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 240px 208px;" value="222"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 160px 208px;" value="223"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 80px 208px;" value="224"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 320px 104px;" value="225"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 240px 104px;" value="226"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 160px 104px;" value="227"></div>
<div style="float: left; background-image: url(Math/img/matrix.png); width: 80px; height: 104px; background-position: 80px 104px;" value="228"></div>
<div style="float: left; background-image: url(Math/img/matrix_1.png); width: 160px; height: 104px; background-position: 320px 104px;" value="229"></div>
<div style="float: left; background-image: url(Math/img/matrix_1.png); width: 160px; height: 104px; background-position: 160px 104px;" value="230"></div>
</div>
</div>
......
......@@ -8809,6 +8809,190 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
var sText = String.fromCharCode(8710);
AddText(groupElem,sText);
break;
case 209: props = {column:2, row:1, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 210: props = {column:1, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 211: props = {column:3, row:1, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 212: props = {column:1, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 213: props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 214: props = {column:3, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 215: props = {column:2, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 216: props = {column:3, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
break;
case 217: var sText = String.fromCharCode(8943);
AddText(MathElement.Math.Root,sText);
break;
case 218: var sText = String.fromCharCode(8230);
AddText(MathElement.Math.Root,sText);
break;
case 219: var sText = String.fromCharCode(8942);
AddText(MathElement.Math.Root,sText);
break;
case 220: var sText = String.fromCharCode(8945);
AddText(MathElement.Math.Root,sText);
break;
case 221: props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
var oElem = oMatrix.getElement(0,0);
AddText(oElem, "1");
oElem = oMatrix.getElement(0,1);
AddText(oElem, "0");
oElem = oMatrix.getElement(1,0);
AddText(oElem, "0");
oElem = oMatrix.getElement(1,1);
AddText(oElem, "1");
break;
case 222: props = {column:2, row:2, mcJc:"center", plcHide:1};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
var oElem = oMatrix.getElement(0,0);
AddText(oElem, "1");
oElem = oMatrix.getElement(1,1);
AddText(oElem, "1");
break;
case 223: props = {column:3, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
var oElem = oMatrix.getElement(0,0);
AddText(oElem, "1");
oElem = oMatrix.getElement(0,1);
AddText(oElem, "0");
oElem = oMatrix.getElement(0,2);
AddText(oElem, "0");
oElem = oMatrix.getElement(1,0);
AddText(oElem, "0");
oElem = oMatrix.getElement(1,1);
AddText(oElem, "1");
oElem = oMatrix.getElement(1,2);
AddText(oElem, "0");
oElem = oMatrix.getElement(2,0);
AddText(oElem, "0");
oElem = oMatrix.getElement(2,1);
AddText(oElem, "0");
oElem = oMatrix.getElement(2,2);
AddText(oElem, "1");
break;
case 224: props = {column:3, row:3, mcJc:"center", plcHide:1};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,MathElement.Math.Root,props);
var oElem = oMatrix.getElement(0,0);
AddText(oElem, "1");
oElem = oMatrix.getElement(1,1);
AddText(oElem, "1");
oElem = oMatrix.getElement(2,2);
AddText(oElem, "1");
break;
case 225: props = {column:1};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
break;
case 226: props = {column:1,begChr:"[", endChr:"]"};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
break;
case 227: var sChr = String.fromCharCode(124);
props = {column:1,begChr:sChr, endChr:sChr};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
break;
case 228: var sChr = String.fromCharCode(8214);
props = {column:1,begChr:sChr, endChr:sChr};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:2, row:2, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
break;
case 229: props = {column:1};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:3, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
var oElem = oMatrix.getElement(0,1);
var sText = String.fromCharCode(8943);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,0);
sText = String.fromCharCode(8942);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,1);
sText = String.fromCharCode(8945);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,2);
sText = String.fromCharCode(8942);
AddText(oElem, sText);
oElem = oMatrix.getElement(2,1);
sText = String.fromCharCode(8943);
AddText(oElem, sText);
break;
case 230: props = {column:1,begChr:"[", endChr:"]"};
var oDelimiter = new CDelimiter();
CreateElem(oDelimiter,MathElement.Math.Root,props);
var delimiterBase = oDelimiter.getBase(0);
props = {column:3, row:3, mcJc:"center"};
var oMatrix = new CMathMatrix();
CreateElem(oMatrix,delimiterBase,props);
var oElem = oMatrix.getElement(0,1);
var sText = String.fromCharCode(8943);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,0);
sText = String.fromCharCode(8942);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,1);
sText = String.fromCharCode(8945);
AddText(oElem, sText);
oElem = oMatrix.getElement(1,2);
sText = String.fromCharCode(8942);
AddText(oElem, sText);
oElem = oMatrix.getElement(2,1);
sText = String.fromCharCode(8943);
AddText(oElem, sText);
break;
}
this.WordControl.m_oLogicDocument.Paragraph_Add( MathElement );
......@@ -8880,11 +9064,11 @@ function AddText(oElem, sText, props)
{
if(sText)
{
var ctrPrp = new CTextPr();
var rPr = new CTextPr();
var oMRun = new CMathRunPrp();
if (props)
oMRun.setMathRunPrp(props);
oMRun.setTxtPrp(ctrPrp);
oMRun.setTxtPrp(rPr);
if (oElem)
{
oElem.addElementToContent(oMRun);
......
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