Commit ff127c2b authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

промежуточная версия

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48738 954022d7-b5bf-4e40-9824-e11837661b57
parent 0ca55c66
...@@ -370,12 +370,12 @@ CControlComposition.prototype = ...@@ -370,12 +370,12 @@ CControlComposition.prototype =
return {x: _x, y: _y}; return {x: _x, y: _y};
}, },
AddMathComponent: function(indef) // AddMathComponent -> CreateEquation
CreateEquation: function(indef)
{ {
this.Content[this.CurPos].AddMathComponent(indef); this.Content[this.CurPos].CreateEquation(indef);
this.Content[this.CurPos].RecalculateReverse(); this.Content[this.CurPos].RecalculateReverse();
this.Content[this.CurPos].UpdatePosition(); this.Content[this.CurPos].UpdatePosition();
//this.Content[this.CurPos].AddMathComponent(indef);
}, },
Paragraph_Add: function(TextPr) Paragraph_Add: function(TextPr)
{ {
...@@ -608,82 +608,6 @@ function Create_Structures() ...@@ -608,82 +608,6 @@ function Create_Structures()
var path = "url('Math/img/degree.png')"; var path = "url('Math/img/degree.png')";
Set_Container(dim, path, 9); Set_Container(dim, path, 9);
/*var Cont = document.getElementById("Container");
Cont.style.display = "block";
while(Cont.firstChild)
Cont.removeChild(Cont.firstChild);
Cont.style.width = "320px";
Cont.style.height = "104px";
var SubScript = document.createElement("div");
SubScript.id = "id_SubScript";
SubScript.style["float"] = "left";
SubScript.style.backgroundImage = "url('Math/img/degree.png')";
SubScript.style.width = "80px";
SubScript.style.height = "104px";
SubScript.style.backgroundPosition = "0px 0px";
Cont.appendChild( SubScript );
SubScript.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(4);
MathRecalculate();
}
var SuperScript = document.createElement("div");
SuperScript.id = "id_SuperScript";
SuperScript.style["float"] = "left";
SuperScript.style.backgroundImage = "url('Math/img/degree.png')";
SuperScript.style.width = "80px";
SuperScript.style.height = "104px";
SuperScript.style.backgroundPosition = "240px 0px";
Cont.appendChild( SuperScript );
SuperScript.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(5);
MathRecalculate();
}
var SubSuperScript = document.createElement("div");
SubSuperScript.id = "id_SubSuperScript";
SubSuperScript.style["float"] = "left";
SubSuperScript.style.backgroundImage = "url('Math/img/degree.png')";
SubSuperScript.style.width = "80px";
SubSuperScript.style.height = "104px";
SubSuperScript.style.backgroundPosition = "160px 0px";
Cont.appendChild( SubSuperScript );
SubSuperScript.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(6);
MathRecalculate();
}
var Pre_SubSuperScript = document.createElement("div");
Pre_SubSuperScript.id = "id_Pre_SubSuperScript";
Pre_SubSuperScript.style["float"] = "left";
Pre_SubSuperScript.style.backgroundImage = "url('Math/img/degree.png')";
Pre_SubSuperScript.style.width = "80px";
Pre_SubSuperScript.style.height = "104px";
Pre_SubSuperScript.style.backgroundPosition = "80px 0px";
Cont.appendChild( Pre_SubSuperScript );
Pre_SubSuperScript.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(7);
MathRecalculate();
}*/
} }
var Radical = document.createElement("div"); var Radical = document.createElement("div");
...@@ -733,31 +657,6 @@ function Create_Structures() ...@@ -733,31 +657,6 @@ function Create_Structures()
Set_Container(dim, path, 21); Set_Container(dim, path, 21);
/*var Cont = document.getElementById("Container");
Cont.style.display = "block";
while(Cont.firstChild)
Cont.removeChild(Cont.firstChild);
Cont.style.width = "80px";
Cont.style.height = "104px";
var WO_Degr = document.createElement("div");
WO_Degr.id = "id_WO_Degr";
WO_Degr.style["float"] = "left";
WO_Degr.style.backgroundImage = "url('Math/img/radical.png')";
WO_Degr.style.width = "80px";
WO_Degr.style.height = "104px";
WO_Degr.style.backgroundPosition = "0px 0px";
Cont.appendChild( WO_Degr );
WO_Degr.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(8);
MathRecalculate();
}*/
} }
var Integral = document.createElement("div"); var Integral = document.createElement("div");
...@@ -854,140 +753,6 @@ function Create_Structures() ...@@ -854,140 +753,6 @@ function Create_Structures()
path = "url('Math/img/nary_2.png')"; path = "url('Math/img/nary_2.png')";
Set_Container(dim, path, 82); Set_Container(dim, path, 82);
/*dim =
{
sizeContainer: {column: 4, row : 7 },
countEqt: 2,
widthEqt: 80,
heightEqt: 104
};
path = "url('Math/img/radical_equat.png')";
Set_Container(dim, path, 21);*/
//document.getElementById("Container").style.height = "208px";
/* var Cont = document.getElementById("Container");
Cont.style.display = "block";
while(Cont.firstChild)
Cont.removeChild(Cont.firstChild);
Cont.style.width = "320px";
Cont.style.height = "208px";
var SingleNary = document.createElement("div");
SingleNary.id = "id_SingleNary";
SingleNary.style["float"] = "left";
SingleNary.style.backgroundImage = "url('Math/img/nary.png')";
SingleNary.style.width = "80px";
SingleNary.style.height = "104px";
SingleNary.style.backgroundPosition = "0px 0px";
Cont.appendChild( SingleNary );
SingleNary.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(10);
MathRecalculate();
}
var UndOvrNary = document.createElement("div");
UndOvrNary.id = "id_UndOvrNary";
UndOvrNary.style["float"] = "left";
UndOvrNary.style.backgroundImage = "url('Math/img/nary.png')";
UndOvrNary.style.width = "80px";
UndOvrNary.style.height = "104px";
UndOvrNary.style.backgroundPosition = "240px 0px";
Cont.appendChild( UndOvrNary );
UndOvrNary.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(11);
MathRecalculate();
}
var UndNary = document.createElement("div");
UndNary.id = "id_UndNary";
UndNary.style["float"] = "left";
UndNary.style.backgroundImage = "url('Math/img/nary.png')";
UndNary.style.width = "80px";
UndNary.style.height = "104px";
UndNary.style.backgroundPosition = "160px 0px";
Cont.appendChild( UndNary );
UndNary.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(12);
MathRecalculate();
}
var OvrNary = document.createElement("div");
OvrNary.id = "id_OvrNary";
OvrNary.style["float"] = "left";
OvrNary.style.backgroundImage = "url('Math/img/nary.png')";
OvrNary.style.width = "80px";
OvrNary.style.height = "104px";
OvrNary.style.backgroundPosition = "80px 0px";
Cont.appendChild( OvrNary );
OvrNary.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(13);
MathRecalculate();
}
var SubNary = document.createElement("div");
SubNary.id = "id_SubNary";
SubNary.style["float"] = "left";
SubNary.style.backgroundImage = "url('Math/img/nary.png')";
SubNary.style.width = "80px";
SubNary.style.height = "104px";
SubNary.style.backgroundPosition = "0px 208px";
Cont.appendChild( SubNary );
SubNary.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(14);
MathRecalculate();
}
var SubNaryUp = document.createElement("div");
SubNaryUp.id = "id_SubNaryUp";
SubNaryUp.style["float"] = "left";
SubNaryUp.style.backgroundImage = "url('Math/img/nary.png')";
SubNaryUp.style.width = "80px";
SubNaryUp.style.height = "104px";
SubNaryUp.style.backgroundPosition = "240px 208px";
Cont.appendChild( SubNaryUp );
SubNaryUp.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(15);
MathRecalculate();
}
var SubNaryDown = document.createElement("div");
SubNaryDown.id = "id_SubNaryDown";
SubNaryDown.style["float"] = "left";
SubNaryDown.style.backgroundImage = "url('Math/img/nary.png')";
SubNaryDown.style.width = "80px";
SubNaryDown.style.height = "104px";
SubNaryDown.style.backgroundPosition = "160px 208px";
Cont.appendChild( SubNaryDown );
SubNaryDown.onmousedown = function()
{
document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(16);
MathRecalculate();
}*/
} }
...@@ -1480,7 +1245,8 @@ function Set_Container(dimension, path, index) ...@@ -1480,7 +1245,8 @@ function Set_Container(dimension, path, index)
return function() return function()
{ {
document.getElementById("Container").style.display = "none"; document.getElementById("Container").style.display = "none";
MathControl.AddMathComponent(index + _i*column + _j); // AddMathComponent -> CreateEquation
MathControl.CreateEquation(index + _i*column + _j);
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : { editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field, Left : X_Left_Field,
Right : X_Right_Field, Right : X_Right_Field,
......
...@@ -19,8 +19,11 @@ function CMathBase() ...@@ -19,8 +19,11 @@ function CMathBase()
this.Parent = null; this.Parent = null;
this.Composition = null; // ссылка на общую формулу this.Composition = null; // ссылка на общую формулу
this.textPrp = new CMathTextPrp(); // для рассчета размера расстояний this.TxtPrp = new CMathTextPrp();
this.RunPrp = new CMathTextPrp(); // запоминаем, если передаются спец. настройки для контента this.OwnTPrp = new CMathTextPrp();
//this.textPrp = new CMathTextPrp(); // для рассчета размера расстояний
//this.RunPrp = new CMathTextPrp(); // запоминаем, если передаются спец. настройки для контента
//todo //todo
//переделать //переделать
...@@ -53,9 +56,9 @@ CMathBase.prototype = ...@@ -53,9 +56,9 @@ CMathBase.prototype =
{ {
this.elements[i][j] = new CMathContent(); this.elements[i][j] = new CMathContent();
this.elements[i][j].relate(this); this.elements[i][j].relate(this);
//this.elements[i][j].setReduct(this.reduct);
this.elements[i][j].setComposition(this.Composition); this.elements[i][j].setComposition(this.Composition);
this.elements[i][j].setRunPrp(this.RunPrp); //this.elements[i][j].setReduct(this.reduct);
//this.elements[i][j].setRunPrp(this.RunPrp);
} }
} }
...@@ -75,7 +78,7 @@ CMathBase.prototype = ...@@ -75,7 +78,7 @@ CMathBase.prototype =
this.alignment.wdt[u] = CENTER; this.alignment.wdt[u] = CENTER;
}, },
getTxtPrp: function() old_getTxtPrp: function()
{ {
var txtPrp = new CMathTextPrp(); var txtPrp = new CMathTextPrp();
Common_CopyObj2(txtPrp, this.Composition.TxtPrp); Common_CopyObj2(txtPrp, this.Composition.TxtPrp);
...@@ -86,17 +89,20 @@ CMathBase.prototype = ...@@ -86,17 +89,20 @@ CMathBase.prototype =
return txtPrp; return txtPrp;
}, },
setTxtPrp: function()
{
this.TxtPrp = new CMathTextPrp();
this.TxtPrp.Merge(txtPrp);
this.TxtPrp.Merge(this.OwnTPrp);
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].setTxtPrp(TxtPrp);
},
getOwnTPrp: function() getOwnTPrp: function()
{ {
return this.textPrp; return this.textPrp;
}, },
/*getTxtPrp_2: function()
{
var txtPrp = this.getTxtPrp();
txtPrp.FontSize *= this.reduct;
return txtPrp;
},*/
setComposition: function(Compos) setComposition: function(Compos)
{ {
this.Composition = Compos; this.Composition = Compos;
...@@ -110,9 +116,9 @@ CMathBase.prototype = ...@@ -110,9 +116,9 @@ CMathBase.prototype =
}, },
getRunPrp: function() getRunPrp: function()
{ {
return this.textPrp; return this.TxtPrp;
}, },
setRunPrp: function(txtPrp) old_setRunPrp: function(txtPrp)
{ {
this.RunPrp.Merge(txtPrp); this.RunPrp.Merge(txtPrp);
this.setTxtPrp(txtPrp); this.setTxtPrp(txtPrp);
...@@ -158,7 +164,7 @@ CMathBase.prototype = ...@@ -158,7 +164,7 @@ CMathBase.prototype =
{ {
this.elements[i][j].setComposition(this.Composition); this.elements[i][j].setComposition(this.Composition);
//this.elements[i][j].setReduct(this.reduct); //this.elements[i][j].setReduct(this.reduct);
this.elements[i][j].setRunPrp(this.RunPrp); //this.elements[i][j].setRunPrp(this.RunPrp);
} }
this.elements[i][j].bMObjs = true; this.elements[i][j].bMObjs = true;
} }
...@@ -882,7 +888,7 @@ CMathBase.prototype = ...@@ -882,7 +888,7 @@ CMathBase.prototype =
{ {
return this.elements[x][y]; return this.elements[x][y];
}, },
setTxtPrp: function(txtPrp) old_setTxtPrp: function(txtPrp)
{ {
for(var i=0; i < this.nRow; i++) for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++) for(var j = 0; j < this.nCol; j++)
......
...@@ -34,7 +34,7 @@ CBorderBox.prototype.recalculateSize = function() ...@@ -34,7 +34,7 @@ CBorderBox.prototype.recalculateSize = function()
var height = ss.height; var height = ss.height;
var center = ss.center; var center = ss.center;
this.gapBrd = this.getTxtPrp().FontSize *0.08104587131076388; this.gapBrd = this.getTxtPrp().FontSize*0.08104587131076388;
if(this.bTop) if(this.bTop)
{ {
...@@ -49,7 +49,6 @@ CBorderBox.prototype.recalculateSize = function() ...@@ -49,7 +49,6 @@ CBorderBox.prototype.recalculateSize = function()
if(this.bRight) if(this.bRight)
width += this.gapBrd; width += this.gapBrd;
this.size = {width : width, height: height, center: center}; this.size = {width : width, height: height, center: center};
} }
CBorderBox.prototype.draw = function() CBorderBox.prototype.draw = function()
......
...@@ -80,9 +80,6 @@ CNumerator.prototype.recalculateSize = function() ...@@ -80,9 +80,6 @@ CNumerator.prototype.recalculateSize = function()
var arg = this.elements[0][0].size; var arg = this.elements[0][0].size;
var txtPrp = this.getTxtPrp(); var txtPrp = this.getTxtPrp();
/*var font = GetMathFont(txtPrp);
var plH = font.metrics.Placeholder.Height/2;*/
var Descent = arg.height - arg.ascent; // baseLine var Descent = arg.height - arg.ascent; // baseLine
var gap = 7.832769097222222 * txtPrp.FontSize/36, var gap = 7.832769097222222 * txtPrp.FontSize/36,
minGap = txtPrp.FontSize* 25.4/96 * 0.16; minGap = txtPrp.FontSize* 25.4/96 * 0.16;
...@@ -98,54 +95,6 @@ CNumerator.prototype.recalculateSize = function() ...@@ -98,54 +95,6 @@ CNumerator.prototype.recalculateSize = function()
this.size = {width : width, height: height, center: center}; this.size = {width : width, height: height, center: center};
} }
CNumerator.prototype.new_recalculateSize = function()
{
var arg = this.elements[0][0].size;
var metrics = this.params.font.metrics;
var penW = this.params.font.FontSize* 25.4/96 * 0.08;
var Descent = arg.height - arg.center - metrics.Placeholder.Height*DIV_CENTER; // baseLine
//var gap = metrics.Height - metrics.Placeholder.Height + metrics.Descender,
var gap = metrics.Descender + 2*penW *1.8,
minGap = 2*penW;
var delta = gap - Descent;
var GapNum = delta > minGap ? delta : minGap;
var width = arg.width;
var height = arg.height + GapNum;
var center = arg.center;
this.size = {width : width, height: height, center: center};
}
CNumerator.prototype.n_recalculateSize = function()
{
var arg = this.elements[0][0].size;
var metrics = this.params.font.metrics;
//var penW = this.params.font.FontSize* 25.4/96 * 0.08;
var DescentFirst = arg.height - arg.center - metrics.Placeholder.Height*DIV_CENTER; // baseLine
//var gap = metrics.Height - 2.8*metrics.Descender; // 8 pt
//var gap = metrics.Height - 1.5*metrics.Descender;
var gap = metrics.Height - (2.96 - 0.02*this.params.font.FontSize)*metrics.Descender;
var penW = this.params.font.FontSize/47;
// 20 7
// 60 21
var gapNum = DescentFirst - 2*penW < 0.55*gap ? 0.55*gap - DescentFirst : 2*penW;
var width = arg.width;
var height = arg.height + gapNum;
var center = arg.center;
this.size = {width : width, height: height, center: center};
}
CNumerator.prototype.findDisposition = function(mCoord) CNumerator.prototype.findDisposition = function(mCoord)
{ {
var arg = this.elements[0][0].size; var arg = this.elements[0][0].size;
...@@ -203,52 +152,6 @@ CDenominator.prototype.recalculateSize = function() ...@@ -203,52 +152,6 @@ CDenominator.prototype.recalculateSize = function()
this.size = {width : width, height: height, center: center}; this.size = {width : width, height: height, center: center};
} }
CDenominator.prototype.new_recalculateSize = function()
{
var arg = this.elements[0][0].size;
var metrics = this.params.font.metrics;
var gap = metrics.Height - metrics.Placeholder.Height - metrics.Descender,
Ascent = arg.center + metrics.Placeholder.Height*DIV_CENTER - metrics.Placeholder.Height,
minGap = this.params.font.FontSize* 25.4/96 * 0.24 * 1.23;
var delta = gap - Ascent;
var GapDen = delta > minGap ? delta : minGap;
var width = arg.width;
var height = arg.height + GapDen;
var center = arg.center + GapDen;
this.size = {width : width, height: height, center: center};
}
CDenominator.prototype.n_recalculateSize = function()
{
var arg = this.elements[0][0].size;
var metrics = this.params.font.metrics;
var AscentSecond = arg.center + metrics.Placeholder.Height*DIV_CENTER;
//var gap = metrics.Height - 2.8*metrics.Descender; // 8 pt
//var gap = metrics.Height - 1.5*metrics.Descender; // 72 pt
var gap = metrics.Height - (2.96 - 0.02*this.params.font.FontSize)*metrics.Descender;
// a*x + b = c
// a*8 + b = 2.8
// a*72 + b = 1.5
// a = - 1.3/64
// b = 2.96
var penW = this.params.font.FontSize/47;
var gapDen = AscentSecond - 3*penW < 0.45*gap ? 0.45*gap - AscentSecond : 3*penW;
var width = arg.width;
var height = arg.height + gapDen;
var center = arg.center + gapDen;
this.size = {width : width, height: height, center: center};
}
CDenominator.prototype.findDisposition = function(mCoord) CDenominator.prototype.findDisposition = function(mCoord)
{ {
var arg = this.elements[0][0].size; var arg = this.elements[0][0].size;
...@@ -283,7 +186,6 @@ CDenominator.prototype.getReduct = function() ...@@ -283,7 +186,6 @@ CDenominator.prototype.getReduct = function()
return this.Parent.getReduct(); return this.Parent.getReduct();
} }
////////// //////////
function CSkewedFraction() function CSkewedFraction()
......
...@@ -81,7 +81,10 @@ function CMathContent() ...@@ -81,7 +81,10 @@ function CMathContent()
this.CurPos = 0; this.CurPos = 0;
this.pos = {x:0, y:0}; this.pos = {x:0, y:0};
this.g_mContext = null; this.g_mContext = null;
this.textPrp = new CMathTextPrp();
this.TxtPrp = new CMathTextPrp();
this.OwnTPrp = new CMathTextPrp();
this.Composition = null; // ссылка на общую формулу this.Composition = null; // ссылка на общую формулу
this.reduct = 1; // индефикатор для степени (уменьшение размера шрифта) this.reduct = 1; // индефикатор для степени (уменьшение размера шрифта)
...@@ -115,7 +118,7 @@ CMathContent.prototype = ...@@ -115,7 +118,7 @@ CMathContent.prototype =
this.g_mContext = new dist(0,0,0,0); this.g_mContext = new dist(0,0,0,0);
this.content.push( new mathElem(new CEmpty(), new dist(0,0,0,0), 0) ); this.content.push( new mathElem(new CEmpty(), new dist(0,0,0,0), 0) );
}, },
ChangeTxtPrp: function(txtPrp) old_ChangeTxtPrp: function(txtPrp)
{ {
var start, end; var start, end;
if( this.selection.startPos != this.selection.endPos ) if( this.selection.startPos != this.selection.endPos )
...@@ -133,14 +136,47 @@ CMathContent.prototype = ...@@ -133,14 +136,47 @@ CMathContent.prototype =
for(var i = start; i < end; i++) for(var i = start; i < end; i++)
this.content[i].value.setTxtPrp(txtPrp); this.content[i].value.setTxtPrp(txtPrp);
}, },
setTxtPrp: function(txtPrp) // для всего контента, в случае, когда селект вышел за пределы контента, когда начинали селект + когда в коннтенте есть мат. элементы old_setTxtPrp: function(txtPrp) // для всего контента, в случае, когда селект вышел за пределы контента, когда начинали селект + когда в коннтенте есть мат. элементы
{ {
this.textPrp.Merge(txtPrp); this.textPrp.Merge(txtPrp);
for(var i = 0; i < this.content.length; i++) for(var i = 0; i < this.content.length; i++)
this.content[i].value.setTxtPrp(txtPrp); this.content[i].value.setTxtPrp(txtPrp);
}, },
setRunPrp: function(txtPrp) setTxtPrp: function(txtPrp, start, end) //parent properties
{
this.TxtPrp = new CMathTextPrp();
this.TxtPrp.Merge(txtPrp);
this.TxtPrp.Merge(this.OwnTPrp);
for(var i = start; i < end; i++)
this.content[i].value.setTxtPrp(this.TxtPrp);
},
changeTxtPrp: function(txtPrp, bAll)
{
var start, end;
if( this.selection.startPos != this.selection.endPos )
{
start = this.selection.startPos;
end = this.selection.endPos;
if(start > end)
{
tmp = start;
start = end;
end = tmp;
}
}
if(bAll)
this.setTxtPrp(txtPrp, 0, this.content.length);
else
this.setTxtPrp(txtPrp, start, end);
},
setOwnTPrp: function(txtPrp)
{
this.OwnTPrp.Merge(txtPrp);
},
old_setRunPrp: function(txtPrp)
{ {
this.setTxtPrp(txtPrp); this.setTxtPrp(txtPrp);
}, },
...@@ -167,7 +203,7 @@ CMathContent.prototype = ...@@ -167,7 +203,7 @@ CMathContent.prototype =
} }
else else
{ {
runPrp.Merge(this.textPrp); runPrp.Merge(this.TxtPrp);
} }
return runPrp; return runPrp;
...@@ -304,17 +340,16 @@ CMathContent.prototype = ...@@ -304,17 +340,16 @@ CMathContent.prototype =
var symb = new CMathText(); var symb = new CMathText();
symb.relate(this); symb.relate(this);
symb.add(code); symb.add(code);
symb.setTxtPrp( this.getRunPrp(this.CurPos) ); var runPrp = this.getRunPrp(this.CurPos);
symb.setTxtPrp( runPrp );
// txt properties // txt properties
this.addElementToContent(symb, gps); this.addElementToContent(symb, gps);
this.rInterval.endPos++; // max количество элементов this.CurPos this.rInterval.endPos++; // max количество элементов this.CurPos
}, },
createMComponent: function(ind) addMComponent: function(ind)
{ {
var l_gap = 0, r_gap = 0; var l_gap = 0, r_gap = 0;
var mathElem = null; //положение этого элемента будет this.CurPos + 1 var mathElem = null; //положение этого элемента будет this.CurPos + 1
...@@ -401,7 +436,8 @@ CMathContent.prototype = ...@@ -401,7 +436,8 @@ CMathContent.prototype =
mathElem.setComposition(this.Composition); mathElem.setComposition(this.Composition);
mathElem.setReduct(this.reduct); mathElem.setReduct(this.reduct);
var runPrp = this.getRunPrp(this.CurPos); var runPrp = this.getRunPrp(this.CurPos);
mathElem.setRunPrp( runPrp ); mathElem.setTxtPrp( runPrp );
//mathElem.setRunPrp( runPrp );
//l_gap = r_gap = Math.floor( this.font.FontSize / 5 )*g_dKoef_pix_to_mm; //l_gap = r_gap = Math.floor( this.font.FontSize / 5 )*g_dKoef_pix_to_mm;
this.addElementToContent( mathElem, new dist(l_gap, r_gap, 0, 0) ); this.addElementToContent( mathElem, new dist(l_gap, r_gap, 0, 0) );
...@@ -429,25 +465,25 @@ CMathContent.prototype = ...@@ -429,25 +465,25 @@ CMathContent.prototype =
this.setStart_Selection(this.CurPos); this.setStart_Selection(this.CurPos);
this.selection.active = false; this.selection.active = false;
}, },
addEquation: function(ind) createEquation: function(ind)
{ {
switch(ind) switch(ind)
{ {
case 0: case 0:
case 1: case 1:
case 2: case 2:
var fract = this.createMComponent(ind); var fract = this.addMComponent(ind);
fract.init(); fract.init();
fract.fillPlaceholders(); fract.fillPlaceholders();
break; break;
case 3: case 3:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
fract.fillPlaceholders(); fract.fillPlaceholders();
fract.setSimple(true); fract.setSimple(true);
break; break;
case 4: case 4:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("dy"); num.addTxt("dy");
...@@ -455,7 +491,7 @@ CMathContent.prototype = ...@@ -455,7 +491,7 @@ CMathContent.prototype =
den.addTxt("dx"); den.addTxt("dx");
break; break;
case 5: case 5:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("Δy"); num.addTxt("Δy");
...@@ -463,7 +499,7 @@ CMathContent.prototype = ...@@ -463,7 +499,7 @@ CMathContent.prototype =
den.addTxt("Δx"); den.addTxt("Δx");
break; break;
case 6: case 6:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("∂y"); num.addTxt("∂y");
...@@ -471,7 +507,7 @@ CMathContent.prototype = ...@@ -471,7 +507,7 @@ CMathContent.prototype =
den.addTxt("∂x"); den.addTxt("∂x");
break; break;
case 7: case 7:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("δy"); num.addTxt("δy");
...@@ -479,7 +515,7 @@ CMathContent.prototype = ...@@ -479,7 +515,7 @@ CMathContent.prototype =
den.addTxt("δx"); den.addTxt("δx");
break; break;
case 8: case 8:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("π"); num.addTxt("π");
...@@ -487,36 +523,36 @@ CMathContent.prototype = ...@@ -487,36 +523,36 @@ CMathContent.prototype =
den.addTxt("2"); den.addTxt("2");
break; break;
case 9: case 9:
var degr = this.createMComponent(3); var degr = this.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
degr.fillPlaceholders(); degr.fillPlaceholders();
break; break;
case 10: case 10:
var degr = this.createMComponent(3); var degr = this.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(-1); degr.setIndex(-1);
degr.fillPlaceholders(); degr.fillPlaceholders();
break; break;
case 11: case 11:
var degrSupSup = this.createMComponent(4); var degrSupSup = this.addMComponent(4);
degrSupSup.init(); degrSupSup.init();
degrSupSup.fillPlaceholders(); degrSupSup.fillPlaceholders();
break; break;
case 12: case 12:
var degrSupSup = this.createMComponent(5); var degrSupSup = this.addMComponent(5);
degrSupSup.init(); degrSupSup.init();
degrSupSup.fillPlaceholders(); degrSupSup.fillPlaceholders();
break; break;
case 13: case 13:
var degr = this.createMComponent(3); var degr = this.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(-1); degr.setIndex(-1);
var base = degr.getBase(); var base = degr.getBase();
base.addTxt("x"); base.addTxt("x");
var iter = degr.getIterator(); var iter = degr.getIterator();
var degr2 = iter.createMComponent(3); var degr2 = iter.addMComponent(3);
degr2.init(); degr2.init();
degr2.setIndex(1); degr2.setIndex(1);
var base2 = degr2.getBase(); var base2 = degr2.getBase();
...@@ -526,7 +562,7 @@ CMathContent.prototype = ...@@ -526,7 +562,7 @@ CMathContent.prototype =
break; break;
case 14: case 14:
var degr = this.createMComponent(3); var degr = this.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -535,7 +571,7 @@ CMathContent.prototype = ...@@ -535,7 +571,7 @@ CMathContent.prototype =
iter.addTxt("-iωt"); iter.addTxt("-iωt");
break; break;
case 15: case 15:
var degr = this.createMComponent(3); var degr = this.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -544,7 +580,7 @@ CMathContent.prototype = ...@@ -544,7 +580,7 @@ CMathContent.prototype =
iter.addTxt("2"); iter.addTxt("2");
break; break;
case 16: case 16:
var degr = this.createMComponent(5); var degr = this.addMComponent(5);
degr.init(); degr.init();
var base = degr.getBase(); var base = degr.getBase();
base.addTxt("Y"); base.addTxt("Y");
...@@ -554,17 +590,17 @@ CMathContent.prototype = ...@@ -554,17 +590,17 @@ CMathContent.prototype =
iter2.addTxt("1"); iter2.addTxt("1");
break; break;
case 17: case 17:
var rad = this.createMComponent(6); var rad = this.addMComponent(6);
rad.init(); rad.init();
rad.fillPlaceholders(); rad.fillPlaceholders();
break; break;
case 18: case 18:
var rad = this.createMComponent(7); var rad = this.addMComponent(7);
rad.init(); rad.init();
rad.fillPlaceholders(); rad.fillPlaceholders();
break; break;
case 19: case 19:
var rad = this.createMComponent(7); var rad = this.addMComponent(7);
rad.init(); rad.init();
degr = rad.getDegree(); degr = rad.getDegree();
degr.addTxt("2"); degr.addTxt("2");
...@@ -572,7 +608,7 @@ CMathContent.prototype = ...@@ -572,7 +608,7 @@ CMathContent.prototype =
base.fillPlaceholders(); base.fillPlaceholders();
break; break;
case 20: case 20:
var rad = this.createMComponent(7); var rad = this.addMComponent(7);
rad.init(); rad.init();
degr = rad.getDegree(); degr = rad.getDegree();
degr.addTxt("3"); degr.addTxt("3");
...@@ -580,15 +616,15 @@ CMathContent.prototype = ...@@ -580,15 +616,15 @@ CMathContent.prototype =
base.fillPlaceholders(); base.fillPlaceholders();
break; break;
case 21: case 21:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("-b±"); num.addTxt("-b±");
var rad = num.createMComponent(6); var rad = num.addMComponent(6);
rad.init(); rad.init();
var base = rad.getBase(); var base = rad.getBase();
var degree = base.createMComponent(3); var degree = base.addMComponent(3);
degree.init(); degree.init();
degree.setIndex(1); degree.setIndex(1);
var baseDg = degree.getBase(); var baseDg = degree.getBase();
...@@ -601,11 +637,11 @@ CMathContent.prototype = ...@@ -601,11 +637,11 @@ CMathContent.prototype =
den.addTxt("2a"); den.addTxt("2a");
break; break;
case 22: case 22:
var rad = this.createMComponent(6); var rad = this.addMComponent(6);
rad.init(); rad.init();
var base = rad.getBase(); var base = rad.getBase();
degr1 = base.createMComponent(3); degr1 = base.addMComponent(3);
degr1.init(); degr1.init();
degr1.setIndex(1); degr1.setIndex(1);
var base1 = degr1.getBase(); var base1 = degr1.getBase();
...@@ -615,7 +651,7 @@ CMathContent.prototype = ...@@ -615,7 +651,7 @@ CMathContent.prototype =
base.addTxt("+"); base.addTxt("+");
degr2 = base.createMComponent(3); degr2 = base.addMComponent(3);
degr2.init(); degr2.init();
degr2.setIndex(1); degr2.setIndex(1);
var base2 = degr2.getBase(); var base2 = degr2.getBase();
...@@ -625,305 +661,305 @@ CMathContent.prototype = ...@@ -625,305 +661,305 @@ CMathContent.prototype =
break; break;
case 23: case 23:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(0,0,0); integr.init(0,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 24: case 24:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(0,1,3); integr.init(0,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 25: case 25:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(0,0,3); integr.init(0,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 26: case 26:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(1,0,0); integr.init(1,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 27: case 27:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(1,1,3); integr.init(1,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 28: case 28:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(1,0,3); integr.init(1,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 29: case 29:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(2,0,0); integr.init(2,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 30: case 30:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(2,1,3); integr.init(2,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 31: case 31:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(2,0,3); integr.init(2,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 32: case 32:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(3,0,0); integr.init(3,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 33: case 33:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(3,1,3); integr.init(3,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 34: case 34:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(3,0,3); integr.init(3,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 35: case 35:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(4,0,0); integr.init(4,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 36: case 36:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(4,1,3); integr.init(4,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 37: case 37:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(4,0,3); integr.init(4,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 38: case 38:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(5,0,0); integr.init(5,0,0);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 39: case 39:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(5,1,3); integr.init(5,1,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 40: case 40:
var integr = this.createMComponent(8); var integr = this.addMComponent(8);
integr.init(5,0,3); integr.init(5,0,3);
integr.fillPlaceholders(); integr.fillPlaceholders();
break; break;
case 41: case 41:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var elem = base.getElement(0,0); var elem = base.getElement(0,0);
elem.addTxt("dx"); elem.addTxt("dx");
break; break;
case 42: case 42:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var elem = base.getElement(0,0); var elem = base.getElement(0,0);
elem.addTxt("dy"); elem.addTxt("dy");
break; break;
case 43: case 43:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var elem = base.getElement(0,0); var elem = base.getElement(0,0);
elem.addTxt(""); elem.addTxt("");
break; break;
case 44: case 44:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,0,0); sigma.init(6,0,0);
sigma.fillPlaceholders(); sigma.fillPlaceholders();
break; break;
case 45: case 45:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,0,3); sigma.init(6,0,3);
sigma.fillPlaceholders(); sigma.fillPlaceholders();
break; break;
case 46: case 46:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,1,3); sigma.init(6,1,3);
sigma.fillPlaceholders(); sigma.fillPlaceholders();
break; break;
case 47: case 47:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,0,2); sigma.init(6,0,2);
sigma.fillPlaceholders(); sigma.fillPlaceholders();
break; break;
case 48: case 48:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,1,2); sigma.init(6,1,2);
sigma.fillPlaceholders(); sigma.fillPlaceholders();
break; break;
case 49: case 49:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,0,0); product.init(7,0,0);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 50: case 50:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,0,3); product.init(7,0,3);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 51: case 51:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,1,3); product.init(7,1,3);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 52: case 52:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,0,2); product.init(7,0,2);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 53: case 53:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,1,2); product.init(7,1,2);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 54: case 54:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(8,0,0); product.init(8,0,0);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 55: case 55:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(8,0,3); product.init(8,0,3);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 56: case 56:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(8,1,3); product.init(8,1,3);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 57: case 57:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(8,0,2); product.init(8,0,2);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 58: case 58:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(8,1,2); product.init(8,1,2);
product.fillPlaceholders(); product.fillPlaceholders();
break; break;
case 59: case 59:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,0,0); union.init(9,0,0);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 60: case 60:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,0,3); union.init(9,0,3);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 61: case 61:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,1,3); union.init(9,1,3);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 62: case 62:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,0,2); union.init(9,0,2);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 63: case 63:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,1,2); union.init(9,1,2);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 64: case 64:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(10,0,0); union.init(10,0,0);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 65: case 65:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(10,0,3); union.init(10,0,3);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 66: case 66:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(10,1,3); union.init(10,1,3);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 67: case 67:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(10,0,2); union.init(10,0,2);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 68: case 68:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(10,1,2); union.init(10,1,2);
union.fillPlaceholders(); union.fillPlaceholders();
break; break;
case 69: case 69:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(11,0,0); logicalOr.init(11,0,0);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 70: case 70:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(11,0,3); logicalOr.init(11,0,3);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 71: case 71:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(11,1,3); logicalOr.init(11,1,3);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 72: case 72:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(11,0,2); logicalOr.init(11,0,2);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 73: case 73:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(11,1,2); logicalOr.init(11,1,2);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 74: case 74:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(12,0,0); logicalOr.init(12,0,0);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 75: case 75:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(12,0,3); logicalOr.init(12,0,3);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 76: case 76:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(12,1,3); logicalOr.init(12,1,3);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 77: case 77:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(12,0,2); logicalOr.init(12,0,2);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 78: case 78:
var logicalOr = this.createMComponent(8); var logicalOr = this.addMComponent(8);
logicalOr.init(12,1,2); logicalOr.init(12,1,2);
logicalOr.fillPlaceholders(); logicalOr.fillPlaceholders();
break; break;
case 79: case 79:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,0,2); sigma.init(6,0,2);
var iter = sigma.getLowerIterator(); var iter = sigma.getLowerIterator();
iter.addTxt("k"); iter.addTxt("k");
var delim = sigma.getBase().createMComponent(9); var delim = sigma.getBase().addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
var fract = delim.getBase().createMComponent(0); var fract = delim.getBase().addMComponent(0);
fract.init(); fract.init();
fract.hideBar(true); fract.hideBar(true);
var num = fract.getNumerator(); var num = fract.getNumerator();
...@@ -933,7 +969,7 @@ CMathContent.prototype = ...@@ -933,7 +969,7 @@ CMathContent.prototype =
break; break;
case 80: case 80:
var sigma = this.createMComponent(8); var sigma = this.addMComponent(8);
sigma.init(6,0,3); sigma.init(6,0,3);
var iterUp = sigma.getUpperIterator(); var iterUp = sigma.getUpperIterator();
iterUp.addTxt("n"); iterUp.addTxt("n");
...@@ -943,14 +979,14 @@ CMathContent.prototype = ...@@ -943,14 +979,14 @@ CMathContent.prototype =
base.fillPlaceholders(); base.fillPlaceholders();
break; break;
case 81: case 81:
var product = this.createMComponent(8); var product = this.addMComponent(8);
product.init(7,0,3); product.init(7,0,3);
var iterUp = product.getUpperIterator(); var iterUp = product.getUpperIterator();
iterUp.addTxt("n"); iterUp.addTxt("n");
var iterLow = product.getLowerIterator(); var iterLow = product.getLowerIterator();
iterLow.addTxt("k=1"); iterLow.addTxt("k=1");
var base = product.getBase(); var base = product.getBase();
var degr = base.createMComponent(3); var degr = base.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(-1); degr.setIndex(-1);
var baseDgr = degr.getBase(); var baseDgr = degr.getBase();
...@@ -961,7 +997,7 @@ CMathContent.prototype = ...@@ -961,7 +997,7 @@ CMathContent.prototype =
case 82: case 82:
break; break;
case 83: case 83:
var union = this.createMComponent(8); var union = this.addMComponent(8);
union.init(9,0,3); union.init(9,0,3);
var iterUp = union.getUpperIterator(); var iterUp = union.getUpperIterator();
...@@ -970,11 +1006,11 @@ CMathContent.prototype = ...@@ -970,11 +1006,11 @@ CMathContent.prototype =
iterLow.addTxt("n=1"); iterLow.addTxt("n=1");
var base = union.getBase(); var base = union.getBase();
var delim = base.createMComponent(9); var delim = base.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
var base2 = delim.getBase(); var base2 = delim.getBase();
var degrX = base2.createMComponent(3); var degrX = base2.addMComponent(3);
degrX.init(); degrX.init();
degrX.setIndex(-1); degrX.setIndex(-1);
...@@ -985,7 +1021,7 @@ CMathContent.prototype = ...@@ -985,7 +1021,7 @@ CMathContent.prototype =
base2.addTxt(""); base2.addTxt("");
var degrY = base2.createMComponent(3); var degrY = base2.addMComponent(3);
degrY.init(); degrY.init();
degrY.setIndex(-1); degrY.setIndex(-1);
...@@ -996,201 +1032,201 @@ CMathContent.prototype = ...@@ -996,201 +1032,201 @@ CMathContent.prototype =
break; break;
case 84: case 84:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 85: case 85:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 0, 1); delim.init(2, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 86: case 86:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1, 4, 0, 1); delim.init(1, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 87: case 87:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(3, 4, 0, 1); delim.init(3, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 88: case 88:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4, 4, 0, 1); delim.init(4, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 89: case 89:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4, 4, 2, 3); delim.init(4, 4, 2, 3);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 90: case 90:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(5, 4, 0, 1); delim.init(5, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 91: case 91:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(6, 4, 0, 1); delim.init(6, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 92: case 92:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 0, 0); delim.init(2, 4, 0, 0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 93: case 93:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 1, 1); delim.init(2, 4, 1, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 94: case 94:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 1, 0); delim.init(2, 4, 1, 0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 95: case 95:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(7, 4, 0, 1); delim.init(7, 4, 0, 1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 96: case 96:
var delim = this.createMComponent(10); var delim = this.addMComponent(10);
delim.init(0, 2); delim.init(0, 2);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 97: case 97:
var delim = this.createMComponent(10); var delim = this.addMComponent(10);
delim.init(1, 2); delim.init(1, 2);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 98: case 98:
var delim = this.createMComponent(10); var delim = this.addMComponent(10);
delim.init(3, 2); delim.init(3, 2);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 99: case 99:
var delim = this.createMComponent(10); var delim = this.addMComponent(10);
delim.init(3, 3); delim.init(3, 3);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 100: case 100:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0,2,0); delim.init(0,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 101: case 101:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0,3,1); delim.init(0,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 102: case 102:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2,2,0); delim.init(2,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 103: case 103:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2,3,1); delim.init(2,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 104: case 104:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,2,0); delim.init(1,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 105: case 105:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,3,1); delim.init(1,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 106: case 106:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(3,2,0); delim.init(3,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 107: case 107:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(3,3,1); delim.init(3,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 108: case 108:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4,2,0); delim.init(4,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 109: case 109:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4,3,1); delim.init(4,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 110: case 110:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4,2,2); delim.init(4,2,2);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 111: case 111:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(4,3,3); delim.init(4,3,3);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 112: case 112:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(5,2,0); delim.init(5,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 113: case 113:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(5,3,1); delim.init(5,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 114: case 114:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(6,2,0); delim.init(6,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 115: case 115:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(6,3,1); delim.init(6,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 116: case 116:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(7,2,0); delim.init(7,2,0);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 117: case 117:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(7,3,1); delim.init(7,3,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 118: case 118:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,2,0); delim.init(1,2,0);
var base = delim.getBase(); var base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(2, 1); matrix.init(2, 1);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 119: case 119:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,2,0); delim.init(1,2,0);
var base = delim.getBase(); var base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(3, 1); matrix.init(3, 1);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 120: case 120:
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
fract.hideBar(true); fract.hideBar(true);
fract.fillPlaceholders(); fract.fillPlaceholders();
break; break;
case 121: case 121:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
var fract = delim.getBase().createMComponent(0); var fract = delim.getBase().addMComponent(0);
fract.init(); fract.init();
fract.hideBar(true); fract.hideBar(true);
fract.fillPlaceholders(); fract.fillPlaceholders();
...@@ -1198,9 +1234,9 @@ CMathContent.prototype = ...@@ -1198,9 +1234,9 @@ CMathContent.prototype =
case 122: case 122:
break; break;
case 123: case 123:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
var fract = delim.getBase().createMComponent(0); var fract = delim.getBase().addMComponent(0);
fract.init(); fract.init();
fract.hideBar(true); fract.hideBar(true);
var num = fract.getNumerator(); var num = fract.getNumerator();
...@@ -1210,9 +1246,9 @@ CMathContent.prototype = ...@@ -1210,9 +1246,9 @@ CMathContent.prototype =
den.addTxt("k"); den.addTxt("k");
break; break;
case 124: case 124:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(3, 4, 0, 1); delim.init(3, 4, 0, 1);
var fract = delim.getBase().createMComponent(0); var fract = delim.getBase().addMComponent(0);
fract.init(); fract.init();
fract.hideBar(true); fract.hideBar(true);
var num = fract.getNumerator(); var num = fract.getNumerator();
...@@ -1222,7 +1258,7 @@ CMathContent.prototype = ...@@ -1222,7 +1258,7 @@ CMathContent.prototype =
den.addTxt("k"); den.addTxt("k");
break; break;
case 125: case 125:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("sin"); func.addTxt("sin");
...@@ -1230,7 +1266,7 @@ CMathContent.prototype = ...@@ -1230,7 +1266,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 126: case 126:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("cos"); func.addTxt("cos");
...@@ -1238,7 +1274,7 @@ CMathContent.prototype = ...@@ -1238,7 +1274,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 127: case 127:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("tan"); func.addTxt("tan");
...@@ -1246,7 +1282,7 @@ CMathContent.prototype = ...@@ -1246,7 +1282,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 128: case 128:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("csc"); func.addTxt("csc");
...@@ -1254,7 +1290,7 @@ CMathContent.prototype = ...@@ -1254,7 +1290,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 129: case 129:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("sec"); func.addTxt("sec");
...@@ -1262,7 +1298,7 @@ CMathContent.prototype = ...@@ -1262,7 +1298,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 130: case 130:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("cot"); func.addTxt("cot");
...@@ -1271,10 +1307,10 @@ CMathContent.prototype = ...@@ -1271,10 +1307,10 @@ CMathContent.prototype =
break; break;
case 131: case 131:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1286,10 +1322,10 @@ CMathContent.prototype = ...@@ -1286,10 +1322,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 132: case 132:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1301,10 +1337,10 @@ CMathContent.prototype = ...@@ -1301,10 +1337,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 133: case 133:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1316,10 +1352,10 @@ CMathContent.prototype = ...@@ -1316,10 +1352,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 134: case 134:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1331,10 +1367,10 @@ CMathContent.prototype = ...@@ -1331,10 +1367,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 135: case 135:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1346,10 +1382,10 @@ CMathContent.prototype = ...@@ -1346,10 +1382,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 136: case 136:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1363,7 +1399,7 @@ CMathContent.prototype = ...@@ -1363,7 +1399,7 @@ CMathContent.prototype =
case 137: case 137:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("sinh"); func.addTxt("sinh");
...@@ -1371,7 +1407,7 @@ CMathContent.prototype = ...@@ -1371,7 +1407,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 138: case 138:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("cosh"); func.addTxt("cosh");
...@@ -1379,7 +1415,7 @@ CMathContent.prototype = ...@@ -1379,7 +1415,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 139: case 139:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("tanh"); func.addTxt("tanh");
...@@ -1387,7 +1423,7 @@ CMathContent.prototype = ...@@ -1387,7 +1423,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 140: case 140:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("csch"); func.addTxt("csch");
...@@ -1395,7 +1431,7 @@ CMathContent.prototype = ...@@ -1395,7 +1431,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 141: case 141:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("sech"); func.addTxt("sech");
...@@ -1403,7 +1439,7 @@ CMathContent.prototype = ...@@ -1403,7 +1439,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 142: case 142:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("coth"); func.addTxt("coth");
...@@ -1412,10 +1448,10 @@ CMathContent.prototype = ...@@ -1412,10 +1448,10 @@ CMathContent.prototype =
break; break;
case 143: case 143:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1427,10 +1463,10 @@ CMathContent.prototype = ...@@ -1427,10 +1463,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 144: case 144:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1442,10 +1478,10 @@ CMathContent.prototype = ...@@ -1442,10 +1478,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 145: case 145:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1457,10 +1493,10 @@ CMathContent.prototype = ...@@ -1457,10 +1493,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 146: case 146:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1472,10 +1508,10 @@ CMathContent.prototype = ...@@ -1472,10 +1508,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 147: case 147:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1487,10 +1523,10 @@ CMathContent.prototype = ...@@ -1487,10 +1523,10 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 148: case 148:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
var degr = func.createMComponent(3); var degr = func.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1502,7 +1538,7 @@ CMathContent.prototype = ...@@ -1502,7 +1538,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 149: case 149:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("sin"); func.addTxt("sin");
...@@ -1510,7 +1546,7 @@ CMathContent.prototype = ...@@ -1510,7 +1546,7 @@ CMathContent.prototype =
arg.addTxt("θ"); arg.addTxt("θ");
break; break;
case 150: case 150:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("cos"); func.addTxt("cos");
...@@ -1518,129 +1554,129 @@ CMathContent.prototype = ...@@ -1518,129 +1554,129 @@ CMathContent.prototype =
arg.addTxt("2x"); arg.addTxt("2x");
break; break;
case 151: case 151:
var trig = this.createMComponent(11); var trig = this.addMComponent(11);
trig.init(); trig.init();
var func = trig.getFunction(); var func = trig.getFunction();
func.addTxt("tan"); func.addTxt("tan");
var arg = trig.getArgument(); var arg = trig.getArgument();
arg.addTxt("θ"); arg.addTxt("θ");
this.addTxt("="); this.addTxt("=");
var fract = this.createMComponent(0); var fract = this.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
var sin = num.createMComponent(11); var sin = num.addMComponent(11);
sin.init(); sin.init();
sin.getFunction().addTxt("sin"); sin.getFunction().addTxt("sin");
sin.getArgument().addTxt("θ"); sin.getArgument().addTxt("θ");
var den = fract.getDenominator(); var den = fract.getDenominator();
var cos = den.createMComponent(11); var cos = den.addMComponent(11);
cos.init(); cos.init();
cos.getFunction().addTxt("cos"); cos.getFunction().addTxt("cos");
cos.getArgument().addTxt("θ"); cos.getArgument().addTxt("θ");
break; break;
case 152: case 152:
var diac = this.createMComponent(15); var diac = this.addMComponent(15);
diac.init(3); diac.init(3);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 153: case 153:
var diac = this.createMComponent(15); var diac = this.addMComponent(15);
diac.init(4); diac.init(4);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 154: case 154:
var diac = this.createMComponent(15); var diac = this.addMComponent(15);
diac.init(5); diac.init(5);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 155: case 155:
var diac = this.createMComponent(12); var diac = this.addMComponent(12);
diac.init(); diac.init();
diac.setIndex(-1); diac.setIndex(-1);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 156: case 156:
var diac = this.createMComponent(12); var diac = this.addMComponent(12);
diac.init(); diac.init();
diac.setIndex(1); diac.setIndex(1);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 157: case 157:
var diac = this.createMComponent(15); var diac = this.addMComponent(15);
diac.init(2); diac.init(2);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 158: case 158:
var diac = this.createMComponent(15); var diac = this.addMComponent(15);
diac.init(1); diac.init(1);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 159: case 159:
var diac = this.createMComponent(13); var diac = this.addMComponent(13);
diac.init(); diac.init();
diac.setIndex(1); diac.setIndex(1);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 160: case 160:
var diac = this.createMComponent(13); var diac = this.addMComponent(13);
diac.init(); diac.init();
diac.setIndex(2); diac.setIndex(2);
diac.fillPlaceholders(); diac.fillPlaceholders();
break; break;
case 161: case 161:
var line = this.createMComponent(14); var line = this.addMComponent(14);
line.init(); line.init();
line.setIndex(1); line.setIndex(1);
line.fillPlaceholders(); line.fillPlaceholders();
break; break;
case 162: case 162:
var line = this.createMComponent(14); var line = this.addMComponent(14);
line.init(); line.init();
line.setIndex(2); line.setIndex(2);
line.fillPlaceholders(); line.fillPlaceholders();
break; break;
case 163: case 163:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,0,1); delim.init(1,0,1);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 164: case 164:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(1,1,2); delim.init(1,1,2);
delim.fillPlaceholders(); delim.fillPlaceholders();
break; break;
case 165: case 165:
var groupDelim = this.createMComponent(16); var groupDelim = this.addMComponent(16);
groupDelim.init(1); groupDelim.init(1);
groupDelim.fillPlaceholders(); groupDelim.fillPlaceholders();
break; break;
case 166: case 166:
var groupDelim = this.createMComponent(16); var groupDelim = this.addMComponent(16);
groupDelim.init(-1); groupDelim.init(-1);
groupDelim.fillPlaceholders(); groupDelim.fillPlaceholders();
break; break;
case 167: case 167:
var arrow = this.createMComponent(17); var arrow = this.addMComponent(17);
arrow.init(1, 0, 0); // left arrow top arrow.init(1, 0, 0); // left arrow top
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 168: case 168:
var arrow = this.createMComponent(17); var arrow = this.addMComponent(17);
arrow.init(1, 0, 1); // right arrow top arrow.init(1, 0, 1); // right arrow top
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 169: case 169:
var arrow = this.createMComponent(17); var arrow = this.addMComponent(17);
arrow.init(2, 0, 0); arrow.init(2, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 170: case 170:
var arrow = this.createMComponent(17); var arrow = this.addMComponent(17);
arrow.init(0, 0, 0); arrow.init(0, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 171: case 171:
var arrow = this.createMComponent(17); var arrow = this.addMComponent(17);
arrow.init(0, 0, 1); arrow.init(0, 0, 1);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
...@@ -1649,16 +1685,16 @@ CMathContent.prototype = ...@@ -1649,16 +1685,16 @@ CMathContent.prototype =
case 173: case 173:
break; break;
case 174: case 174:
var box = this.createMComponent(18); var box = this.addMComponent(18);
box.init(); box.init();
box.fillPlaceholders(); box.fillPlaceholders();
break; break;
case 175: case 175:
var box = this.createMComponent(18); var box = this.addMComponent(18);
box.init(); box.init();
var arg = box.getElement(); var arg = box.getElement();
var degrA = arg.createMComponent(3); var degrA = arg.addMComponent(3);
degrA.init(); degrA.init();
degrA.setIndex(1); degrA.setIndex(1);
var baseA = degrA.getBase(); var baseA = degrA.getBase();
...@@ -1668,7 +1704,7 @@ CMathContent.prototype = ...@@ -1668,7 +1704,7 @@ CMathContent.prototype =
arg.addTxt("="); arg.addTxt("=");
var degrB = arg.createMComponent(3); var degrB = arg.addMComponent(3);
degrB.init(); degrB.init();
degrB.setIndex(1); degrB.setIndex(1);
var baseB = degrB.getBase(); var baseB = degrB.getBase();
...@@ -1678,7 +1714,7 @@ CMathContent.prototype = ...@@ -1678,7 +1714,7 @@ CMathContent.prototype =
arg.addTxt("+"); arg.addTxt("+");
var degrC = arg.createMComponent(3); var degrC = arg.addMComponent(3);
degrC.init(); degrC.init();
degrC.setIndex(1); degrC.setIndex(1);
var baseC = degrC.getBase(); var baseC = degrC.getBase();
...@@ -1692,11 +1728,11 @@ CMathContent.prototype = ...@@ -1692,11 +1728,11 @@ CMathContent.prototype =
case 177: case 177:
break; break;
case 178: case 178:
var struct = this.createMComponent(22); // logaithm var struct = this.addMComponent(22); // logaithm
struct.setDimension(1,2); struct.setDimension(1,2);
struct.setContent(); struct.setContent();
var first = struct.getElement(0,0); var first = struct.getElement(0,0);
var degr = first.createMComponent(3); var degr = first.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(-1); degr.setIndex(-1);
var base = degr.getBase(); var base = degr.getBase();
...@@ -1709,7 +1745,7 @@ CMathContent.prototype = ...@@ -1709,7 +1745,7 @@ CMathContent.prototype =
second.fillPlaceholders(); second.fillPlaceholders();
break; break;
case 179: case 179:
var log = this.createMComponent(11); // logaithm var log = this.addMComponent(11); // logaithm
log.init(); log.init();
var func = log.getFunction(); var func = log.getFunction();
func.addTxt("log"); func.addTxt("log");
...@@ -1717,7 +1753,7 @@ CMathContent.prototype = ...@@ -1717,7 +1753,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 180: case 180:
var minimax = this.createMComponent(19); var minimax = this.addMComponent(19);
minimax.init(); minimax.init();
var base = minimax.getFunction(); var base = minimax.getFunction();
base.addTxt("lim"); base.addTxt("lim");
...@@ -1727,7 +1763,7 @@ CMathContent.prototype = ...@@ -1727,7 +1763,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 181: case 181:
var minimax = this.createMComponent(19); var minimax = this.addMComponent(19);
minimax.init(); minimax.init();
var base = minimax.getFunction(); var base = minimax.getFunction();
base.addTxt("min"); base.addTxt("min");
...@@ -1737,7 +1773,7 @@ CMathContent.prototype = ...@@ -1737,7 +1773,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 182: case 182:
var minimax = this.createMComponent(19); var minimax = this.addMComponent(19);
minimax.init(); minimax.init();
var base = minimax.getFunction(); var base = minimax.getFunction();
base.addTxt("max"); base.addTxt("max");
...@@ -1747,7 +1783,7 @@ CMathContent.prototype = ...@@ -1747,7 +1783,7 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 183: case 183:
var log = this.createMComponent(11); // logaithm var log = this.addMComponent(11); // logaithm
log.init(); log.init();
var func = log.getFunction(); var func = log.getFunction();
func.addTxt("ln"); func.addTxt("ln");
...@@ -1755,23 +1791,23 @@ CMathContent.prototype = ...@@ -1755,23 +1791,23 @@ CMathContent.prototype =
arg.fillPlaceholders(); arg.fillPlaceholders();
break; break;
case 184: case 184:
var minimax = this.createMComponent(19); var minimax = this.addMComponent(19);
minimax.init(); minimax.init();
var base = minimax.getFunction(); var base = minimax.getFunction();
base.addTxt("lim"); base.addTxt("lim");
var iter = minimax.getIterator(); var iter = minimax.getIterator();
iter.addTxt("n→∞"); iter.addTxt("n→∞");
var arg = minimax.getArgument(); var arg = minimax.getArgument();
var degr = arg.createMComponent(3); var degr = arg.addMComponent(3);
degr.init(); degr.init();
degr.setIndex(1); degr.setIndex(1);
var base = degr.getBase(); var base = degr.getBase();
var delim = base.createMComponent(9); var delim = base.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
var separ = delim.getBase(); var separ = delim.getBase();
separ.addTxt("1+"); separ.addTxt("1+");
var fract = separ.createMComponent(0); var fract = separ.addMComponent(0);
fract.init(); fract.init();
var num = fract.getNumerator(); var num = fract.getNumerator();
num.addTxt("1"); num.addTxt("1");
...@@ -1782,7 +1818,7 @@ CMathContent.prototype = ...@@ -1782,7 +1818,7 @@ CMathContent.prototype =
dgIter.addTxt("n"); dgIter.addTxt("n");
break; break;
case 185: case 185:
var minimax = this.createMComponent(19); var minimax = this.addMComponent(19);
minimax.init(); minimax.init();
var base = minimax.getFunction(); var base = minimax.getFunction();
base.addTxt("max"); base.addTxt("max");
...@@ -1790,14 +1826,14 @@ CMathContent.prototype = ...@@ -1790,14 +1826,14 @@ CMathContent.prototype =
iter.addTxt("0≤x≤1"); iter.addTxt("0≤x≤1");
var arg = minimax.getArgument(); var arg = minimax.getArgument();
arg.addTxt("x"); arg.addTxt("x");
var degr1 = arg.createMComponent(3); var degr1 = arg.addMComponent(3);
degr1.init(); degr1.init();
degr1.setIndex(1); degr1.setIndex(1);
var base1 = degr1.getBase(); var base1 = degr1.getBase();
base1.addTxt("e"); base1.addTxt("e");
var iter1 = degr1.getIterator(); var iter1 = degr1.getIterator();
iter1.addTxt("-"); iter1.addTxt("-");
var degr2 = iter1.createMComponent(3); var degr2 = iter1.addMComponent(3);
degr2.init(); degr2.init();
degr2.setIndex(1); degr2.setIndex(1);
var base2 = degr2.getBase(); var base2 = degr2.getBase();
...@@ -1806,163 +1842,163 @@ CMathContent.prototype = ...@@ -1806,163 +1842,163 @@ CMathContent.prototype =
iter2.addTxt("2"); iter2.addTxt("2");
break; break;
case 186: case 186:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt("∶="); arg.addTxt("∶=");
break; break;
case 187: case 187:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt("=="); arg.addTxt("==");
break; break;
case 188: case 188:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt("+="); arg.addTxt("+=");
break; break;
case 189: case 189:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt("-="); arg.addTxt("-=");
break; break;
case 190: case 190:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt(""); arg.addTxt("");
break; break;
case 191: case 191:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt(""); arg.addTxt("");
break; break;
case 192: case 192:
var base = this.createMComponent(22); var base = this.addMComponent(22);
base.setDimension(1,1); base.setDimension(1,1);
base.setContent(); base.setContent();
var arg = base.getElement(0,0); var arg = base.getElement(0,0);
arg.addTxt(""); arg.addTxt("");
break; break;
case 193: case 193:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 0, 0); arrow.init(1, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 194: case 194:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 0, 1); arrow.init(1, 0, 1);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 195: case 195:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 1, 0); arrow.init(1, 1, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 196: case 196:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 1, 1); arrow.init(1, 1, 1);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 197: case 197:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(3, 0, 0); arrow.init(3, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 198: case 198:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(3, 0, 1); arrow.init(3, 0, 1);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 199: case 199:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(3, 1, 0); arrow.init(3, 1, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 200: case 200:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(3, 1, 1); arrow.init(3, 1, 1);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 201: case 201:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(2, 0, 0); arrow.init(2, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 202: case 202:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(2, 1, 0); arrow.init(2, 1, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 203: case 203:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(4, 0, 0); arrow.init(4, 0, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 204: case 204:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(4, 1, 0); arrow.init(4, 1, 0);
arrow.fillPlaceholders(); arrow.fillPlaceholders();
break; break;
case 205: case 205:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 1, 1); arrow.init(1, 1, 1);
var base = arrow.getBase(); var base = arrow.getBase();
base.addTxt("yields"); base.addTxt("yields");
break; break;
case 206: case 206:
var arrow = this.createMComponent(20); var arrow = this.addMComponent(20);
arrow.init(1, 1, 1); arrow.init(1, 1, 1);
var base = arrow.getBase(); var base = arrow.getBase();
base.addTxt(""); base.addTxt("");
break; break;
case 207: case 207:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(1, 2); matrix.init(1, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 208: case 208:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(2, 1); matrix.init(2, 1);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 209: case 209:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(1, 3); matrix.init(1, 3);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 210: case 210:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(3, 1); matrix.init(3, 1);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 211: case 211:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 212: case 212:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(2, 3); matrix.init(2, 3);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 213: case 213:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(3, 2); matrix.init(3, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 214: case 214:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(3, 3); matrix.init(3, 3);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
...@@ -1979,7 +2015,7 @@ CMathContent.prototype = ...@@ -1979,7 +2015,7 @@ CMathContent.prototype =
this.addTxt(""); this.addTxt("");
break; break;
case 219: case 219:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
elem1 = matrix.getElement(0,0); elem1 = matrix.getElement(0,0);
elem1.addTxt("1"); elem1.addTxt("1");
...@@ -1994,7 +2030,7 @@ CMathContent.prototype = ...@@ -1994,7 +2030,7 @@ CMathContent.prototype =
elem4.addTxt("1"); elem4.addTxt("1");
break; break;
case 220: case 220:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.hidePlaceholder(true); matrix.hidePlaceholder(true);
...@@ -2011,7 +2047,7 @@ CMathContent.prototype = ...@@ -2011,7 +2047,7 @@ CMathContent.prototype =
elem4.addTxt("1"); elem4.addTxt("1");
break; break;
case 221: case 221:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(3, 3); matrix.init(3, 3);
elem1 = matrix.getElement(0,0); elem1 = matrix.getElement(0,0);
...@@ -2043,7 +2079,7 @@ CMathContent.prototype = ...@@ -2043,7 +2079,7 @@ CMathContent.prototype =
break; break;
case 222: case 222:
var matrix = this.createMComponent(21); var matrix = this.addMComponent(21);
matrix.init(3, 3); matrix.init(3, 3);
matrix.hidePlaceholder(true); matrix.hidePlaceholder(true);
...@@ -2075,42 +2111,42 @@ CMathContent.prototype = ...@@ -2075,42 +2111,42 @@ CMathContent.prototype =
elem9.addTxt("1"); elem9.addTxt("1");
break; break;
case 223: case 223:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 224: case 224:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 0, 1); delim.init(2, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 225: case 225:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(5, 4, 0, 1); delim.init(5, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 226: case 226:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(6, 4, 0, 1); delim.init(6, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(2, 2); matrix.init(2, 2);
matrix.fillPlaceholders(); matrix.fillPlaceholders();
break; break;
case 227: case 227:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(0, 4, 0, 1); delim.init(0, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(3, 3); matrix.init(3, 3);
elem1 = matrix.getElement(0,0); elem1 = matrix.getElement(0,0);
...@@ -2142,10 +2178,10 @@ CMathContent.prototype = ...@@ -2142,10 +2178,10 @@ CMathContent.prototype =
break; break;
case 228: case 228:
var delim = this.createMComponent(9); var delim = this.addMComponent(9);
delim.init(2, 4, 0, 1); delim.init(2, 4, 0, 1);
base = delim.getBase(); base = delim.getBase();
var matrix = base.createMComponent(21); var matrix = base.addMComponent(21);
matrix.init(3, 3); matrix.init(3, 3);
elem1 = matrix.getElement(0,0); elem1 = matrix.getElement(0,0);
...@@ -2195,7 +2231,7 @@ CMathContent.prototype = ...@@ -2195,7 +2231,7 @@ CMathContent.prototype =
{ {
this.reduct = this.reduct*coeff; this.reduct = this.reduct*coeff;
}, },
getTxtPrp: function() old_getTxtPrp: function()
{ {
var txtPrp; var txtPrp;
...@@ -2785,10 +2821,10 @@ CMathContent.prototype = ...@@ -2785,10 +2821,10 @@ CMathContent.prototype =
}, },
update_Cursor: function() update_Cursor: function()
{ {
var fontSize = this.getTxtPrp().FontSize; var sizeCursor = this.TxtPrp.FontSize *g_dKoef_pt_to_mm;
var position = {x: this.pos.x + this.content[this.CurPos].widthToEl, y: this.pos.y + this.size.center - fontSize*g_dKoef_pt_to_mm /2 }; var position = {x: this.pos.x + this.content[this.CurPos].widthToEl, y: this.pos.y + this.size.center - sizeCursor/2 };
editor.WordControl.m_oLogicDocument.DrawingDocument.SetTargetSize( fontSize*g_dKoef_pt_to_mm ); editor.WordControl.m_oLogicDocument.DrawingDocument.SetTargetSize( sizeCursor );
editor.WordControl.m_oDrawingDocument.UpdateTargetFromPaint = true; editor.WordControl.m_oDrawingDocument.UpdateTargetFromPaint = true;
editor.WordControl.m_oLogicDocument.DrawingDocument.UpdateTarget( position.x, position.y, 0 ); editor.WordControl.m_oLogicDocument.DrawingDocument.UpdateTarget( position.x, position.y, 0 );
editor.WordControl.m_oDrawingDocument.UpdateTargetFromPaint = false; editor.WordControl.m_oDrawingDocument.UpdateTargetFromPaint = false;
...@@ -3211,7 +3247,7 @@ CMathContent.prototype = ...@@ -3211,7 +3247,7 @@ CMathContent.prototype =
this.setEnd_Selection(1); this.setEnd_Selection(1);
this.selection.active = false; this.selection.active = false;
}, },
old_setPosition: function( _pos ) old_old_setPosition: function( _pos )
{ {
this.pos = { x: _pos.x + this.g_mContext.left, y: _pos.y}; this.pos = { x: _pos.x + this.g_mContext.left, y: _pos.y};
var max_cent = this.size.center; var max_cent = this.size.center;
...@@ -3222,7 +3258,7 @@ CMathContent.prototype = ...@@ -3222,7 +3258,7 @@ CMathContent.prototype =
this.content[i].value.setPosition(t); this.content[i].value.setPosition(t);
} }
}, },
setPosition: function( _pos ) old_setPosition: function( _pos )
{ {
this.pos = { x: _pos.x + this.g_mContext.left, y: _pos.y}; this.pos = { x: _pos.x + this.g_mContext.left, y: _pos.y};
var max_cent = this.size.center; var max_cent = this.size.center;
...@@ -3242,6 +3278,21 @@ CMathContent.prototype = ...@@ -3242,6 +3278,21 @@ CMathContent.prototype =
this.content[i].value.setPosition(t); this.content[i].value.setPosition(t);
} }
}, },
setPosition: function( _pos )
{
this.pos = { x: _pos.x + this.g_mContext.left, y: _pos.y};
for(var i=1; i<this.content.length;i++)
{
var t =
{
x: this.pos.x + this.content[i-1].widthToEl + this.content[i].g_mContext.left,
y: this.pos.y + this.size.center
};
this.content[i].value.setPosition(t);
}
},
drawSelect2: function() drawSelect2: function()
{ {
var start = this.selection.startPos; var start = this.selection.startPos;
...@@ -3875,7 +3926,7 @@ function CMathComposition() ...@@ -3875,7 +3926,7 @@ function CMathComposition()
this.TxtPrp = new CMathTextPrp(); this.TxtPrp = new CMathTextPrp();
this.init(); this.init();
this.setDefaultPrp();
} }
CMathComposition.prototype = CMathComposition.prototype =
{ {
...@@ -3889,6 +3940,8 @@ CMathComposition.prototype = ...@@ -3889,6 +3940,8 @@ CMathComposition.prototype =
this.Root = new CMathContent(); this.Root = new CMathContent();
this.Root.g_mContext = gps; this.Root.g_mContext = gps;
this.Root.setComposition(this); this.Root.setComposition(this);
this.setDefaultPrp();
this.Root.changeTxtPrp(this.TxtPrp, false);
this.CurrentContent = this.Root; this.CurrentContent = this.Root;
this.SelectContent = this.Root; this.SelectContent = this.Root;
...@@ -4070,12 +4123,12 @@ CMathComposition.prototype = ...@@ -4070,12 +4123,12 @@ CMathComposition.prototype =
this.ShowCursor(); this.ShowCursor();
}, },
AddMathComponent: function(indef) CreateEquation: function(indef)
{ {
this.ClearSelect(); this.ClearSelect();
this.SelectContent.removeAreaSelect(); this.SelectContent.removeAreaSelect();
this.SelectContent.addEquation(indef); this.SelectContent.createEquation(indef);
/// ///
this.RecalculateReverse(); this.RecalculateReverse();
...@@ -4140,7 +4193,7 @@ CMathComposition.prototype = ...@@ -4140,7 +4193,7 @@ CMathComposition.prototype =
}, },
SetTxtPrp: function(txtPrp) SetTxtPrp: function(txtPrp)
{ {
this.SelectContent.ChangeTxtPrp(txtPrp); this.SelectContent.changeTxtPrp(txtPrp, false);
this.Resize(); this.Resize();
this.UpdatePosition(); this.UpdatePosition();
this.UpdateCursor(); this.UpdateCursor();
...@@ -4969,7 +5022,8 @@ function CEmpty() ...@@ -4969,7 +5022,8 @@ function CEmpty()
this.SUBCONTENT = false; this.SUBCONTENT = false;
this.empty = true; this.empty = true;
this.pos = null; this.pos = null;
this.textPrp = new CMathTextPrp(); this.TxtPrp = new CMathTextPrp();
//this.size = {width: 0, ascent:0, descent: 0, height: 0, center: 0}; //this.size = {width: 0, ascent:0, descent: 0, height: 0, center: 0};
this.size = {width: 0, height: 0, center: 0, ascent: 0}; this.size = {width: 0, height: 0, center: 0, ascent: 0};
this.selection = this.selection =
...@@ -4987,13 +5041,12 @@ function CEmpty() ...@@ -4987,13 +5041,12 @@ function CEmpty()
this.Resize = function(){}; this.Resize = function(){};
this.IsHighElement = function() { return false; }; this.IsHighElement = function() { return false; };
this.setTxtPrp = function(txtPrp) { this.textPrp.Merge(txtPrp); }; this.setTxtPrp = function(txtPrp) { this.TxtPrp.Merge(txtPrp); };
this.getRunPrp = function() {return this.textPrp;}; this.getRunPrp = function() {return this.TxtPrp; };
this.getOwnTPrp = function() {return this.textPrp;}
} }
function AddEquation(ind) function old_AddEquation(ind)
{ {
var mathElem = null; var mathElem = null;
...@@ -5696,8 +5749,6 @@ function AddEquation(ind) ...@@ -5696,8 +5749,6 @@ function AddEquation(ind)
return mathElem; return mathElem;
} }
function Old_CMathComposition(font, pos) function Old_CMathComposition(font, pos)
{ {
this.Root = null; this.Root = null;
......
...@@ -53,7 +53,9 @@ function CMathText() ...@@ -53,7 +53,9 @@ function CMathText()
this.SUBCONTENT = false; this.SUBCONTENT = false;
this.empty = false; this.empty = false;
this.Parent = null; this.Parent = null;
this.textPrp = new CMathTextPrp();
this.TxtPrp = new CMathTextPrp();
this.OwnTPrp = new CMathTextPrp();
//this.sizeSymbol = null; // размер символа без учета трансформации //this.sizeSymbol = null; // размер символа без учета трансформации
...@@ -75,9 +77,8 @@ CMathText.prototype = ...@@ -75,9 +77,8 @@ CMathText.prototype =
getCode: function() getCode: function()
{ {
var code = this.value; var code = this.value;
var Italic = this.getTxtPrp().Italic;
if(Italic) if( this.TxtPrp.Italic )
{ {
if(code == 0x0068) // h if(code == 0x0068) // h
code = 0x210E; code = 0x210E;
...@@ -132,7 +133,7 @@ CMathText.prototype = ...@@ -132,7 +133,7 @@ CMathText.prototype =
{ {
this.value = StartTextElement; this.value = StartTextElement;
}, },
getTxtPrp: function() old_getTxtPrp: function()
{ {
var txtPrp = this.Parent.getTxtPrp(); var txtPrp = this.Parent.getTxtPrp();
txtPrp.Merge(this.textPrp); txtPrp.Merge(this.textPrp);
...@@ -146,7 +147,10 @@ CMathText.prototype = ...@@ -146,7 +147,10 @@ CMathText.prototype =
}, },
setTxtPrp: function(txtPrp) setTxtPrp: function(txtPrp)
{ {
this.textPrp.Merge(txtPrp); this.TxtPrp = new CMathTextPrp();
this.TxtPrp.Merge(txtPrp);
this.TxtPrp.Merge(this.OwnTPrp);
}, },
setLIterator: function(bIterator) setLIterator: function(bIterator)
{ {
...@@ -154,7 +158,7 @@ CMathText.prototype = ...@@ -154,7 +158,7 @@ CMathText.prototype =
}, },
getRunPrp: function() getRunPrp: function()
{ {
return this.textPrp; return this.TxtPrp;
}, },
getOwnTPrp: function() getOwnTPrp: function()
{ {
...@@ -169,10 +173,11 @@ CMathText.prototype = ...@@ -169,10 +173,11 @@ CMathText.prototype =
// gap = FontHeight - FontDescent - Placeholder.Height + FontDescent // gap = FontHeight - FontDescent - Placeholder.Height + FontDescent
recalculateSize: function() recalculateSize: function()
{ {
var txtPrp = this.getTxtPrp(); var txtPrp = new CMathTextPrp();
txtPrp.Merge(this.TxtPrp);
txtPrp.Italic = false; txtPrp.Italic = false;
g_oTextMeasurer.SetFont ( txtPrp ); g_oTextMeasurer.SetFont( txtPrp );
var letter = this.getCode(); var letter = this.getCode();
var metricsTxt = g_oTextMeasurer.Measure2Code(letter); var metricsTxt = g_oTextMeasurer.Measure2Code(letter);
...@@ -199,8 +204,7 @@ CMathText.prototype = ...@@ -199,8 +204,7 @@ CMathText.prototype =
old_draw: function() old_draw: function()
{ {
var txtPrp = this.getTxtPrp(); var txtPrp = this.getTxtPrp();
g_oTextMeasurer.SetFont ( txtPrp ); g_oTextMeasurer.SetFont( txtPrp );
MathControl.pGraph.b_color1(0,0,0,255); MathControl.pGraph.b_color1(0,0,0,255);
MathControl.pGraph.SetFont(txtPrp); MathControl.pGraph.SetFont(txtPrp);
...@@ -247,9 +251,9 @@ CMathText.prototype = ...@@ -247,9 +251,9 @@ CMathText.prototype =
}, },
draw: function() draw: function()
{ {
var txtPrp = this.getTxtPrp(); var txtPrp = new CMathTextPrp();
txtPrp.Merge(this.TxtPrp);
txtPrp.Italic = false; txtPrp.Italic = false;
g_oTextMeasurer.SetFont ( txtPrp );
MathControl.pGraph.b_color1(0,0,0,255); MathControl.pGraph.b_color1(0,0,0,255);
MathControl.pGraph.SetFont(txtPrp); MathControl.pGraph.SetFont(txtPrp);
......
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