123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- $PBExportHeader$w_ddd_ip.srw
- forward
- global type w_ddd_ip from window
- end type
- type cb_1 from commandbutton within w_ddd_ip
- end type
- type st_exit from statictext within w_ddd_ip
- end type
- type st_del from statictext within w_ddd_ip
- end type
- type p_exit from picture within w_ddd_ip
- end type
- type p_del from picture within w_ddd_ip
- end type
- type dw_1 from datawindow within w_ddd_ip
- end type
- end forward
- global type w_ddd_ip from window
- integer width = 878
- integer height = 516
- windowtype windowtype = response!
- long backcolor = 134217739
- string icon = "AppIcon!"
- cb_1 cb_1
- st_exit st_exit
- st_del st_del
- p_exit p_exit
- p_del p_del
- dw_1 dw_1
- end type
- global w_ddd_ip w_ddd_ip
- type variables
- s_ip_ini ins_rt_stru
- end variables
- forward prototypes
- public subroutine wf_retrieve ()
- end prototypes
- public subroutine wf_retrieve ();Long i
- String ls_ini_ip
- Long ll_row
- long ll_pos
- dw_1.SetRedraw(FALSE)
- dw_1.reset()
- FOR i = 1 TO 20
- ls_ini_ip = ProfileString (sys_inifilename,'sys_dl_ip', String(i), '')
-
- IF Trim(ls_ini_ip) = '' THEN CONTINUE
-
- ll_row = dw_1.InsertRow(0)
- ll_pos = Pos(ls_ini_ip,':')
- dw_1.Object.ip[ll_row] = Mid(ls_ini_ip,1,ll_pos -1 )
- dw_1.Object.port[ll_row] = Mid(ls_ini_ip,ll_pos +1,Len(ls_ini_ip))
- dw_1.Object.printid[ll_row] = i
- NEXT
- dw_1.SetSort('printid A')
- dw_1.Sort()
- dw_1.SetRedraw(TRUE)
- end subroutine
- on w_ddd_ip.create
- this.cb_1=create cb_1
- this.st_exit=create st_exit
- this.st_del=create st_del
- this.p_exit=create p_exit
- this.p_del=create p_del
- this.dw_1=create dw_1
- this.Control[]={this.cb_1,&
- this.st_exit,&
- this.st_del,&
- this.p_exit,&
- this.p_del,&
- this.dw_1}
- end on
- on w_ddd_ip.destroy
- destroy(this.cb_1)
- destroy(this.st_exit)
- destroy(this.st_del)
- destroy(this.p_exit)
- destroy(this.p_del)
- destroy(this.dw_1)
- end on
- event open;s_ip_ini s_ini
- s_ini = Message.PowerObjectParm
- THIS.X = s_ini.arg_x
- THIS.Y = s_ini.arg_y
- wf_retrieve()
- end event
- event close;CloseWithReturn(THIS,ins_rt_stru)
- end event
- type cb_1 from commandbutton within w_ddd_ip
- integer x = 453
- integer y = 1192
- integer width = 402
- integer height = 84
- integer taborder = 20
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "none"
- boolean cancel = true
- end type
- event clicked;st_exit.triggerevent(clicked!)
- end event
- type st_exit from statictext within w_ddd_ip
- integer x = 704
- integer y = 440
- integer width = 133
- integer height = 56
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string pointer = "HAND.CUR"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "退出"
- boolean focusrectangle = false
- end type
- event clicked;ins_rt_stru.ip = ''
- close(parent)
- end event
- type st_del from statictext within w_ddd_ip
- integer x = 466
- integer y = 440
- integer width = 133
- integer height = 56
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string pointer = "HAND.CUR"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "删除"
- boolean focusrectangle = false
- end type
- event clicked;Long ll_row
- Long ll_printid
- Long j
- String ls_ini_ip_j
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- MessageBox('系统提示','请选择要删除的行!')
- RETURN
- END IF
- IF MessageBox('询问','确定要删除当前连接设置吗?',question!,yesno!) = 2 THEN RETURN
- ll_printid = dw_1.Object.printid[ll_row]
- FOR j = ll_printid + 1 TO 20
- ls_ini_ip_j = ProfileString (sys_inifilename,'sys_dl_ip', String(j), '')
- IF Trim(ls_ini_ip_j) = '' THEN CONTINUE
- SetProfileString (sys_inifilename,'sys_dl_ip', String(j - 1), ls_ini_ip_j)
- NEXT
- FOR j = 20 TO 1 STEP -1
- ls_ini_ip_j = ProfileString (sys_inifilename,'sys_dl_ip', String(j), '')
- IF Trim(ls_ini_ip_j) = '' THEN CONTINUE
- IF pfc_delprofilestring(sys_inifilename,'sys_dl_ip',String(j)) <> 1 THEN
- MessageBox('Error','清除ini文件连接列表信息失败')
- RETURN
- END IF
- EXIT
- NEXT
- wf_retrieve()
- end event
- type p_exit from picture within w_ddd_ip
- integer x = 626
- integer y = 436
- integer width = 73
- integer height = 64
- string pointer = "HAND.CUR"
- boolean originalsize = true
- string picturename = "Exit!"
- boolean focusrectangle = false
- end type
- event clicked;st_exit.triggerevent(clicked!)
- end event
- type p_del from picture within w_ddd_ip
- integer x = 393
- integer y = 436
- integer width = 73
- integer height = 64
- string pointer = "HAND.CUR"
- boolean originalsize = true
- string picturename = "Custom009!"
- boolean focusrectangle = false
- end type
- event clicked;st_del.triggerevent(clicked!)
- end event
- type dw_1 from datawindow within w_ddd_ip
- integer width = 864
- integer height = 416
- integer taborder = 10
- string title = "none"
- string dataobject = "dw_ddd_ip"
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event rowfocuschanged;IF currentrow > 0 THEN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- event doubleclicked;Long ll_row
- ll_row = dw_1.GetRow()
- IF ll_row <= 0 THEN
- // MessageBox('系统提示','请先把选择目标行!')
- // RETURN
- ins_rt_stru.ip = ''
- Close(PARENT)
- END IF
- ins_rt_stru.ip = dw_1.Object.ip[ll_row]
- ins_rt_stru.port = dw_1.Object.port[ll_row]
- Close(PARENT)
- end event
|