w_ddd_ip.srw 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. $PBExportHeader$w_ddd_ip.srw
  2. forward
  3. global type w_ddd_ip from window
  4. end type
  5. type cb_1 from commandbutton within w_ddd_ip
  6. end type
  7. type st_exit from statictext within w_ddd_ip
  8. end type
  9. type st_del from statictext within w_ddd_ip
  10. end type
  11. type p_exit from picture within w_ddd_ip
  12. end type
  13. type p_del from picture within w_ddd_ip
  14. end type
  15. type dw_1 from datawindow within w_ddd_ip
  16. end type
  17. end forward
  18. global type w_ddd_ip from window
  19. integer width = 878
  20. integer height = 516
  21. windowtype windowtype = response!
  22. long backcolor = 134217739
  23. string icon = "AppIcon!"
  24. cb_1 cb_1
  25. st_exit st_exit
  26. st_del st_del
  27. p_exit p_exit
  28. p_del p_del
  29. dw_1 dw_1
  30. end type
  31. global w_ddd_ip w_ddd_ip
  32. type variables
  33. s_ip_ini ins_rt_stru
  34. end variables
  35. forward prototypes
  36. public subroutine wf_retrieve ()
  37. end prototypes
  38. public subroutine wf_retrieve ();Long i
  39. String ls_ini_ip
  40. Long ll_row
  41. long ll_pos
  42. dw_1.SetRedraw(FALSE)
  43. dw_1.reset()
  44. FOR i = 1 TO 20
  45. ls_ini_ip = ProfileString (sys_inifilename,'sys_dl_ip', String(i), '')
  46. IF Trim(ls_ini_ip) = '' THEN CONTINUE
  47. ll_row = dw_1.InsertRow(0)
  48. ll_pos = Pos(ls_ini_ip,':')
  49. dw_1.Object.ip[ll_row] = Mid(ls_ini_ip,1,ll_pos -1 )
  50. dw_1.Object.port[ll_row] = Mid(ls_ini_ip,ll_pos +1,Len(ls_ini_ip))
  51. dw_1.Object.printid[ll_row] = i
  52. NEXT
  53. dw_1.SetSort('printid A')
  54. dw_1.Sort()
  55. dw_1.SetRedraw(TRUE)
  56. end subroutine
  57. on w_ddd_ip.create
  58. this.cb_1=create cb_1
  59. this.st_exit=create st_exit
  60. this.st_del=create st_del
  61. this.p_exit=create p_exit
  62. this.p_del=create p_del
  63. this.dw_1=create dw_1
  64. this.Control[]={this.cb_1,&
  65. this.st_exit,&
  66. this.st_del,&
  67. this.p_exit,&
  68. this.p_del,&
  69. this.dw_1}
  70. end on
  71. on w_ddd_ip.destroy
  72. destroy(this.cb_1)
  73. destroy(this.st_exit)
  74. destroy(this.st_del)
  75. destroy(this.p_exit)
  76. destroy(this.p_del)
  77. destroy(this.dw_1)
  78. end on
  79. event open;s_ip_ini s_ini
  80. s_ini = Message.PowerObjectParm
  81. THIS.X = s_ini.arg_x
  82. THIS.Y = s_ini.arg_y
  83. wf_retrieve()
  84. end event
  85. event close;CloseWithReturn(THIS,ins_rt_stru)
  86. end event
  87. type cb_1 from commandbutton within w_ddd_ip
  88. integer x = 453
  89. integer y = 1192
  90. integer width = 402
  91. integer height = 84
  92. integer taborder = 20
  93. integer textsize = -9
  94. integer weight = 400
  95. fontcharset fontcharset = gb2312charset!
  96. fontpitch fontpitch = variable!
  97. string facename = "宋体"
  98. string text = "none"
  99. boolean cancel = true
  100. end type
  101. event clicked;st_exit.triggerevent(clicked!)
  102. end event
  103. type st_exit from statictext within w_ddd_ip
  104. integer x = 704
  105. integer y = 440
  106. integer width = 133
  107. integer height = 56
  108. integer textsize = -9
  109. integer weight = 400
  110. fontcharset fontcharset = gb2312charset!
  111. fontpitch fontpitch = variable!
  112. string facename = "宋体"
  113. string pointer = "HAND.CUR"
  114. long textcolor = 33554432
  115. long backcolor = 134217739
  116. string text = "退出"
  117. boolean focusrectangle = false
  118. end type
  119. event clicked;ins_rt_stru.ip = ''
  120. close(parent)
  121. end event
  122. type st_del from statictext within w_ddd_ip
  123. integer x = 466
  124. integer y = 440
  125. integer width = 133
  126. integer height = 56
  127. integer textsize = -9
  128. integer weight = 400
  129. fontcharset fontcharset = gb2312charset!
  130. fontpitch fontpitch = variable!
  131. string facename = "宋体"
  132. string pointer = "HAND.CUR"
  133. long textcolor = 33554432
  134. long backcolor = 134217739
  135. string text = "删除"
  136. boolean focusrectangle = false
  137. end type
  138. event clicked;Long ll_row
  139. Long ll_printid
  140. Long j
  141. String ls_ini_ip_j
  142. ll_row = dw_1.GetRow()
  143. IF ll_row <= 0 THEN
  144. MessageBox('系统提示','请选择要删除的行!')
  145. RETURN
  146. END IF
  147. IF MessageBox('询问','确定要删除当前连接设置吗?',question!,yesno!) = 2 THEN RETURN
  148. ll_printid = dw_1.Object.printid[ll_row]
  149. FOR j = ll_printid + 1 TO 20
  150. ls_ini_ip_j = ProfileString (sys_inifilename,'sys_dl_ip', String(j), '')
  151. IF Trim(ls_ini_ip_j) = '' THEN CONTINUE
  152. SetProfileString (sys_inifilename,'sys_dl_ip', String(j - 1), ls_ini_ip_j)
  153. NEXT
  154. FOR j = 20 TO 1 STEP -1
  155. ls_ini_ip_j = ProfileString (sys_inifilename,'sys_dl_ip', String(j), '')
  156. IF Trim(ls_ini_ip_j) = '' THEN CONTINUE
  157. IF pfc_delprofilestring(sys_inifilename,'sys_dl_ip',String(j)) <> 1 THEN
  158. MessageBox('Error','清除ini文件连接列表信息失败')
  159. RETURN
  160. END IF
  161. EXIT
  162. NEXT
  163. wf_retrieve()
  164. end event
  165. type p_exit from picture within w_ddd_ip
  166. integer x = 626
  167. integer y = 436
  168. integer width = 73
  169. integer height = 64
  170. string pointer = "HAND.CUR"
  171. boolean originalsize = true
  172. string picturename = "Exit!"
  173. boolean focusrectangle = false
  174. end type
  175. event clicked;st_exit.triggerevent(clicked!)
  176. end event
  177. type p_del from picture within w_ddd_ip
  178. integer x = 393
  179. integer y = 436
  180. integer width = 73
  181. integer height = 64
  182. string pointer = "HAND.CUR"
  183. boolean originalsize = true
  184. string picturename = "Custom009!"
  185. boolean focusrectangle = false
  186. end type
  187. event clicked;st_del.triggerevent(clicked!)
  188. end event
  189. type dw_1 from datawindow within w_ddd_ip
  190. integer width = 864
  191. integer height = 416
  192. integer taborder = 10
  193. string title = "none"
  194. string dataobject = "dw_ddd_ip"
  195. boolean hscrollbar = true
  196. boolean vscrollbar = true
  197. boolean livescroll = true
  198. borderstyle borderstyle = stylelowered!
  199. end type
  200. event rowfocuschanged;IF currentrow > 0 THEN
  201. THIS.SelectRow(0,FALSE)
  202. THIS.SelectRow(currentrow,TRUE)
  203. END IF
  204. end event
  205. event doubleclicked;Long ll_row
  206. ll_row = dw_1.GetRow()
  207. IF ll_row <= 0 THEN
  208. // MessageBox('系统提示','请先把选择目标行!')
  209. // RETURN
  210. ins_rt_stru.ip = ''
  211. Close(PARENT)
  212. END IF
  213. ins_rt_stru.ip = dw_1.Object.ip[ll_row]
  214. ins_rt_stru.port = dw_1.Object.port[ll_row]
  215. Close(PARENT)
  216. end event