$PBExportHeader$w_cmpl_formula_edit.srw forward global type w_cmpl_formula_edit from w_publ_base end type type cb_1 from uo_imflatbutton within w_cmpl_formula_edit end type type cb_2 from commandbutton within w_cmpl_formula_edit end type type cb_3 from commandbutton within w_cmpl_formula_edit end type type cb_4 from commandbutton within w_cmpl_formula_edit end type type cb_5 from commandbutton within w_cmpl_formula_edit end type type cb_6 from commandbutton within w_cmpl_formula_edit end type type cb_7 from commandbutton within w_cmpl_formula_edit end type type cb_8 from commandbutton within w_cmpl_formula_edit end type type cb_9 from commandbutton within w_cmpl_formula_edit end type type cb_10 from commandbutton within w_cmpl_formula_edit end type type cb_11 from commandbutton within w_cmpl_formula_edit end type type cb_13 from commandbutton within w_cmpl_formula_edit end type type cb_14 from commandbutton within w_cmpl_formula_edit end type type cb_15 from commandbutton within w_cmpl_formula_edit end type type cb_16 from commandbutton within w_cmpl_formula_edit end type type cb_17 from commandbutton within w_cmpl_formula_edit end type type cb_12 from commandbutton within w_cmpl_formula_edit end type type cb_18 from commandbutton within w_cmpl_formula_edit end type type cb_19 from commandbutton within w_cmpl_formula_edit end type type cb_20 from commandbutton within w_cmpl_formula_edit end type type cb_21 from commandbutton within w_cmpl_formula_edit end type type st_2 from statictext within w_cmpl_formula_edit end type type sle_1 from u_sleedit within w_cmpl_formula_edit end type type cb_25 from commandbutton within w_cmpl_formula_edit end type type cb_26 from commandbutton within w_cmpl_formula_edit end type type dw_1 from u_dw_rbtnfilter within w_cmpl_formula_edit end type type st_1 from statictext within w_cmpl_formula_edit end type type sle_rslt from singlelineedit within w_cmpl_formula_edit end type end forward global type w_cmpl_formula_edit from w_publ_base integer width = 1824 integer height = 1136 string title = "公式设定" boolean minbox = false windowtype windowtype = response! cb_1 cb_1 cb_2 cb_2 cb_3 cb_3 cb_4 cb_4 cb_5 cb_5 cb_6 cb_6 cb_7 cb_7 cb_8 cb_8 cb_9 cb_9 cb_10 cb_10 cb_11 cb_11 cb_13 cb_13 cb_14 cb_14 cb_15 cb_15 cb_16 cb_16 cb_17 cb_17 cb_12 cb_12 cb_18 cb_18 cb_19 cb_19 cb_20 cb_20 cb_21 cb_21 st_2 st_2 sle_1 sle_1 cb_25 cb_25 cb_26 cb_26 dw_1 dw_1 st_1 st_1 sle_rslt sle_rslt end type global w_cmpl_formula_edit w_cmpl_formula_edit type variables string ins_rslt = 'NULL' // 按取消键返回 end variables forward prototypes public subroutine wf_cmp () end prototypes public subroutine wf_cmp (); String ls_msg s_cmpl_parm arg_cmpl decimal ld_qty dw_1.accepttext() long i for i = 1 to dw_1.RowCount() arg_cmpl.parmname[i] = dw_1.object.parmname[i] arg_cmpl.parmvalue[i] = dw_1.object.parmvalue[i] next ld_qty = 0 if f_cmpl_with_parms(sle_1.text,arg_cmpl, ld_qty,ls_msg) = 0 then MessageBox('提示',ls_msg, Information!, OK! ) RETURN END IF sle_rslt.Text = String(ld_qty,'###,####,###0.######') end subroutine on w_cmpl_formula_edit.create int iCurrent call super::create this.cb_1=create cb_1 this.cb_2=create cb_2 this.cb_3=create cb_3 this.cb_4=create cb_4 this.cb_5=create cb_5 this.cb_6=create cb_6 this.cb_7=create cb_7 this.cb_8=create cb_8 this.cb_9=create cb_9 this.cb_10=create cb_10 this.cb_11=create cb_11 this.cb_13=create cb_13 this.cb_14=create cb_14 this.cb_15=create cb_15 this.cb_16=create cb_16 this.cb_17=create cb_17 this.cb_12=create cb_12 this.cb_18=create cb_18 this.cb_19=create cb_19 this.cb_20=create cb_20 this.cb_21=create cb_21 this.st_2=create st_2 this.sle_1=create sle_1 this.cb_25=create cb_25 this.cb_26=create cb_26 this.dw_1=create dw_1 this.st_1=create st_1 this.sle_rslt=create sle_rslt iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_1 this.Control[iCurrent+2]=this.cb_2 this.Control[iCurrent+3]=this.cb_3 this.Control[iCurrent+4]=this.cb_4 this.Control[iCurrent+5]=this.cb_5 this.Control[iCurrent+6]=this.cb_6 this.Control[iCurrent+7]=this.cb_7 this.Control[iCurrent+8]=this.cb_8 this.Control[iCurrent+9]=this.cb_9 this.Control[iCurrent+10]=this.cb_10 this.Control[iCurrent+11]=this.cb_11 this.Control[iCurrent+12]=this.cb_13 this.Control[iCurrent+13]=this.cb_14 this.Control[iCurrent+14]=this.cb_15 this.Control[iCurrent+15]=this.cb_16 this.Control[iCurrent+16]=this.cb_17 this.Control[iCurrent+17]=this.cb_12 this.Control[iCurrent+18]=this.cb_18 this.Control[iCurrent+19]=this.cb_19 this.Control[iCurrent+20]=this.cb_20 this.Control[iCurrent+21]=this.cb_21 this.Control[iCurrent+22]=this.st_2 this.Control[iCurrent+23]=this.sle_1 this.Control[iCurrent+24]=this.cb_25 this.Control[iCurrent+25]=this.cb_26 this.Control[iCurrent+26]=this.dw_1 this.Control[iCurrent+27]=this.st_1 this.Control[iCurrent+28]=this.sle_rslt end on on w_cmpl_formula_edit.destroy call super::destroy destroy(this.cb_1) destroy(this.cb_2) destroy(this.cb_3) destroy(this.cb_4) destroy(this.cb_5) destroy(this.cb_6) destroy(this.cb_7) destroy(this.cb_8) destroy(this.cb_9) destroy(this.cb_10) destroy(this.cb_11) destroy(this.cb_13) destroy(this.cb_14) destroy(this.cb_15) destroy(this.cb_16) destroy(this.cb_17) destroy(this.cb_12) destroy(this.cb_18) destroy(this.cb_19) destroy(this.cb_20) destroy(this.cb_21) destroy(this.st_2) destroy(this.sle_1) destroy(this.cb_25) destroy(this.cb_26) destroy(this.dw_1) destroy(this.st_1) destroy(this.sle_rslt) end on event open;call super::open;s_cmpl_parm s_parm s_parm = message.powerobjectparm long i, ll_row sle_1.Text = s_parm.oldformula for i = 1 to upperbound(s_parm.parmname) ll_row = dw_1.insertrow(0) dw_1.object.parmname[ll_row] = s_parm.parmname[i] dw_1.object.displayname[ll_row] = s_parm.displayname[i] dw_1.object.parmvalue[ll_row] = s_parm.parmvalue[i] next end event event close;call super::close;closewithreturn(this, ins_rslt) end event type cb_func from w_publ_base`cb_func within w_cmpl_formula_edit boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_cmpl_formula_edit integer x = 1440 integer y = 908 integer width = 343 integer taborder = 50 end type type cb_1 from uo_imflatbutton within w_cmpl_formula_edit integer x = 1038 integer y = 908 integer width = 343 integer height = 96 integer taborder = 40 boolean bringtotop = true string normalpicname = "ok.bmp" end type event clicked;call super::clicked;ins_rslt = sle_1.text close(parent) end event type cb_2 from commandbutton within w_cmpl_formula_edit integer x = 814 integer y = 396 integer width = 165 integer height = 104 integer taborder = 70 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "7" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_3 from commandbutton within w_cmpl_formula_edit integer x = 1015 integer y = 396 integer width = 165 integer height = 104 integer taborder = 80 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "8" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_4 from commandbutton within w_cmpl_formula_edit integer x = 1015 integer y = 524 integer width = 165 integer height = 104 integer taborder = 130 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "5" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_5 from commandbutton within w_cmpl_formula_edit integer x = 814 integer y = 524 integer width = 165 integer height = 104 integer taborder = 90 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "4" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_6 from commandbutton within w_cmpl_formula_edit integer x = 1216 integer y = 396 integer width = 165 integer height = 104 integer taborder = 100 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "9" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_7 from commandbutton within w_cmpl_formula_edit integer x = 1417 integer y = 396 integer width = 165 integer height = 104 integer taborder = 140 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "/" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_8 from commandbutton within w_cmpl_formula_edit integer x = 1417 integer y = 524 integer width = 165 integer height = 104 integer taborder = 200 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "*" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_9 from commandbutton within w_cmpl_formula_edit integer x = 1216 integer y = 524 integer width = 165 integer height = 104 integer taborder = 150 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "6" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_10 from commandbutton within w_cmpl_formula_edit integer x = 814 integer y = 652 integer width = 165 integer height = 104 integer taborder = 110 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "1" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_11 from commandbutton within w_cmpl_formula_edit integer x = 1015 integer y = 652 integer width = 165 integer height = 104 integer taborder = 160 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "2" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_13 from commandbutton within w_cmpl_formula_edit integer x = 814 integer y = 780 integer width = 165 integer height = 104 integer taborder = 170 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "0" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_14 from commandbutton within w_cmpl_formula_edit integer x = 1216 integer y = 652 integer width = 165 integer height = 104 integer taborder = 180 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "3" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_15 from commandbutton within w_cmpl_formula_edit integer x = 1417 integer y = 652 integer width = 165 integer height = 104 integer taborder = 210 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "-" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_16 from commandbutton within w_cmpl_formula_edit integer x = 1417 integer y = 780 integer width = 165 integer height = 104 integer taborder = 250 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "+" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_17 from commandbutton within w_cmpl_formula_edit integer x = 1015 integer y = 780 integer width = 165 integer height = 104 integer taborder = 220 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "." end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_12 from commandbutton within w_cmpl_formula_edit integer x = 1618 integer y = 780 integer width = 165 integer height = 104 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "=" end type event clicked;wf_cmp() cb_1.SetFocus() end event type cb_18 from commandbutton within w_cmpl_formula_edit integer x = 1618 integer y = 524 integer width = 165 integer height = 104 integer taborder = 260 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "(" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_19 from commandbutton within w_cmpl_formula_edit integer x = 1618 integer y = 652 integer width = 165 integer height = 104 integer taborder = 290 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = ")" end type event clicked;string ls_temp ls_temp = this.text sle_1.replacetext(ls_temp) sle_1.setfocus() end event type cb_20 from commandbutton within w_cmpl_formula_edit integer x = 1618 integer y = 396 integer width = 165 integer height = 104 integer taborder = 230 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "C" end type event clicked;sle_1.text = '' end event type cb_21 from commandbutton within w_cmpl_formula_edit integer x = 1216 integer y = 780 integer width = 165 integer height = 104 integer taborder = 270 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "BS" end type event clicked;sle_1.text = mid(sle_1.text,1,len(sle_1.text) - 1) end event type st_2 from statictext within w_cmpl_formula_edit integer x = 1262 integer y = 316 integer width = 535 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 255 long backcolor = 67108864 string text = "说明:C-清除,BS-退格" boolean focusrectangle = false end type type sle_1 from u_sleedit within w_cmpl_formula_edit integer x = 41 integer y = 100 integer width = 1755 integer taborder = 20 boolean bringtotop = true boolean autohscroll = true end type type cb_25 from commandbutton within w_cmpl_formula_edit boolean visible = false integer x = 41 integer width = 165 integer height = 88 integer taborder = 140 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "选择" end type event clicked;Open(w_formula_edit) String ls_temp ls_temp = Message.StringParm IF ls_temp <> '' THEN sle_1.Text = ls_temp END IF end event type cb_26 from commandbutton within w_cmpl_formula_edit boolean visible = false integer x = 206 integer width = 165 integer height = 88 integer taborder = 150 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "保存" end type event clicked;Long ll_newid String ls_formula,errmsg Long rslt = 1 ls_formula = Trim(sle_1.Text) ll_newid = f_sys_scidentity(0,"u_formula_def","formulaid",errmsg,FALSE,sqlca) IF ll_newid <= 0 THEN rslt = 0 GOTO ext ELSE INSERT INTO u_formula_def ( formulaid, content ) VALUES ( :ll_newid, :ls_formula ) ; IF sqlca.SQLCode <> 0 THEN errmsg = '插入公式失败' rslt = 0 GOTO ext END IF END IF ext: IF rslt = 0 THEN ROLLBACK; MessageBox('错误',errmsg,stopsign!,OK!) ELSE COMMIT; MessageBox('提示',"保存成功!", Information!, OK! ) END IF end event type dw_1 from u_dw_rbtnfilter within w_cmpl_formula_edit integer x = 32 integer y = 216 integer width = 750 integer height = 832 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_cmpl_parm" boolean hscrollbar = true boolean vscrollbar = true end type event doubleclicked;call super::doubleclicked;if row <= 0 then return string ls_temp ls_temp = '[' + this.object.parmname[row] + ']' sle_1.replacetext(ls_temp) sle_1.setfocus() end event type st_1 from statictext within w_cmpl_formula_edit integer x = 1330 integer y = 224 integer width = 55 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "=" boolean focusrectangle = false end type type sle_rslt from singlelineedit within w_cmpl_formula_edit integer x = 1394 integer y = 208 integer width = 402 integer height = 84 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type