w_msg_fj_add_newstyle.srw 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. $PBExportHeader$w_msg_fj_add_newstyle.srw
  2. forward
  3. global type w_msg_fj_add_newstyle from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_msg_fj_add_newstyle
  6. end type
  7. type cb_add from commandbutton within w_msg_fj_add_newstyle
  8. end type
  9. type cb_ok from commandbutton within w_msg_fj_add_newstyle
  10. end type
  11. type st_no_fj from statictext within w_msg_fj_add_newstyle
  12. end type
  13. end forward
  14. global type w_msg_fj_add_newstyle from w_publ_base
  15. integer width = 2405
  16. integer height = 1616
  17. string title = "消息附件"
  18. boolean minbox = false
  19. windowtype windowtype = response!
  20. long backcolor = 67108864
  21. event ue_fj_del ( )
  22. dw_1 dw_1
  23. cb_add cb_add
  24. cb_ok cb_ok
  25. st_no_fj st_no_fj
  26. end type
  27. global w_msg_fj_add_newstyle w_msg_fj_add_newstyle
  28. type variables
  29. s_msg_newstyle s_open
  30. end variables
  31. event ue_fj_del();Long lrow
  32. Long ls_i,ls_j = 0
  33. Blob ls_filedata[]
  34. lrow = dw_1.GetRow()
  35. IF lrow <= 0 THEN
  36. MessageBox('系统提示','请先选择目标!')
  37. RETURN
  38. END IF
  39. if messagebox('系统提示','确定要删除当前附件吗?',question!,yesno!) = 2 then return
  40. dw_1.DeleteRow(lrow)
  41. st_no_fj.visible = (dw_1.rowcount() = 0)
  42. end event
  43. on w_msg_fj_add_newstyle.create
  44. int iCurrent
  45. call super::create
  46. this.dw_1=create dw_1
  47. this.cb_add=create cb_add
  48. this.cb_ok=create cb_ok
  49. this.st_no_fj=create st_no_fj
  50. iCurrent=UpperBound(this.Control)
  51. this.Control[iCurrent+1]=this.dw_1
  52. this.Control[iCurrent+2]=this.cb_add
  53. this.Control[iCurrent+3]=this.cb_ok
  54. this.Control[iCurrent+4]=this.st_no_fj
  55. end on
  56. on w_msg_fj_add_newstyle.destroy
  57. call super::destroy
  58. destroy(this.dw_1)
  59. destroy(this.cb_add)
  60. destroy(this.cb_ok)
  61. destroy(this.st_no_fj)
  62. end on
  63. event open;call super::open;s_open = message.powerobjectparm
  64. long i
  65. long ll_row
  66. dw_1.setredraw(false)
  67. for i = 1 to UpperBound(s_open.arg_s_fj)
  68. ll_row = dw_1.insertrow(0)
  69. dw_1.object.fjname[ll_row] = s_open.arg_s_fj[i].fjname
  70. dw_1.object.fjpath[ll_row] = s_open.arg_s_fj[i].fjpath
  71. dw_1.object.filetype[ll_row] = s_open.arg_s_fj[i].filetype
  72. next
  73. dw_1.setredraw(true)
  74. st_no_fj.visible = (dw_1.rowcount() = 0)
  75. end event
  76. event close;call super::close;closewithreturn(this,s_open)
  77. end event
  78. type cb_func from w_publ_base`cb_func within w_msg_fj_add_newstyle
  79. boolean visible = false
  80. end type
  81. type cb_exit from w_publ_base`cb_exit within w_msg_fj_add_newstyle
  82. boolean visible = false
  83. end type
  84. type dw_1 from datawindow within w_msg_fj_add_newstyle
  85. integer x = 14
  86. integer y = 8
  87. integer width = 2368
  88. integer height = 1400
  89. integer taborder = 20
  90. boolean bringtotop = true
  91. string title = "none"
  92. string dataobject = "dw_msg_mt_fj"
  93. boolean vscrollbar = true
  94. boolean livescroll = true
  95. borderstyle borderstyle = StyleBox!
  96. end type
  97. event clicked;if row > 0 then
  98. this.setrow(row)
  99. if dwo.name = 'del' then
  100. parent.triggerevent('ue_fj_del')
  101. end if
  102. end if
  103. end event
  104. type cb_add from commandbutton within w_msg_fj_add_newstyle
  105. integer x = 635
  106. integer y = 1416
  107. integer width = 407
  108. integer height = 100
  109. integer taborder = 30
  110. boolean bringtotop = true
  111. integer textsize = -9
  112. integer weight = 400
  113. fontcharset fontcharset = gb2312charset!
  114. fontpitch fontpitch = variable!
  115. string facename = "宋体"
  116. string text = "添加附件"
  117. end type
  118. event clicked;// //ue_selectfile
  119. String Pathname,Filename,FileType
  120. Integer i
  121. Long row
  122. FileType = ''
  123. FileType = '所有文件(*.*),*.*,'
  124. // FileType += "配置文件(*.ini), *.ini,"
  125. FileType += "Zip压缩文件(*.Zip),*.Zip,"
  126. FileType += "RAR压缩文件(*.rar),*.rar,"
  127. // FileType += "XML文件(*.xml),*.xml,"
  128. FileType += "文本文件(*.txt),*.txt,"
  129. FileType += "Excel模版(*.xlt),*.xlt,"
  130. // FileType += "Excel文档(*.xls),*.xls,"
  131. // FileType += "Word模版(*.dot),*.dot,"
  132. FileType += "Word文档(*.doc),*.doc,"
  133. FileType += "JPG(*.JPG),*.JPG,"
  134. FileType += "位图文件(*.bmp),*.bmp,"
  135. FileType += "GIF文件(*.GIF),*.GIF"
  136. i = GetFileOpenName("请选择文件", Pathname,Filename, "All", FileType)
  137. If i = 1 And Trim(Pathname) <> '' And Trim(Filename) <> "" Then
  138. If Pathname = '' Or Not FileExists(Pathname) Then
  139. MessageBox('系统提示','请选择文件!')
  140. Return
  141. End If
  142. // If FileLength(Pathname)/1024 > 10240 Then
  143. // MessageBox('限制','附件文件大小不得大于10M')
  144. // Return
  145. // End If
  146. row = dw_1.InsertRow(0)
  147. dw_1.Object.fjpath[row] = Pathname
  148. Long poi = 0,Begin = 1
  149. Begin = Pos(Filename,'.',1)
  150. Do While Begin > 0
  151. poi = Begin
  152. Begin = Pos(Filename,'.',Begin + 1)
  153. Loop
  154. If poi > 0 Then
  155. dw_1.Object.fjname[row] = Filename //Mid(Filename,1,poi -1)
  156. dw_1.Object.FileType[row] = Mid(Filename,poi +1,Len(Filename) - poi)
  157. Else
  158. dw_1.Object.fjname[row] = Filename
  159. dw_1.Object.FileType[row] = ''
  160. End If
  161. End If
  162. st_no_fj.visible = (dw_1.rowcount() = 0)
  163. end event
  164. type cb_ok from commandbutton within w_msg_fj_add_newstyle
  165. integer x = 1335
  166. integer y = 1416
  167. integer width = 407
  168. integer height = 100
  169. integer taborder = 40
  170. boolean bringtotop = true
  171. integer textsize = -9
  172. integer weight = 400
  173. fontcharset fontcharset = gb2312charset!
  174. fontpitch fontpitch = variable!
  175. string facename = "宋体"
  176. string text = "确定"
  177. end type
  178. event clicked;s_msg_fj arg_s_fj[]
  179. long i
  180. for i = 1 to dw_1.rowcount()
  181. arg_s_fj[i].fjpath = dw_1.object.fjpath[i]
  182. arg_s_fj[i].fjname = dw_1.object.fjname[i]
  183. arg_s_fj[i].filetype = dw_1.object.filetype[i]
  184. next
  185. s_open.arg_s_fj = arg_s_fj
  186. close(parent)
  187. end event
  188. type st_no_fj from statictext within w_msg_fj_add_newstyle
  189. integer x = 823
  190. integer y = 420
  191. integer width = 754
  192. integer height = 104
  193. boolean bringtotop = true
  194. integer textsize = -15
  195. integer weight = 400
  196. fontcharset fontcharset = gb2312charset!
  197. fontpitch fontpitch = fixed!
  198. fontfamily fontfamily = modern!
  199. string facename = "黑体"
  200. long textcolor = 8421504
  201. string text = "没有附件,请上传"
  202. boolean focusrectangle = false
  203. end type