$PBExportHeader$w_dw_edit.srw forward global type w_dw_edit from w_publ_base end type type lb_1 from listbox within w_dw_edit end type type lb_2 from listbox within w_dw_edit end type type dw_list from u_dw_rbtnfilter within w_dw_edit end type type dw_lib from u_dw_rbtnfilter within w_dw_edit end type type ddlb_type from dropdownlistbox within w_dw_edit end type type st_1 from statictext within w_dw_edit end type type cb_add from uo_imflatbutton within w_dw_edit end type type cb_retrieve from uo_imflatbutton within w_dw_edit end type type ln_bar2 from line within w_dw_edit end type type ln_bar from line within w_dw_edit end type type r_bar from rectangle within w_dw_edit end type end forward global type w_dw_edit from w_publ_base integer width = 3625 integer height = 2376 string title = "数据窗口编辑器" boolean maxbox = true boolean resizable = true windowstate windowstate = maximized! event ue_f7 ( ) lb_1 lb_1 lb_2 lb_2 dw_list dw_list dw_lib dw_lib ddlb_type ddlb_type st_1 st_1 cb_add cb_add cb_retrieve cb_retrieve ln_bar2 ln_bar2 ln_bar ln_bar r_bar r_bar end type global w_dw_edit w_dw_edit type variables String ls_path,lib_path long dw_lib_h,dw_list_h,dw_list_w long cur_type = 0 long j end variables forward prototypes public subroutine wf_retrdw (string arg_path, datawindow arg_dw) public subroutine wf_addexplore (long arg_type) end prototypes event ue_f7();Long lib_row Long list_row str_rpt s_parm lib_row = dw_lib.GetRow() list_row = dw_list.GetRow() IF lib_row <= 0 OR list_row <= 0 THEN RETURN dw_list.accepttext() s_parm.auto = "auto" s_parm.transation = sqlca//数据库连接 s_parm.oname = dw_list.object.ctag[list_row] s_parm.otype = lib_path s_parm.rcname = dw_list.object.ctag[list_row] s_parm.retr_pram_falg = -1 s_parm.retr_flag = true s_parm.import_flag = true s_parm.pblpath = dw_lib.object.lib_path[lib_row] OpenWithParm(w_rpt_main,s_parm) end event public subroutine wf_retrdw (string arg_path, datawindow arg_dw);String ls_data,s[] Long k s[4] = LibraryDirectory(arg_path,DirDataWindow!) //name ~t date/time modified ~t comments ~n arg_dw.Reset() dw_list.SetRedraw(FALSE) DO WHILE TRUE k = Pos(s[4],'~t') IF k = 0 THEN EXIT s[1] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = Pos(s[4],'~t') s[3] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = Pos(s[4],'~n') s[2] = Left(s[4],k -1) s[4] = Mid(s[4],k+1) k = arg_dw.InsertRow(0) arg_dw.SetItem(k,1,s[1]) arg_dw.SetItem(k,2,s[2]) arg_dw.SetItem(k,3,s[3]) LOOP dw_list.SetRedraw(TRUE) end subroutine public subroutine wf_addexplore (long arg_type); String ls_label String ls_type Int li_count,i = 1 j = 1 IF arg_type = 0 THEN ls_type = "*.pbl" ELSE ls_type = "*.pbd" END IF LS_PATH = sys_cur_path + ls_type lb_1.Reset() lb_1.DirList(LS_PATH, 0) li_count = lb_1.TotalItems() dw_lib.Reset() IF li_count > 0 THEN FOR i = li_count TO 1 STEP -1 ls_label = lb_1.Text(i) dw_lib.Object.lib_name[j] = ls_label dw_lib.Object.lib_path[j] = sys_cur_path + ls_label dw_lib.Object.flag[j] = 0 j++ NEXT END IF IF dw_lib.Rowcount() > 0 THEN lib_path = dw_lib.Object.lib_path[1] wf_retrdw(lib_path,dw_list) ELSE dw_list.Reset() END IF end subroutine on w_dw_edit.create int iCurrent call super::create this.lb_1=create lb_1 this.lb_2=create lb_2 this.dw_list=create dw_list this.dw_lib=create dw_lib this.ddlb_type=create ddlb_type this.st_1=create st_1 this.cb_add=create cb_add this.cb_retrieve=create cb_retrieve this.ln_bar2=create ln_bar2 this.ln_bar=create ln_bar this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.lb_1 this.Control[iCurrent+2]=this.lb_2 this.Control[iCurrent+3]=this.dw_list this.Control[iCurrent+4]=this.dw_lib this.Control[iCurrent+5]=this.ddlb_type this.Control[iCurrent+6]=this.st_1 this.Control[iCurrent+7]=this.cb_add this.Control[iCurrent+8]=this.cb_retrieve this.Control[iCurrent+9]=this.ln_bar2 this.Control[iCurrent+10]=this.ln_bar this.Control[iCurrent+11]=this.r_bar end on on w_dw_edit.destroy call super::destroy destroy(this.lb_1) destroy(this.lb_2) destroy(this.dw_list) destroy(this.dw_lib) destroy(this.ddlb_type) destroy(this.st_1) destroy(this.cb_add) destroy(this.cb_retrieve) destroy(this.ln_bar2) destroy(this.ln_bar) destroy(this.r_bar) end on event open;call super::open;wf_addexplore(cur_type) end event event resize;call super::resize;ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width r_bar.Width = THIS.Width long w_width,w_height w_width = 3600 w_height = 2350 if newwidth < w_width then this.width = w_width if newheight < w_height then this.height = w_height dw_lib.height = this.height - (w_height - dw_lib_h) dw_list.width=this.width - (w_width - dw_list_w) dw_list.height=this.height - (w_height - dw_list_h) end event type cb_func from w_publ_base`cb_func within w_dw_edit boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_dw_edit boolean visible = false integer x = 3657 integer y = 2304 end type type lb_1 from listbox within w_dw_edit boolean visible = false integer x = 3291 integer y = 128 integer width = 878 integer height = 544 integer taborder = 20 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 type lb_2 from listbox within w_dw_edit boolean visible = false integer x = 3291 integer y = 832 integer width = 878 integer height = 544 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 type dw_list from u_dw_rbtnfilter within w_dw_edit integer x = 1317 integer y = 184 integer width = 2194 integer height = 2008 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_dw_list" boolean vscrollbar = true end type event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow) THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event event constructor;call super::constructor;dw_list_h = this.height dw_list_w = this.width end event event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_f7') end event type dw_lib from u_dw_rbtnfilter within w_dw_edit integer y = 184 integer width = 1303 integer height = 2004 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_lib_list" boolean vscrollbar = true boolean rbutton_filter_use = true boolean titleclick_sort_use = true boolean setcolumn_visible_use = false boolean autosave_setlayout_use = false boolean autosave_columnvisible_use = false end type event constructor;call super::constructor;dw_lib_h = this.height end event event clicked;call super::clicked;IF row = 0 THEN RETURN THIS.SetRow(row) THIS.SelectRow(0,FALSE) THIS.SelectRow(row,TRUE) end event event rowfocuschanged;IF currentrow > 0 THEN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF dw_lib.AcceptText() IF currentrow > 0 THEN lib_path = dw_lib.Object.lib_path[currentrow] wf_retrdw(lib_path,dw_list) ELSE dw_list.Reset() END IF end event type ddlb_type from dropdownlistbox within w_dw_edit integer x = 160 integer y = 36 integer width = 741 integer height = 452 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "PBL" boolean sorted = false string item[] = {"PBL","PBD"} borderstyle borderstyle = stylelowered! end type event selectionchanged;CHOOSE CASE Index CASE 1 cur_type = 0 CASE 2 cur_type = 1 END CHOOSE wf_addexplore(cur_type) end event type st_1 from statictext within w_dw_edit integer y = 48 integer width = 151 integer height = 68 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "类型:" alignment alignment = right! boolean focusrectangle = false end type event constructor;THIS.BackColor = 14215660 end event type cb_add from uo_imflatbutton within w_dw_edit integer x = 910 integer width = 197 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "附加库" string normalpicname = "imexport.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;Integer i String Pathname String Filename i = GetFileOpenName("Select File",Pathname,Filename,"pbl","Pb Files,*.pb?") dw_lib.AcceptText() IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN dw_lib.object.lib_name[j] = Filename dw_lib.object.lib_path[j] = Pathname dw_lib.object.flag[j] = 1 j++ END IF RETURN end event type cb_retrieve from uo_imflatbutton within w_dw_edit integer x = 1106 integer width = 151 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_addexplore(cur_type) end event type ln_bar2 from line within w_dw_edit long linecolor = 16777215 integer linethickness = 4 integer beginx = 9 integer beginy = 172 integer endx = 3273 integer endy = 172 end type type ln_bar from line within w_dw_edit long linecolor = 268435456 integer linethickness = 4 integer beginy = 168 integer endx = 3200 integer endy = 168 end type type r_bar from rectangle within w_dw_edit long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 3351 integer width = 87 integer height = 68 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar.beginy - 5 end event