Commit f7b3e0c3 authored by Anna.Pavlova's avatar Anna.Pavlova

переделала обращение к MathComposition (для чтения из файла)

MathControl.pGraph заменила на pGraphics

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50275 954022d7-b5bf-4e40-9824-e11837661b57
parent 4314e95d
......@@ -72,7 +72,7 @@ CCircumflex.prototype.fixSize = function(mesure, bIncl)
this.size = {width: width, height: height};
}
CCircumflex.prototype.draw = function()
CCircumflex.prototype.draw = function(pGraphics)
{
var x = this.pos.x,
y = this.pos.y;
......@@ -148,29 +148,29 @@ CCircumflex.prototype.draw = function()
YY[i] = y + (a + b*YY[i])*alpha;
}
var intGrid = MathControl.pGraph.GetIntegerGrid();
MathControl.pGraph.SetIntegerGrid(false);
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
pGraphics.p_width(penW*1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._l(XX[1], YY[1]);
MathControl.pGraph._l(XX[2], YY[2]);
MathControl.pGraph._l(XX[3], YY[3]);
MathControl.pGraph._l(XX[4], YY[4]);
MathControl.pGraph._l(XX[5], YY[5]);
MathControl.pGraph._l(XX[6], YY[6]);
MathControl.pGraph._l(XX[7], YY[7]);
MathControl.pGraph._l(XX[8], YY[8]);
MathControl.pGraph._l(XX[9], YY[9]);
MathControl.pGraph._l(XX[10], YY[10]);
MathControl.pGraph._l(XX[11], YY[11]);
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
pGraphics._l(XX[3], YY[3]);
pGraphics._l(XX[4], YY[4]);
pGraphics._l(XX[5], YY[5]);
pGraphics._l(XX[6], YY[6]);
pGraphics._l(XX[7], YY[7]);
pGraphics._l(XX[8], YY[8]);
pGraphics._l(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]);
pGraphics._l(XX[11], YY[11]);
MathControl.pGraph.df();
pGraphics.df();
MathControl.pGraph.SetIntegerGrid(intGrid);
pGraphics.SetIntegerGrid(intGrid);
}
CCircumflex.prototype.setTxtPrp = function(txtPrp)
......@@ -198,7 +198,7 @@ CLine.prototype.fixSize = function(measure)
this.size = {width: width, height: height}
}
CLine.prototype.draw = function()
CLine.prototype.draw = function(pGraphics)
{
var penW = this.txtPrp.FontSize*g_dKoef_pt_to_mm*this.PEN_W;
//penW *= 96/25.4;
......@@ -215,12 +215,12 @@ CLine.prototype.draw = function()
x2 = x1 + this.size.width,
y2 = y1;
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph.ds();
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
}
CLine.prototype.setPosition = function(pos)
......@@ -255,7 +255,7 @@ CDoubleLine.prototype.setTxtPrp = function(txtPrp)
{
this.txtPrp = txtPrp;
}
CDoubleLine.prototype.draw = function()
CDoubleLine.prototype.draw = function(pGraphics)
{
var penW = this.txtPrp.FontSize*g_dKoef_pt_to_mm*this.PEN_W;
//penW *= 96/25.4;
......@@ -272,14 +272,14 @@ CDoubleLine.prototype.draw = function()
x4 = x2,
y4 = y3;
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph._m(x3, y3);
MathControl.pGraph._l(x4, y4);
MathControl.pGraph.ds();
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics._m(x3, y3);
pGraphics._l(x4, y4);
pGraphics.ds();
}
......@@ -295,7 +295,7 @@ CTilde.prototype.fixSize = function()
this.size = {width: width, height: height};
}
CTilde.prototype.draw = function()
CTilde.prototype.draw = function(pGraphics)
{
var X = new Array(),
Y = new Array();
......@@ -352,32 +352,32 @@ CTilde.prototype.draw = function()
var penW = fontSize*g_dKoef_pt_to_mm*this.PEN_W;
penW *= 96/25.4;
var intGrid = MathControl.pGraph.GetIntegerGrid();
MathControl.pGraph.SetIntegerGrid(false);
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
MathControl.pGraph._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
MathControl.pGraph._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
MathControl.pGraph._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
MathControl.pGraph._c(XX[8], YY[8], XX[9], YY[9], XX[10], YY[10] );
MathControl.pGraph._c(XX[10], YY[10], XX[11], YY[11], XX[12], YY[12] );
MathControl.pGraph._l(XX[13], YY[13]);
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
MathControl.pGraph._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
MathControl.pGraph._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
MathControl.pGraph._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
MathControl.pGraph._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
MathControl.pGraph._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
MathControl.pGraph._l(XX[26], YY[26]);
MathControl.pGraph.df();
MathControl.pGraph.SetIntegerGrid(intGrid);
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
pGraphics.p_width(penW*1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(XX[0], YY[0]);
pGraphics._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
pGraphics._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
pGraphics._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
pGraphics._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
pGraphics._c(XX[8], YY[8], XX[9], YY[9], XX[10], YY[10] );
pGraphics._c(XX[10], YY[10], XX[11], YY[11], XX[12], YY[12] );
pGraphics._l(XX[13], YY[13]);
pGraphics._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
pGraphics._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
pGraphics._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
pGraphics._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
pGraphics._l(XX[26], YY[26]);
pGraphics.df();
pGraphics.SetIntegerGrid(intGrid);
}
CTilde.prototype.setPosition = function(pos)
{
......@@ -409,7 +409,7 @@ CBreve.prototype.setPosition = function(pos)
{
this.pos = pos;
}
CBreve.prototype.draw = function()
CBreve.prototype.draw = function(pGraphics)
{
var X = new Array(),
Y = new Array();
......@@ -474,30 +474,30 @@ CBreve.prototype.draw = function()
var penW = fontSize*g_dKoef_pt_to_mm*this.PEN_W;
penW *= 96/25.4;
var intGrid = MathControl.pGraph.GetIntegerGrid();
MathControl.pGraph.SetIntegerGrid(false);
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
pGraphics.p_width(penW*1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
MathControl.pGraph._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
MathControl.pGraph._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
MathControl.pGraph._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
MathControl.pGraph._l(XX[9], YY[9]);
MathControl.pGraph._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11] );
MathControl.pGraph._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
MathControl.pGraph._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
MathControl.pGraph._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
MathControl.pGraph._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
MathControl.pGraph._l(XX[22], YY[22]);
pGraphics._m(XX[0], YY[0]);
pGraphics._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
pGraphics._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
pGraphics._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
pGraphics._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
pGraphics._l(XX[9], YY[9]);
pGraphics._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11] );
pGraphics._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
pGraphics._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
pGraphics._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
pGraphics._l(XX[22], YY[22]);
MathControl.pGraph.df();
pGraphics.df();
MathControl.pGraph.SetIntegerGrid(intGrid);
pGraphics.SetIntegerGrid(intGrid);
}
CBreve.prototype.setTxtPrp = function(txtPrp)
......@@ -585,9 +585,9 @@ CSign.prototype.fixSize = function(bIncline)
this.size = {width: width, height: height};
}
CSign.prototype.draw = function()
CSign.prototype.draw = function(pGraphics)
{
this.sign.draw();
this.sign.draw(pGraphics);
}
CSign.prototype.setTxtPrp = function(txtPrp)
{
......
......@@ -1266,7 +1266,8 @@ function Set_Container(dimension, path, index)
{
document.getElementById("Container").style.display = "none";
// AddMathComponent -> CreateEquation
MathControl.CreateEquation(index + _i*column + _j);
//MathControl.CreateEquation(index + _i*column + _j);
MathComposition.CreateEquation(index + _i*column + _j);
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field,
Right : X_Right_Field,
......
......@@ -777,11 +777,11 @@ CMathBase.prototype =
h += Heights[i];
}
},
draw: function()
draw: function(pGraphics)
{
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].draw();
this.elements[i][j].draw(pGraphics);
},
remove: function(order)
{
......
......@@ -61,9 +61,9 @@ CBorderBox.prototype.recalculateSize = function()
this.size = {width : width, height: height, center: center};
}
CBorderBox.prototype.draw = function()
CBorderBox.prototype.draw = function(pGraphics)
{
this.elements[0][0].draw();
this.elements[0][0].draw(pGraphics);
var penW = this.getTxtPrp().FontSize* 25.4/96 * 0.08 ;
......@@ -74,8 +74,8 @@ CBorderBox.prototype.draw = function()
x2 = this.pos.x + this.size.width - 25.4/96,
y1 = y2 = this.pos.y;
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.drawHorLine(0, y1, x1, x2, penW);
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bBot)
......@@ -84,8 +84,8 @@ CBorderBox.prototype.draw = function()
x2 = this.pos.x + this.size.width - 25.4/96,
y1 = y2 = this.pos.y + this.size.height - penW;
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.drawHorLine(0, y1, x1, x2, penW);
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bLeft)
......@@ -94,8 +94,8 @@ CBorderBox.prototype.draw = function()
y1 = this.pos.y,
y2 = this.pos.y + this.size.height - 25.4/96;
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.drawVerLine(0, x1, y1, y2, penW);
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.bRight)
......@@ -104,8 +104,8 @@ CBorderBox.prototype.draw = function()
y1 = this.pos.y,
y2 = this.pos.y + this.size.height - 25.4/96 ;
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.drawVerLine(0, x1, y1, y2, penW);
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.bLDiag)
......@@ -119,18 +119,18 @@ CBorderBox.prototype.draw = function()
x6 = x1, y6 = y1 + pW,
x7 = x1, y7 = y1;
MathControl.pGraph.p_width(1000);
MathControl.pGraph.b_color1(0,0,0, 255);
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph._l(x3, y3);
MathControl.pGraph._l(x4, y4);
MathControl.pGraph._l(x5, y5);
MathControl.pGraph._l(x6, y6);
MathControl.pGraph._l(x7, y7);
MathControl.pGraph.df();
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics._l(x3, y3);
pGraphics._l(x4, y4);
pGraphics._l(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.df();
}
if(this.bRDiag)
......@@ -144,18 +144,18 @@ CBorderBox.prototype.draw = function()
x6 = x5, y6 = y5 - pW,
x7 = x1, y7 = y1;
MathControl.pGraph.p_width(1000);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph._l(x3, y3);
MathControl.pGraph._l(x4, y4);
MathControl.pGraph._l(x5, y5);
MathControl.pGraph._l(x6, y6);
MathControl.pGraph._l(x7, y7);
MathControl.pGraph.df();
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics._l(x3, y3);
pGraphics._l(x4, y4);
pGraphics._l(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.df();
}
......
......@@ -1327,7 +1327,8 @@ CDocument.prototype =
{
this.Document_UpdateRulersState();
//**
MathControl.UpdateCursor();
//MathControl.UpdateCursor();
MathComposition.UpdateCursor();
//this.RecalculateCurPos();
//**
//this.RecalculateCurPos();
......@@ -1458,7 +1459,9 @@ CDocument.prototype =
nPageIndex = this.CurPage;
if(nPageIndex === 0)
MathControl.Draw(pGraphics);
MathComposition.Draw(pGraphics);
//MathControl.Draw(pGraphics);
//DrawUnion();
//SetHeigthBracket(pGraphics);
......@@ -6756,7 +6759,8 @@ CDocument.prototype =
//**
Selection_Draw_Page: function()
{
MathControl.DrawSelect2();
//MathControl.DrawSelect2();
MathComposition.DrawSelect2();
},
//**
......@@ -8556,31 +8560,35 @@ CDocument.prototype =
//**
OnKeyDown : function(e)
{
var flag = MathControl.OnKeyDown(e);
this.Document_UpdateInterfaceState();
//var flag = MathControl.OnKeyDown(e);
var flag = MathComposition.OnKeyDown(e);
this.Document_UpdateInterfaceState(); // для Undo/Redo
return flag;
},
OnKeyPress : function(e)
{
var flag = MathControl.OnKeyPress(e);
this.Document_UpdateInterfaceState();
//var flag = MathControl.OnKeyPress(e);
var flag = MathComposition.OnKeyPress(e);
this.Document_UpdateInterfaceState(); // для Undo/Redo
return flag;
},
OnMouseDown : function(e, X, Y, PageIndex)
{
MathControl.OnMouseDown(X, Y);
//MathControl.OnMouseDown(X, Y);
MathComposition.OnMouseDown(X, Y);
},
OnMouseUp : function(e, X, Y, PageIndex)
{
MathControl.OnMouseUp();
//MathControl.OnMouseUp();
MathComposition.OnMouseUp();
},
OnMouseMove : function(e, X, Y, PageIndex)
{
MathControl.OnMouseMove(X, Y);
//MathControl.OnMouseMove(X, Y);
MathComposition.OnMouseMove(X, Y);
},
//**
......@@ -10063,11 +10071,13 @@ CDocument.prototype =
//**
Get_SelectionState : function()
{
return MathControl.Get_SelectionState();
//return MathControl.Get_SelectionState();
return MathComposition.Get_SelectionState();
},
Set_SelectionState : function(State)
{
MathControl.Set_SelectionState(State);
//MathControl.Set_SelectionState(State);
MathComposition.Set_SelectionState(State);
},
//**
......
This diff is collapsed.
......@@ -62,16 +62,16 @@ CFraction.prototype.getCenter = function()
return center;
}
CFraction.prototype.draw = function()
CFraction.prototype.draw = function(pGraphics)
{
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
this.drawBarFraction();
this.drawBarFraction(pGraphics);
else if(this.type == SKEWED_FRACTION)
this.drawSkewedFraction();
this.drawSkewedFraction(pGraphics);
else if(this.type == LINEAR_FRACTION)
this.drawLinearFraction();
this.drawLinearFraction(pGraphics);
}
CFraction.prototype.drawBarFraction = function()
CFraction.prototype.drawBarFraction = function(pGraphics)
{
var penW = this.getTxtPrp().FontSize* this.reduct* 25.4/96 * 0.08;
......@@ -81,14 +81,14 @@ CFraction.prototype.drawBarFraction = function()
if( !this.bHideBar )
{
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph.drawHorLine(0, y1, x1, x2, penW);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
CFraction.superclass.draw.call(this);
CFraction.superclass.draw.call(this, pGraphics);
}
CFraction.prototype.drawSkewedFraction = function()
CFraction.prototype.drawSkewedFraction = function(pGraphics)
{
var fontSize = this.getTxtPrp().FontSize;
var penW = fontSize/12.5*g_dKoef_pix_to_mm;
......@@ -165,18 +165,18 @@ CFraction.prototype.drawSkewedFraction = function()
}
MathControl.pGraph.p_width(penW*1000);
pGraphics.p_width(penW*1000);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(xx1, yy1);
MathControl.pGraph._l(xx2, yy2);
MathControl.pGraph.ds();
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(xx1, yy1);
pGraphics._l(xx2, yy2);
pGraphics.ds();
CFraction.superclass.draw.call(this);
CFraction.superclass.draw.call(this, pGraphics);
}
CFraction.prototype.drawLinearFraction = function()
CFraction.prototype.drawLinearFraction = function(pGraphics)
{
var first = this.elements[0][0].size,
sec = this.elements[0][1].size;
......@@ -194,17 +194,17 @@ CFraction.prototype.drawLinearFraction = function()
var penW = this.getTxtPrp().FontSize/12.5*g_dKoef_pix_to_mm;
MathControl.pGraph.p_width(penW*1000);
pGraphics.p_width(penW*1000);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph.ds();
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
CFraction.superclass.draw.call(this);
CFraction.superclass.draw.call(this, pGraphics);
}
CFraction.prototype.getNumerator = function()
{
......
......@@ -5777,11 +5777,11 @@ CMathContent.prototype =
this.recalculateSize();
},
draw: function()
draw: function(pGraphics)
{
if( !(this.plhHide && this.IsTarget()) )
for(var i=1; i < this.content.length;i++)
this.content[i].value.draw();
this.content[i].value.draw(pGraphics);
},
update_widthContent: function()
{
......@@ -6626,24 +6626,24 @@ CMathComposition.prototype =
this.TxtPrp.Italic = true;
this.TxtPrp.Bold = false;
},
Draw: function(context)
Draw: function(pGraphics)
{
if(this.Root.content.length > 1)
{
var w_Box = this.Root.size.width;
var h_Box = this.Root.size.height;
context.p_color(224, 238, 224, 255); // "p_color" for stroke
pGraphics.p_color(224, 238, 224, 255); // "p_color" for stroke
// "b_color1" for fill
//context.b_color1(224, 238, 230, 255);
context.drawHorLine(0, this.pos.y, this.pos.x, this.pos.x + w_Box, 0.2);
context.drawHorLine(0, this.pos.y + h_Box, this.pos.x, this.pos.x + w_Box, 0.2);
context.drawVerLine(0,this.pos.x, this.pos.y, this.pos.y + h_Box, 0.2 );
context.drawVerLine(0,this.pos.x + w_Box, this.pos.y, this.pos.y + h_Box, 0.2 );
pGraphics.drawHorLine(0, this.pos.y, this.pos.x, this.pos.x + w_Box, 0.2);
pGraphics.drawHorLine(0, this.pos.y + h_Box, this.pos.x, this.pos.x + w_Box, 0.2);
pGraphics.drawVerLine(0,this.pos.x, this.pos.y, this.pos.y + h_Box, 0.2 );
pGraphics.drawVerLine(0,this.pos.x + w_Box, this.pos.y, this.pos.y + h_Box, 0.2 );
}
this.Root.draw();
this.Root.draw(pGraphics);
},
Draw_2: function()
{
......@@ -6830,7 +6830,7 @@ CMathComposition.prototype =
this.ShowCursor();
},
CreateEquation: function(indef)
CreateEquation2: function(indef)
{
if(TEST)
{
......@@ -7071,6 +7071,18 @@ CMathComposition.prototype =
//test
// из MathControl
IsRect: function(x, y)
{
var size = this.Root.size;
return ( x > 0 && x < size.width && y > 0 && y < size.height);
},
GetCoordComp: function(x, y)
{
var _x = x - this.pos.x;
var _y = y - this.pos.y;
return {x: _x, y: _y};
},
OnKeyDown: function(e)
{
//стрелка вверх
......@@ -7159,7 +7171,7 @@ CMathComposition.prototype =
if(code>=0x0020 )
{
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
this..AddLetter(code);
this.AddLetter(code);
return true;
}
......@@ -7180,6 +7192,17 @@ CMathComposition.prototype =
if( this.IsRect(coord.x, coord.y) )
this.MouseMove(coord.x, coord.y);
},
OnMouseUp: function()
{
this.MouseUp();
},
CreateEquation: function(indef)
{
this.CreateEquation2(indef);
this.RecalculateReverse();
this.UpdatePosition();
}
}
function CEmpty()
......
......@@ -259,14 +259,14 @@ CMathText.prototype =
MathControl.pGraph.FillTextCode(xx, yy , this.getCode());
},
draw: function()
draw: function(pGraphics)
{
var txtPrp = new CMathTextPrp();
txtPrp.Merge(this.getTxtPrp());
txtPrp.Italic = false;
MathControl.pGraph.b_color1(0,0,0,255);
MathControl.pGraph.SetFont(txtPrp);
pGraphics.b_color1(0,0,0,255);
pGraphics.SetFont(txtPrp);
var X = this.pos.x ,
Y = this.pos.y;
......@@ -304,8 +304,8 @@ CMathText.prototype =
var y = (Y - x*shy - ty*shx)/sy;*/
MathControl.pGraph.transform(sx, shy, shx, sy, 0, 0);
MathControl.pGraph.FillTextCode(xx, yy , this.getCode());
pGraphics.transform(sx, shy, shx, sy, 0, 0);
pGraphics.FillTextCode(xx, yy , this.getCode());
},
setPosition: function( pos )
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ function CSignRadical()
this.sizeTick = null;
this.widthSlash = null;
}
CSignRadical.prototype.draw = function()
CSignRadical.prototype.draw = function(pGraphics)
{
var txtPrp = this.Parent.getTxtPrp();
var penW = txtPrp.FontSize*g_dKoef_pt_to_mm*0.042;
......@@ -51,29 +51,29 @@ CSignRadical.prototype.draw = function()
var y5 = this.pos.y,
y6 = this.pos.y;
MathControl.pGraph.p_width(penW*0.8*1000);
pGraphics.p_width(penW*0.8*1000);
MathControl.pGraph.p_color(0,0,0, 255);
MathControl.pGraph.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph.ds();
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
MathControl.pGraph.p_width(1.7*penW*1000);
MathControl.pGraph._s();
MathControl.pGraph._m(x3, y3);
MathControl.pGraph._l(x4, y4);
MathControl.pGraph.ds();
pGraphics.p_width(1.7*penW*1000);
pGraphics._s();
pGraphics._m(x3, y3);
pGraphics._l(x4, y4);
pGraphics.ds();
MathControl.pGraph.p_width(penW*1000);
MathControl.pGraph._s();
MathControl.pGraph._m(x4, y4);
MathControl.pGraph._l(x5, y5);
MathControl.pGraph._l(x6,y6);
MathControl.pGraph.ds();
pGraphics.p_width(penW*1000);
pGraphics._s();
pGraphics._m(x4, y4);
pGraphics._l(x5, y5);
pGraphics._l(x6,y6);
pGraphics.ds();
}
CSignRadical.prototype.recalculateSize = function()
......@@ -395,10 +395,10 @@ CRadical.prototype.findDisposition = function(mCoord)
return disposition;
}
CRadical.prototype.draw = function()
CRadical.prototype.draw = function(pGraphics)
{
this.signRadical.draw();
old_CDegreeRadical.superclass.draw.call(this);
this.signRadical.draw(pGraphics);
CRadical.superclass.draw.call(this, pGraphics);
}
CRadical.prototype.getBase = function()
{
......@@ -591,10 +591,10 @@ old_CDegreeRadical.prototype.setPosition = function(pos)
this.elements[0][1].setPosition({x: x3, y: y3});
}
old_CDegreeRadical.prototype.draw = function()
old_CDegreeRadical.prototype.draw = function(pGraphics)
{
this.signRadical.draw();
old_CDegreeRadical.superclass.draw.call(this);
old_CDegreeRadical.superclass.draw.call(this, pGraphics);
}
old_CDegreeRadical.prototype.findDisposition = function(mCoord)
{
......
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