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

box and border box

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49917 954022d7-b5bf-4e40-9824-e11837661b57
parent bbce7a3e
......@@ -5,24 +5,34 @@ function CBorderBox()
this.bLeft = true;
this.bRight = true;
this.bTop = true;
this.bDown = true;
this.bBot = true;
this.bLDiag = false;
this.bRDiag = false;
// this.bLeft = false;
// this.bRight = false;
// this.bDown = false;
// this.bTop = false;
/*this.bLDiag = true;
this.bRDiag = true;*/
CMathBase.call(this);
}
extend(CBorderBox, CMathBase);
CBorderBox.prototype.init = function()
CBorderBox.prototype.init = function(props)
{
if(typeof(props) !== "undefined" && props !== null)
{
if(props.hideLeft === true || props.hideLeft === 1)
this.bLeft = false;
if(props.hideRight === true || props.hideRight === 1)
this.bRight = false;
if(props.hideTop === true || props.hideTop === 1)
this.bTop = false;
if(props.hideBot === true || props.hideBot === 1)
this.bBot = false;
if(props.strikeBLTR === true || props.strikeBLTR === 1)
this.bLDiag = true;
if(props.strikeTLBR === true || props.strikeTLBR === 1)
this.bRDiag = true;
}
this.setDimension(1, 1);
this.setContent();
}
......@@ -41,7 +51,7 @@ CBorderBox.prototype.recalculateSize = function()
height += this.gapBrd;
center += this.gapBrd;
}
if(this.bDown)
if(this.bBot)
height += this.gapBrd;
if(this.bLeft)
......@@ -68,7 +78,7 @@ CBorderBox.prototype.draw = function()
MathControl.pGraph.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bDown)
if(this.bBot)
{
var x1 = this.pos.x,
x2 = this.pos.x + this.size.width - 25.4/96,
......@@ -223,18 +233,31 @@ CBorderBox.prototype.getElement = function()
function CBox()
{
this.type = null;
this.opEmu = false;
this.diff = false;
this.noBreak = false;
CMathBase.call(this);
}
extend(CBox, CMathBase);
CBox.prototype.init = function(props)
{
this.type = props.type;
this.bSpacing = ( props.spacing === 1 || props.spacing === true ) ? true : false;
if( typeof(props) !== "undefined" && (props !== null) )
{
if(props.opEmu === true || props.opEmu === 1)
this.opEmu = true;
if(props.diff === true || props.diff === 1)
this.diff = true;
if(props.noBreak === true || props.noBreak === 1)
this.noBreak = true;
}
this.setDimension(1, 1);
this.setContent();
}
CBox.prototype.getElement = function()
CBox.prototype.getBase = function()
{
return this.elements[0][0];
}
\ No newline at end of file
......@@ -4255,18 +4255,19 @@ CMathContent.prototype =
case 173:
break;
case 174:
var box = this.addMComponent(18);
box.init();
box.fillPlaceholders();
var borderBox = this.addMComponent(MATH_BORDER_BOX);
borderBox.init();
borderBox.fillPlaceholders();
break;
case 175:
var box = this.addMComponent(18);
box.init();
var arg = box.getElement();
var borderBox = this.addMComponent(MATH_BORDER_BOX);
borderBox.init(props);
var degrA = arg.addMComponent(3);
degrA.init();
degrA.setIndex(1);
var arg = borderBox.getElement();
var degrA = arg.addMComponent(MATH_DEGREE);
var props = {type: DEGREE_SUPERSCRIPT};
degrA.init(props);
var baseA = degrA.getBase();
baseA.addTxt("a");
var iterA = degrA.getIterator();
......@@ -4274,9 +4275,8 @@ CMathContent.prototype =
arg.addTxt("=");
var degrB = arg.addMComponent(3);
degrB.init();
degrB.setIndex(1);
var degrB = arg.addMComponent(MATH_DEGREE);
degrB.init(props);
var baseB = degrB.getBase();
baseB.addTxt("b");
var iterB = degrB.getIterator();
......@@ -4284,9 +4284,8 @@ CMathContent.prototype =
arg.addTxt("+");
var degrC = arg.addMComponent(3);
degrC.init();
degrC.setIndex(1);
var degrC = arg.addMComponent(MATH_DEGREE);
degrC.init(props);
var baseC = degrC.getBase();
baseC.addTxt("c");
var iterC = degrC.getIterator();
......@@ -4463,79 +4462,39 @@ CMathContent.prototype =
base2.addTxt("x");
var iter3 = degr2.getIterator();
iter3.addTxt("2");
/*var minimax = this.addMComponent(19);
minimax.init();
var base = minimax.getFunction();
base.addTxt("max");
var iter = minimax.getIterator();
iter.addTxt("0≤x≤1");
var arg = minimax.getArgument();
arg.addTxt("x");
var degr1 = arg.addMComponent(3);
degr1.init();
degr1.setIndex(1);
var base1 = degr1.getBase();
base1.addTxt("e");
var iter1 = degr1.getIterator();
iter1.addTxt("-");
var degr2 = iter1.addMComponent(3);
degr2.init();
degr2.setIndex(1);
var base2 = degr2.getBase();
base2.addTxt("x");
var iter2 = degr2.getIterator();
iter2.addTxt("2");*/
break;
case 186:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
var box = this.addMComponent(MATH_BOX);
box.init();
var arg = box.getBase();
arg.addTxt("∶=");
break;
case 187:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
var box = this.addMComponent(MATH_BOX);
box.init();
var arg = box.getBase();
arg.addTxt("==");
break;
case 188:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
var box = this.addMComponent(MATH_BOX);
box.init();
var arg = box.getBase();
arg.addTxt("+=");
break;
case 189:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
var box = this.addMComponent(MATH_BOX);
box.init();
var arg = box.getBase();
arg.addTxt("-=");
break;
case 190:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
arg.addTxt("");
this.addTxt("");
break;
case 191:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
arg.addTxt("");
this.addTxt("");
break;
case 192:
var base = this.addMComponent(22);
base.setDimension(1,1);
base.setContent();
var arg = base.getElement(0,0);
arg.addTxt("");
this.addTxt("");
break;
case 193:
var arrow = this.addMComponent(20);
......
......@@ -471,5 +471,4 @@ CEqArray.prototype.init = function(props)
};
CEqArray.superclass.init.call(this, prps);
}
}
\ No newline at end of file
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