$PBExportHeader$w_msg_fj_add_newstyle.srw forward global type w_msg_fj_add_newstyle from w_publ_base end type type dw_1 from datawindow within w_msg_fj_add_newstyle end type type cb_add from commandbutton within w_msg_fj_add_newstyle end type type cb_ok from commandbutton within w_msg_fj_add_newstyle end type type st_no_fj from statictext within w_msg_fj_add_newstyle end type end forward global type w_msg_fj_add_newstyle from w_publ_base integer width = 2405 integer height = 1616 string title = "消息附件" boolean minbox = false windowtype windowtype = response! long backcolor = 67108864 event ue_fj_del ( ) dw_1 dw_1 cb_add cb_add cb_ok cb_ok st_no_fj st_no_fj end type global w_msg_fj_add_newstyle w_msg_fj_add_newstyle type variables s_msg_newstyle s_open end variables event ue_fj_del();Long lrow Long ls_i,ls_j = 0 Blob ls_filedata[] lrow = dw_1.GetRow() IF lrow <= 0 THEN MessageBox('系统提示','请先选择目标!') RETURN END IF if messagebox('系统提示','确定要删除当前附件吗?',question!,yesno!) = 2 then return dw_1.DeleteRow(lrow) st_no_fj.visible = (dw_1.rowcount() = 0) end event on w_msg_fj_add_newstyle.create int iCurrent call super::create this.dw_1=create dw_1 this.cb_add=create cb_add this.cb_ok=create cb_ok this.st_no_fj=create st_no_fj iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_1 this.Control[iCurrent+2]=this.cb_add this.Control[iCurrent+3]=this.cb_ok this.Control[iCurrent+4]=this.st_no_fj end on on w_msg_fj_add_newstyle.destroy call super::destroy destroy(this.dw_1) destroy(this.cb_add) destroy(this.cb_ok) destroy(this.st_no_fj) end on event open;call super::open;s_open = message.powerobjectparm long i long ll_row dw_1.setredraw(false) for i = 1 to UpperBound(s_open.arg_s_fj) ll_row = dw_1.insertrow(0) dw_1.object.fjname[ll_row] = s_open.arg_s_fj[i].fjname dw_1.object.fjpath[ll_row] = s_open.arg_s_fj[i].fjpath dw_1.object.filetype[ll_row] = s_open.arg_s_fj[i].filetype next dw_1.setredraw(true) st_no_fj.visible = (dw_1.rowcount() = 0) end event event close;call super::close;closewithreturn(this,s_open) end event type cb_func from w_publ_base`cb_func within w_msg_fj_add_newstyle boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_msg_fj_add_newstyle boolean visible = false end type type dw_1 from datawindow within w_msg_fj_add_newstyle integer x = 14 integer y = 8 integer width = 2368 integer height = 1400 integer taborder = 20 boolean bringtotop = true string title = "none" string dataobject = "dw_msg_mt_fj" boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = StyleBox! end type event clicked;if row > 0 then this.setrow(row) if dwo.name = 'del' then parent.triggerevent('ue_fj_del') end if end if end event type cb_add from commandbutton within w_msg_fj_add_newstyle integer x = 635 integer y = 1416 integer width = 407 integer height = 100 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;// //ue_selectfile String Pathname,Filename,FileType Integer i Long row FileType = '' FileType = '所有文件(*.*),*.*,' // FileType += "配置文件(*.ini), *.ini," FileType += "Zip压缩文件(*.Zip),*.Zip," FileType += "RAR压缩文件(*.rar),*.rar," // FileType += "XML文件(*.xml),*.xml," FileType += "文本文件(*.txt),*.txt," FileType += "Excel模版(*.xlt),*.xlt," // FileType += "Excel文档(*.xls),*.xls," // FileType += "Word模版(*.dot),*.dot," FileType += "Word文档(*.doc),*.doc," FileType += "JPG(*.JPG),*.JPG," FileType += "位图文件(*.bmp),*.bmp," FileType += "GIF文件(*.GIF),*.GIF" i = GetFileOpenName("请选择文件", Pathname,Filename, "All", FileType) If i = 1 And Trim(Pathname) <> '' And Trim(Filename) <> "" Then If Pathname = '' Or Not FileExists(Pathname) Then MessageBox('系统提示','请选择文件!') Return End If // If FileLength(Pathname)/1024 > 10240 Then // MessageBox('限制','附件文件大小不得大于10M') // Return // End If row = dw_1.InsertRow(0) dw_1.Object.fjpath[row] = Pathname Long poi = 0,Begin = 1 Begin = Pos(Filename,'.',1) Do While Begin > 0 poi = Begin Begin = Pos(Filename,'.',Begin + 1) Loop If poi > 0 Then dw_1.Object.fjname[row] = Filename //Mid(Filename,1,poi -1) dw_1.Object.FileType[row] = Mid(Filename,poi +1,Len(Filename) - poi) Else dw_1.Object.fjname[row] = Filename dw_1.Object.FileType[row] = '' End If End If st_no_fj.visible = (dw_1.rowcount() = 0) end event type cb_ok from commandbutton within w_msg_fj_add_newstyle integer x = 1335 integer y = 1416 integer width = 407 integer height = 100 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "确定" end type event clicked;s_msg_fj arg_s_fj[] long i for i = 1 to dw_1.rowcount() arg_s_fj[i].fjpath = dw_1.object.fjpath[i] arg_s_fj[i].fjname = dw_1.object.fjname[i] arg_s_fj[i].filetype = dw_1.object.filetype[i] next s_open.arg_s_fj = arg_s_fj close(parent) end event type st_no_fj from statictext within w_msg_fj_add_newstyle integer x = 823 integer y = 420 integer width = 754 integer height = 104 boolean bringtotop = true integer textsize = -15 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = fixed! fontfamily fontfamily = modern! string facename = "黑体" long textcolor = 8421504 string text = "没有附件,请上传" boolean focusrectangle = false end type