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