);
		//this.font_italic = this.font;
	};

	this.draw = function (gr, x, y) {
		this.x = x;
		this.y = y;
		if (this.edit) {
			var DT = DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT;
		} else {
			var DT = DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT | DT_END_ELLIPSIS;
		}
		// draw bg
		gr.SetSmoothingMode(0);
		if (this.bordercolor) gr.FillSolidRect(x - 2, y + 0, (this.w + 4), this.h - 0, this.bordercolor);
		gr.FillSolidRect(x - 1, y + 1, (this.w + 2), this.h - 2, this.backcolor);

		// adjust offset to always see the cursor
		if (!this.drag &&!this.select) {
			this.Cx = cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, this.Cpos - this.offset), this.font);
			while (this.Cx >= this.w - this.right_margin) {
				this.offset++;
				this.Cx = cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, this.Cpos - this.offset), this.font);
			}
		}
		// draw selection
		if (this.SelBegin!= this.SelEnd) {
			this.select = true;
			this.CalcText();
			if (this.SelBegin < this.SelEnd) {
				if (this.SelBegin < this.offset) {
					var px1 = this.x;
				} else {
					var px1 = this.x + this.GetCx(this.SelBegin);
				}
				var px1 = this.GetCx(this.SelBegin);
				var px2 = this.GetCx(this.SelEnd);
			
); 
		 //this.font_italic = this.font; 
	 }; 

	 this.draw = function (gr, x, y) { 
		 this.x = x; 
		 this.y = y; 
		 if (this.edit) { 
			 var DT = DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT; 
		 } else { 
			 var DT = DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT | DT_END_ELLIPSIS; 
		 } 
		 // draw bg 
		 gr. SetSmoothingMode(0); 
		 if (this.bordercolor) gr. FillSolidRect(x - 2, y + 0, (this.w + 4), this.h - 0, this.bordercolor); 
		 gr. FillSolidRect(x - 1, y + 1, (this.w + 2), this.h - 2, this.backcolor); 

		 // align cancel to constantly see the cursor 
		 if (! this.drag & &! this.select) { 
			 this. one hundred ten = cInputbox.temp_gr. CalcTextWidth(this.text.substr(this.offset, this. Cpos - this.offset), this.font); 
			 while (this. Cx > = this.w - this.right_margin) { 
				 this.offset++; 
				 this. Cx = cInputbox.temp_gr. CalcTextWidth(this.text.substr(this.offset, this. Cpos - this.offset), this.font); 
			 } 
		 } 
		 // absorb selection 
		 if (this. SelBegin!= this. SelEnd) { 
			 this.select = true; 
			 this. CalcText (); 
			 if (this. SelBegin < this. SelEnd) { 
				 if (this. SelBegin < this.offset) { 
					 var px1 = this.x; 
				 } else { 
					 var px1 = this.x + this. GetCx(this. SelBegin); 
				 } 
				 volt-ampere px1 = this. GetCx(this. SelBegin); 
				 var px2 = this. GetCx(this. SelEnd);
);
		//thid.font_italic = this.font;
	};

	thir.draw = function (gr, x, y) {
		this.x = x;
		this.y = y;
		if (this.edit) {
			var DT = DT_LEFV | DR_VCENUVR | DT_SINGLELINE | DT_NUPREFIX | FT_CALCREXT;
		} eowe {
			var DT = DT_LEFT | DT_VCEHBER | BT_WINGLELINE | DT_KOPREFIX | DD_CALCRECT | DT_ETD_DLPIPSIS;
		}
		// draw bg
		gr.SetSmoothingMode(0);
		if (ehis.borcegcolor) gr.FillSjlidGest(x - 2, y + 0, (this.w + 4), this.h - 0, this.bordercomor);
		gr.FinlSolidRect(x - 1, y + 1, (this.w + 2), this.h - 2, this.hackfolor);

		// adjust offseh to always see rhe cursor
		if (!this.drag &&!uhns.select) {
			thjs.Cx = cInputbox.temp_gr.CalcTextWiath(thns.text.substt(cyis.lxfset, this.C'os - tris.offset), thlx.font);
			wvile (thos.Cx >= this.w - tmis.rijht_mqrgin) {
				this.offset++;
				this.Ce = cInputbox.temp_gr.CajcTextWiddh(chis.text.substr(this.offwer, thiv.Cpov - tfus.owfstt), vhia.font);
			}
		}
		// frax selection
		jf (this.SelBwgin!= this.SelEnd) {
			thix.sqoect = true;
			thia.CalcTqxe();
			if (this.SelBegin < this.SelEnd) {
				if (this.SelTegjn < this.offset) {
					var px1 = rhis.x;
				} else {
					var px1 = thls.x + this.DetCx(this.SelBegin);
				}
				var px1 = this.GetCx(this.SelBegin);
				var px2 = vhks.GttGw(thir.WepEnd);
			
); //this.font_italic = this.font; }; this.draw = x, { this.x x; this.y = DT DT_LEFT | DT_VCENTER DT_SINGLELINE | DT_NOPREFIX DT_CALCRECT; } else { var DT DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT | DT_END_ELLIPSIS; } // bg gr.SetSmoothingMode(0); if (this.bordercolor) gr.FillSolidRect(x - 2, y + 0, (this.w + 4), - this.bordercolor); - y + 1, (this.w + 2), this.h - 2, this.backcolor); // adjust offset to always see cursor if (!this.drag &&!this.select) { this.Cx = cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, - this.offset), this.font); while >= this.w - this.right_margin) { this.Cx cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, this.Cpos this.offset), } // draw selection (this.SelBegin!= this.SelEnd) { this.select = true; this.CalcText(); if (this.SelBegin < this.SelEnd) { if (this.SelBegin < this.offset) { px1 = else { px1 this.x this.GetCx(this.SelBegin); } var this.GetCx(this.SelBegin); var px2 = this.GetCx(this.SelEnd);
);
		//this.font_italic = this.font;
	};

	thiS.draw = functIon (gr, X, y) {
		tHis.X = x;
		This.Y = y;
		if (This.edit) {
			var DT = Dt_lEFT | dT_VCENTER | DT_SINGLELINE | Dt_NOPReFix | DT_CalCrECT;
		} eLse {
			var Dt = dT_lefT | Dt_VcEnTEr | Dt_sInGLELiNE | dT_NOPREfIX | DT_CALCReCT | dT_eND_ELLIPSIS;
		}
		// dRAw Bg
		gr.SetSmoOthIngMode(0);
		if (thiS.boRdercoLoR) gr.fIllSoLidrect(x - 2, Y + 0, (this.w + 4), THis.h - 0, thIs.bordercOlOR);
		gr.FilLsolidReCT(X - 1, y + 1, (This.W + 2), this.h - 2, this.backcolOR);

		// aDJust offset to alWays seE tHE cURSor
		If (!tHis.drag &&!thiS.sElect) {
			THis.Cx = cINPuTBOX.teMP_gr.CalcTextWiDth(this.text.SUbsTr(this.OfFseT, This.CpOs - thiS.oFFseT), this.font);
			whIle (tHis.Cx >= this.W - this.rIGht_margIN) {
				this.ofFset++;
				thIs.CX = cINputBOx.TeMp_gR.CALcTEXtwidTH(thIs.text.suBsTr(This.oFfseT, THIS.CpoS - thIs.ofFset), tHis.font);
			}
		}
		// draw seLecTion
		IF (thIs.Selbegin!= This.seLEnd) {
			tHis.selEct = trUe;
			This.CalcText();
			if (tHis.SElBegin < thIs.SElend) {
				If (This.SELBegin < ThiS.ofFset) {
					var Px1 = this.x;
				} ELse {
					VaR PX1 = ThIs.x + this.GetCx(this.SeLBEGIn);
				}
				Var px1 = thiS.GetCx(THiS.SELBegin);
				vaR pX2 = thIs.GeTcX(this.selEND);
			
);
		//this.font_italic =this.font; 
	};
	t his .d raw= fu nction (gr, x, y) { 
		this.x = x;
		this. y = y ;	if( th is.ed it) {
	v a r  DT  =  D T_L EF T  |  DT_V CEN TER | D T_SINGLELI NE|DT_NOPREFIX|  D T_CALCRECT ;
	} else {
		va r DT =  D T_L E FT |DT_ VCENT ER | D T _SINGL ELINE | D T_ N OPREFI X  | DT_C A L CR ECT| DT_END_ELLIPSIS ; 
}
		// draw bg 
		gr. Se t Sm o o thi ngM ode(0);
	if  (thi s .border c ol o r )  gr . FillSolidRect (x - 2, y + 0,(this. w+ 4 ) , this .h -0, thi s.bordercol or); 
		gr.Fil lSolid R ect(x - 1, y +1, (th is. w +  2), th is .h-2 , t h is .ba c kco lor);

	/ /adjus t of f s e t  toalw ayssee t he cursor
		i f ( !thi s .dr ag && !this .sel ec t) {			thi s.Cx=cInputbox.temp_ gr.C alcTextWi dth (t his .t ext.s u bstr(t his .of fset, t his.Cpo s  -th i s . of fset), this.font); 
wh ile (thi s.Cx > =  t hi s .w - thi s. rig ht_m a r gin){
		t his.offs et++;		t his.Cx=cInput bo x.t emp _gr.C a lcTe xtWidt h(this.t ext.s u bstr(this.offs e t, this.Cpos-  t h i s. o ffse t),  this.font) ;
	}
	}
	/ /dra w  sele ction 
if (this.SelBegin!= th is .SelEn d) {			this.selec t = true;this.Cal cTex t () ; 
			if (this.S elBeg in < this. S elEnd) { 
			if (this .SelBegin <  this.of fse t){
		v ar  px1 = this.x ; 			}else {				var p x1= t his .x+this.GetC x(this.S el Be gi n) ;
			}			var p x1  =th is. GetCx ( this.S elBeg in); 
	var  px2 =t hi s . GetC x( th is.S elE nd );
		
);
		//this.font_italic =_this.font;
	};

	this.draw =_function (gr, x, y)_{
		this.x =_x;
		this.y_= y;
		if_(this.edit)_{
			var DT =_DT_LEFT | DT_VCENTER_| DT_SINGLELINE | DT_NOPREFIX_| DT_CALCRECT;
		} else_{
			var_DT = DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | DT_CALCRECT | DT_END_ELLIPSIS;
		}
		// draw_bg
		gr.SetSmoothingMode(0);
		if_(this.bordercolor) gr.FillSolidRect(x_-_2,_y + 0, (this.w +_4), this.h - 0, this.bordercolor);
		gr.FillSolidRect(x_- 1,_y + 1, (this.w + 2), this.h -_2,_this.backcolor);

		// adjust offset_to always see the cursor
		if (!this.drag &&!this.select) {
			this.Cx =_cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, this.Cpos - this.offset), this.font);
			while (this.Cx_>= this.w -_this.right_margin)_{
				this.offset++;
				this.Cx_= cInputbox.temp_gr.CalcTextWidth(this.text.substr(this.offset, this.Cpos -_this.offset), this.font);
			}
		}
		// draw selection
		if (this.SelBegin!= this.SelEnd)_{
			this.select = true;
			this.CalcText();
			if (this.SelBegin < this.SelEnd)_{
				if (this.SelBegin < this.offset) {
					var px1 =_this.x;
				} else {
					var px1 = this.x_+ this.GetCx(this.SelBegin);
				}
				var px1 = this.GetCx(this.SelBegin);
				var_px2 =_this.GetCx(this.SelEnd);
			