Commit 882d31bd 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@48791 954022d7-b5bf-4e40-9824-e11837661b57
parent 492b0b68
......@@ -1441,7 +1441,6 @@ CMathContent.prototype =
arg.fillPlaceholders();
break;
case 137:
var trig = this.addMComponent(11);
trig.init();
......@@ -4310,764 +4309,7 @@ CMathComposition.prototype =
DrawSelect2: function()
{
this.SelectContent.drawSelect2();
},
//// finished equation ////
old_AddMathEquation: function (ind)
{
this.ClearSelect();
switch(ind)
{
case 4:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("dy");
denominator = fraction.getDenominator();
denominator.addText("dx");
fraction.ResizeReverse_2();
break;
case 5:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("Δy");
denominator = fraction.getDenominator();
denominator.addText("Δx");
fraction.ResizeReverse_2();
break;
case 6:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("∂y");
denominator = fraction.getDenominator();
denominator.addText("∂x");
fraction.ResizeReverse_2();
break;
case 7:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("δy");
denominator = fraction.getDenominator();
denominator.addText("δx");
fraction.ResizeReverse_2();
break;
case 8:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("π");
denominator = fraction.getDenominator();
denominator.addText("2");
fraction.ResizeReverse_2();
break;
case 13:
degree = this.SelectContent.addMathComponent_2(10);
base = degree.getBase();
base.addText("x");
iterator = degree.getIterator();
degr_2 = iterator.addMathComponent_2(9);
base_2 = degr_2.getBase();
base_2.addText("y");
iter_2 = degr_2.getIterator();
iter_2.addText("2");
degr_2.ResizeReverse_2();
degree.ResizeReverse_2();
break;
case 14:
degree = this.SelectContent.addMathComponent_2(9);
base = degree.getBase();
base.addText("e");
iterator = degree.getIterator();
iterator.addText("-iωt");
degree.ResizeReverse_2();
break;
case 15:
degree = this.SelectContent.addMathComponent_2(9);
base = degree.getBase();
base.addText("x");
iterator = degree.getIterator();
iterator.addText("2");
degree.ResizeReverse_2();
break;
case 16:
degree = this.SelectContent.addMathComponent_2(12);
base = degree.getBase();
base.addText("Y");
iterator = degree.getUpperIterator();
iterator.addText("n");
iterator = degree.getLowerIterator();
iterator.addText("1");
degree.ResizeReverse_2();
break;
case 19:
radical = this.SelectContent.addMathComponent_2(18);
degr = radical.getDegree();
degr.addText("2");
radical.ResizeReverse_2();
break;
case 20:
radical = this.SelectContent.addMathComponent_2(18);
degr = radical.getDegree();
degr.addText("3");
radical.ResizeReverse_2();
break;
case 21:
fraction = this.SelectContent.addMathComponent_2(0);
numerator = fraction.getNumerator();
numerator.addText("-b±");
radical = numerator.addMathComponent_2(17);
baseRad = radical.getBase();
degree = baseRad.addMathComponent_2(9);
base = degree.getBase();
base.addText("b");
iter = degree.getIterator();
iter.addText("2");
baseRad.addText("-4ac");
denominator = fraction.getDenominator();
denominator.addText("2a");
fraction.ResizeReverse_2();
break;
case 22:
radical = this.SelectContent.addMathComponent_2(17);
baseRad = radical.getBase();
degree = baseRad.addMathComponent_2(9);
base = degree.getBase();
base.addText("a");
iter = degree.getIterator();
iter.addText("2");
baseRad.addText("+");
degree2 = baseRad.addMathComponent_2(9);
base2 = degree2.getBase();
base2.addText("b");
iter2 = degree2.getIterator();
iter2.addText("2");
radical.ResizeReverse_2();
break;
case 41:
mathBase = this.SelectContent.addMathComponent_2(230);
elem1 = mathBase.getElement(0,0);
elem1.addText("dx");
mathBase.ResizeReverse_2();
break;
case 42:
mathBase = this.SelectContent.addMathComponent_2(230);
elem1 = mathBase.getElement(0,0);
elem1.addText("dy");
mathBase.ResizeReverse_2();
break;
case 43:
mathBase = this.SelectContent.addMathComponent_2(230);
elem1 = mathBase.getElement(0,0);
elem1.addText("");
mathBase.ResizeReverse_2();
break;
case 79:
nary = this.SelectContent.addMathComponent_2(47);
iter = nary.getLowerIterator();
iter.addText("k");
base = nary.getBase();
delimiter = base.addMathComponent_2(83);
delimBase = delimiter.getBase();
matrix = delimBase.addMathComponent_2(207);
matrElem = matrix.getElement(0, 0);
matrElem.addText("n");
matrElem2 = matrix.getElement(1, 0);
matrElem2.addText("k");
nary.ResizeReverse_2();
break;
case 80:
nary = this.SelectContent.addMathComponent_2(45);
iter = nary.getUpperIterator();
iter.addText("n");
iter = nary.getLowerIterator();
iter.addText("i=0");
nary.ResizeReverse_2();
break;
case 82:
nary = this.SelectContent.addMathComponent_2(60);
iterUp = nary.getUpperIterator();
iterUp.addText("m");
iterLow = nary.getLowerIterator();
iterLow.addText("n=1");
base = nary.getBase();
delimiter = base.addMathComponent_2(83);
delimBase = delimiter.getBase();
degr = delimBase.addMathComponent_2(10);
degrBase = degr.getBase();
degrBase.addText("X");
degrIter = degr.getIterator();
degrIter.addText("n");
delimBase.addText("");
degr2 = delimBase.addMathComponent_2(10);
degrBase2 = degr2.getBase();
degrBase2.addText("Y");
degrIter2 = degr2.getIterator();
degrIter2.addText("n");
nary.ResizeReverse_2();
break;
case 117:
delimiter = this.SelectContent.addMathComponent_2(103);
delimBase = delimiter.getBase();
delimBase.addMathComponent_2(207);
delimiter.ResizeReverse_2();
break;
case 118:
delimiter = this.SelectContent.addMathComponent_2(103);
delimBase = delimiter.getBase();
delimBase.addMathComponent_2(209);
delimiter.ResizeReverse_2();
break;
case 119:
fract = this.SelectContent.addMathComponent_2(0);
fract.hideBar(true);
fract.ResizeReverse_2();
break;
case 120:
delimiter = this.SelectContent.addMathComponent_2(83);
delimBase = delimiter.getBase();
fract = delimBase.addMathComponent_2(0);
fract.hideBar(true);
delimiter.ResizeReverse_2();
break;
case 121:
break;
case 122:
delimiter = this.SelectContent.addMathComponent_2(83);
delimBase = delimiter.getBase();
fract = delimBase.addMathComponent_2(0);
fract.hideBar(true);
num = fract.getNumerator();
num.addText("n");
den = fract.getDenominator();
den.addText("k");
delimiter.ResizeReverse_2();
break;
case 123:
delimiter = this.SelectContent.addMathComponent_2(86);
delimBase = delimiter.getBase();
fract = delimBase.addMathComponent_2(0);
fract.hideBar(true);
num = fract.getNumerator();
num.addText("n");
den = fract.getDenominator();
den.addText("k");
delimiter.ResizeReverse_2();
break;
case 124:
this.SetTrigonometricFunc("sin");
break;
case 125:
this.SetTrigonometricFunc("cos");
break;
case 126:
this.SetTrigonometricFunc("tan");
break;
case 127:
this.SetTrigonometricFunc("csc");
break;
case 128:
this.SetTrigonometricFunc("sec");
break;
case 129:
this.SetTrigonometricFunc("cot");
break;
case 130:
this.SetDegrTrigFunc("sin");
break;
case 131:
this.SetDegrTrigFunc("cos");
break;
case 132:
this.SetDegrTrigFunc("tan");
break;
case 133:
this.SetDegrTrigFunc("csc");
break;
case 134:
this.SetDegrTrigFunc("sec");
break;
case 135:
this.SetDegrTrigFunc("cot");
break;
case 136:
this.SetTrigonometricFunc("sinh");
break;
case 137:
this.SetTrigonometricFunc("cosh");
break;
case 138:
this.SetTrigonometricFunc("tanh");
break;
case 139:
this.SetTrigonometricFunc("csch");
break;
case 140:
this.SetTrigonometricFunc("sech");
break;
case 141:
this.SetTrigonometricFunc("coth");
break;
case 142:
this.SetDegrTrigFunc("sinh");
break;
case 143:
this.SetDegrTrigFunc("cosh");
break;
case 144:
this.SetDegrTrigFunc("tanh");
break;
case 145:
this.SetDegrTrigFunc("csch");
break;
case 146:
this.SetDegrTrigFunc("sech");
break;
case 147:
this.SetDegrTrigFunc("coth");
break;
case 148:
mathFunc = this.SelectContent.addMathComponent_2(228);
func = mathFunc.getFunction();
func.addText("sin");
arg = mathFunc.getArgument();
arg.addText("θ");
mathFunc.ResizeReverse_2();
break;
case 149:
mathFunc = this.SelectContent.addMathComponent_2(228);
func = mathFunc.getFunction();
func.addText("cos");
arg = mathFunc.getArgument();
arg.addText("2x");
mathFunc.ResizeReverse_2();
break;
case 150:
mathFunc = this.SelectContent.addMathComponent_2(228);
func = mathFunc.getFunction();
func.addText("tan");
arg = mathFunc.getArgument();
arg.addText("θ");
this.SelectContent.addText("=");
fract = this.SelectContent.addMathComponent_2(0);
numer = fract.getNumerator();
mathFunc2 = numer.addMathComponent_2(228);
func2 = mathFunc2.getFunction();
func2.addText("sin");
arg2 = mathFunc2.getArgument();
arg2.addText("θ");
den = fract.getDenominator();
mathFunc3 = den.addMathComponent_2(228);
func3 = mathFunc3.getFunction();
func3.addText("cos");
arg3 = mathFunc3.getArgument();
arg3.addText("θ");
mathFunc.ResizeReverse_2();
fract.ResizeReverse_2();
break;
case 174:
box = this.SelectContent.addMathComponent_2(173);
borderBox = box.getElement();
aDegr = borderBox.addMathComponent_2(9);
aBase = aDegr.getBase();
aBase.addText("a");
aIter = aDegr.getIterator();
aIter.addText("2");
borderBox.addText("=");
bDegr = borderBox.addMathComponent_2(9);
bBase = bDegr.getBase();
bBase.addText("b");
bIter = bDegr.getIterator();
bIter.addText("2");
borderBox.addText("+");
cDegr = borderBox.addMathComponent_2(9);
cBase = cDegr.getBase();
cBase.addText("c");
cIter = cDegr.getIterator();
cIter.addText("2");
box.ResizeReverse_2();
break;
case 178:
this.SetTrigonometricFunc("log");
break;
case 182:
this.SetTrigonometricFunc("ln");
break;
case 183:
lim = this.SelectContent.addMathComponent_2(179);
iter = lim.getIterator();
iter.addText("n→∞");
base = lim.getArgument();
degree = base.addMathComponent_2(9);
iter2 = degree.getIterator();
iter2.addText("n");
base2 = degree.getBase();
delim = base2.addMathComponent_2(83);
delimBase = delim.getBase();
delimBase.addText("1+");
fract = delimBase.addMathComponent_2(0);
num = fract.getNumerator();
num.addText("1");
den = fract.getDenominator();
den.addText("n");
lim.ResizeReverse_2();
break;
case 184:
maximum = this.SelectContent.addMathComponent_2(181);
iter = maximum.getIterator();
iter.addText("0≤x≤1");
base = maximum.getArgument();
base.addText("x");
degree = base.addMathComponent_2(9);
base2 = degree.getBase();
base2.addText("e");
iter2 = degree.getIterator();
iter2.addText("-");
degree3 = iter2.addMathComponent_2(9);
base3 = degree3.getBase();
base3.addText("x");
iter3 = degree3.getIterator();
iter3.addText("2");
maximum.ResizeReverse_2();
break;
case 185:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("∶=");
matr.ResizeReverse_2();
break;
case 186:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("==");
matr.ResizeReverse_2();
break;
case 187:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("+=");
matr.ResizeReverse_2();
break;
case 188:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("-=");
matr.ResizeReverse_2();
break;
case 189:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("");
matr.ResizeReverse_2();
break;
case 190:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("");
matr.ResizeReverse_2();
break;
case 191:
matr = this.SelectContent.addMathComponent_2(229);
elemMatr = matr.getElement(0,0);
elemMatr.addText("");
matr.ResizeReverse_2();
break;
case 204:
arrow = this.SelectContent.addMathComponent_2(195);
base = arrow.getBase();
base.addText("yields");
arrow.ResizeReverse_2();
break;
case 205:
arrow = this.SelectContent.addMathComponent_2(195);
base = arrow.getBase();
base.addText("");
arrow.ResizeReverse_2();
break;
case 214:
this.SelectContent.addText("");
break;
case 215:
this.SelectContent.addText("");
break;
case 216:
this.SelectContent.addText("");
break;
case 217:
this.SelectContent.addText("");
break;
break;
case 218:
matr = this.SelectContent.addMathComponent_2(210);
elem1 = matr.getElement(0,0);
elem1.addText("1");
elem2 = matr.getElement(0,1);
elem2.addText("0");
elem3 = matr.getElement(1,0);
elem3.addText("0");
elem4 = matr.getElement(1,1);
elem4.addText("1");
matr.ResizeReverse_2();
break;
case 219:
matr = this.SelectContent.addMathComponent_2(210);
matr.hidePlaceholder(true);
elem1 = matr.getElement(0,0);
elem1.addText("1");
elem4 = matr.getElement(1,1);
elem4.addText("1");
matr.ResizeReverse_2();
break;
case 220:
matr = this.SelectContent.addMathComponent_2(213);
elem1 = matr.getElement(0,0);
elem1.addText("1");
elem2 = matr.getElement(0,1);
elem2.addText("0");
elem3 = matr.getElement(0,2);
elem3.addText("0");
elem4 = matr.getElement(1,0);
elem4.addText("0");
elem5 = matr.getElement(1,1);
elem5.addText("1");
elem6 = matr.getElement(1,2);
elem6.addText("0");
elem7 = matr.getElement(2,0);
elem7.addText("0");
elem8 = matr.getElement(2,1);
elem8.addText("0");
elem9 = matr.getElement(2,2);
elem9.addText("1");
matr.ResizeReverse_2();
break;
case 221:
matr = this.SelectContent.addMathComponent_2(213);
matr.hidePlaceholder(true);
elem1 = matr.getElement(0,0);
elem1.addText("1");
elem5 = matr.getElement(1,1);
elem5.addText("1");
elem9 = matr.getElement(2,2);
elem9.addText("1");
matr.ResizeReverse_2();
break;
case 222:
delimiter = this.SelectContent.addMathComponent_2(83);
base = delimiter.getBase();
base.addMathComponent_2(210);
delimiter.ResizeReverse_2();
break;
case 223:
delimiter = this.SelectContent.addMathComponent_2(84);
base = delimiter.getBase();
base.addMathComponent_2(210);
delimiter.ResizeReverse_2();
break;
case 224:
delimiter = this.SelectContent.addMathComponent_2(89);
base = delimiter.getBase();
base.addMathComponent_2(210);
delimiter.ResizeReverse_2();
break;
case 225:
delimiter = this.SelectContent.addMathComponent_2(90);
base = delimiter.getBase();
base.addMathComponent_2(210);
delimiter.ResizeReverse_2();
break;
case 226:
delimiter = this.SelectContent.addMathComponent_2(83);
base = delimiter.getBase();
matr = base.addMathComponent_2(213);
elem2 = matr.getElement(0,1);
elem2.addText("");
elem4 = matr.getElement(1,0);
elem4.addText("");
elem5 = matr.getElement(1,1);
elem5.addText("");
elem6 = matr.getElement(1,2);
elem6.addText("");
elem8 = matr.getElement(2,1);
elem8.addText("");
delimiter.ResizeReverse_2();
break;
case 227:
delimiter = this.SelectContent.addMathComponent_2(84);
base = delimiter.getBase();
matr = base.addMathComponent_2(213);
elem2 = matr.getElement(0,1);
elem2.addText("");
elem4 = matr.getElement(1,0);
elem4.addText("");
elem5 = matr.getElement(1,1);
elem5.addText("");
elem6 = matr.getElement(1,2);
elem6.addText("");
elem8 = matr.getElement(2,1);
elem8.addText("");
delimiter.ResizeReverse_2();
break;
default:
this.SelectContent.add_mathComponent(ind);
break;
}
this.SelectContent.ResizeReverse();
this.Root.setPosition(this.pos);
this.CurrentContent = this.SelectContent;
this.CurrentContent.update_Cursor();
this.ShowCursor();
},
SetDegrTrigFunc: function(txt)
{
mathFunc = this.SelectContent.addMathComponent_2(228);
//setColumnGapRule(3, 120);
func = mathFunc.getFunction();
degr = func.addMathComponent_2(9);
base = degr.getBase();
base.bMText = false;
base.addText(txt);
iter = degr.getIterator();
iter.addText("-1");
mathFunc.ResizeReverse_2();
},
SetTrigonometricFunc: function(txt)
{
mathFunc = this.SelectContent.addMathComponent_2(228);
func = mathFunc.getFunction();
func.addText(txt);
mathFunc.ResizeReverse_2();
}
////
}
function CEmpty()
......
//var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tg", "ctg", "ch", "sh", "th", "cth", "sec", "csc", "cot", "csch", "sech", "coth"];
//var NameFunctions = ["min", "max", "lim", "log", "ln", "sin", "cos", "tan", "ctg", "cosh", "sinh", "tanh", "cth", "sec", "csc", "cot", "csch", "sech", "coth"];
//var Diff = ["dx","dy","dθ"];
function CLogarithm()
{
CSubMathBase.call(this,1,2);
}
extend(CLogarithm, CSubMathBase);
CLogarithm.prototype.setContent = function()
{
var oBase = new CMathContent();
var GParams = Common_CopyObj(this.params);
GParams.bMText = false;
oBase.init(GParams);
oBase.relate(this);
oBase.addText("log");
//oBase.setContent.apply(oBase, NameFunctions.minimax[3] );
var oFunc = new CDegreeOrdinary(-1);
oFunc.init(this.params);
oFunc.relate(this);
oFunc.setContent(oBase); //здесь выставляется для Base, что родительский класс CDegree...
//todo
//проверить !!!
//var oArg = new CMathBase(1, 1);
var oArg = new CMathContent();
oArg.init(this.params);
oArg.relate(this);
oArg.fillPlaceholders();
CLogarithm.superclass.setContent.call(this, oFunc, oArg);
}
CLogarithm.prototype.getFunction = function()
{
return this.elements[0][0].getBase();
}
CLogarithm.prototype.getBase = function()
{
return this.elements[0][0].getIterator();
}
CLogarithm.prototype.getArgument = function()
{
return this.elements[0][1];
}
function CMinimaxFunc()
{
CMathBase.call(this);
}
extend(CMinimaxFunc, CMathBase);
CMinimaxFunc.prototype.init = function()
{
this.setDimension(2, 1);
var oBase = new CMathContent();
//oBase.mergeTxtPrp({Italic: false});
oBase.setOwnTPrp({Italic: false});
var oIter = new CMathContent();
oIter.setReduct(DEGR_REDUCT);
this.addMCToContent(oBase, oIter);
}
CMinimaxFunc.prototype.getCenter = function()
{
return this.elements[0][0].size.center;
}
CMinimaxFunc.prototype.getBase = function()
{
return this.elements[0][0];
}
CMinimaxFunc.prototype.getIterator = function()
{
return this.elements[1][0];
}
CMinimaxFunc.prototype.old_setDistance = function()
{
var iter = this.elements[1][0].size,
ascent = iter.center + this.params.font.metrics.Placeholder.Height*DIV_CENTER;
this.dH = this.params.font.metrics.Placeholder.Height - ascent;
this.dW = 0;
//this.dH = this.params.font.FontSize/16*g_dKoef_pt_to_mm;
}
CMinimaxFunc.prototype.setDistance = function()
{
this.dH = 0.03674768518518519*this.getTxtPrp().FontSize;
}
function CMinimax()
{
CSubMathBase.call(this);
}
extend(CMinimax, CSubMathBase);
CMinimax.prototype.init = function()
{
this.setDimension(1, 2);
var oFunc = new CMinimaxFunc();
oFunc.init();
var oArg = new CMathContent();
this.addMCToContent(oFunc, oArg);
}
CMinimax.prototype.getFunction = function()
{
return this.elements[0][0].getBase();
}
CMinimax.prototype.getIterator = function()
{
return this.elements[0][0].getIterator();
}
CMinimax.prototype.getArgument = function()
{
return this.elements[0][1];
}
CMinimax.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
this.dH = 0;
}
function CMathFunc()
{
CMathBase.call(this);
}
extend(CMathFunc, CMathBase);
CMathFunc.prototype.init = function()
{
this.setDimension(1, 2);
this.setContent();
this.elements[0][0].setOwnTPrp({Italic: false}); // trigonometrical function
//this.elements[0][0].mergeTxtPrp({Italic: false}); // trigonometrical function
}
CMathFunc.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
}
CMathFunc.prototype.getFunction = function()
{
return this.elements[0][0];
}
CMathFunc.prototype.getArgument = function()
{
return this.elements[0][1];
}
function old_CDifferential(num)
{
this.num = num;
CSubMathBase.call(this, 1,1);
}
extend(old_CDifferential, CSubMathBase);
old_CDifferential.prototype.setContent = function()
{
var oDiff = new CMathContent();
oDiff.init(this.params);
oDiff.addText(Diff[this.num]);
old_CMathFunc.superclass.setContent.call(this, oDiff);
}
function old_CTrigFunc(num)
{
if(num != num + 0 || num < 0 || num > 14)
return;
this.num = num;
//CSubMathBase.call(this, 1, 2);
CMathBase.call(this, 1,2);
}
//extend(old_CTrigFunc,CSubMathBase);
extend(old_CTrigFunc, CMathBase);
old_CTrigFunc.prototype.setContent = function()
{
var oFunc = new CMathContent();
var GParms = Common_CopyObj(this.params);
GParms.bMText = false;
oFunc.init(GParms);
oFunc.setContent.apply(oFunc, NameFunctions.trig[this.num] );
var oArg = new CMathContent();
oArg.init(this.params);
oArg.fillPlaceholders();
old_CTrigFunc.superclass.setContent.call(this, oFunc, oArg);
}
old_CTrigFunc.prototype.setDistance = function()
{
//todo
//переделать!
this.dW = slashWidth(this.params.font);
this.dH = 0;
}
old_CTrigFunc.prototype.getFunction = function()
{
return this.elemens[0][0];
}
old_CTrigFunc.prototype.getArgument = function()
{
return this.elemens[0][1];
}
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