$PBExportHeader$w_rpt_1dw.srw $PBExportComments$含一个DW的基类 -- 窗口 forward global type w_rpt_1dw from w_rpt_base end type type dw1 from datawindow within w_rpt_1dw end type type uo_1 from uo_tlbar within w_rpt_1dw end type end forward global type w_rpt_1dw from w_rpt_base int Width=2670 int Height=2128 string MenuName="m_rpt_tool" long BackColor=80269524 boolean ToolBarVisible=false dw1 dw1 uo_1 uo_1 end type global w_rpt_1dw w_rpt_1dw on w_rpt_1dw.create int iCurrent call super::create if this.MenuName = "m_rpt_tool" then this.MenuID = create m_rpt_tool this.dw1=create dw1 this.uo_1=create uo_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw1 this.Control[iCurrent+2]=this.uo_1 end on on w_rpt_1dw.destroy call super::destroy if IsValid(MenuID) then destroy(MenuID) destroy(this.dw1) destroy(this.uo_1) end on event resize;dw1.x=(newwidth -dw1.width)/2 dw1.resize(dw1.width,newheight -dw1.y -20) end event event close;close(w_report_open) end event event open;call super::open;if not isvalid(istr_rpt) then close(this) return end if it_report=istr_rpt.transation dw1.settransobject(it_report) dw1.retrieve() end event event closequery;dw1.accepttext() IF dw1.ModifiedCount()+dw1.DeletedCount()>0 then CHOOSE CASE MESSAGEBOX('提示信息','数据已修改,是否存档?',QUESTION!,YESNOCANCEL!,1) CASE 1 event ue_save() CASE 3 RETURN 1 END CHOOSE END IF end event event ue_cond;str_rpt lstr lstr=istr_rpt lstr.userdw=dw1 openwithparm(w_rpt_condition,lstr) is_temp=message.stringparm if is_temp='' then return f_myretrieve(dw1,is_temp) end event event ue_delete;ii_row=dw1.getrow() if ii_row>0 then if messagebox("提示信息","删除当前记录",QUESTION!,YESNO!,2)=1 THEN dw1.deleterow(ii_row) end if end if end event event ue_save;f_mysave(dw1,it_report,1) end event event ue_new;dw1.setredraw(false) if ue_row=0 then dw1.scrolltorow(dw1.insertrow(0)) else dw1.scrolltorow(dw1.insertrow(dw1.getrow())) end if dw1.setredraw(true) end event type dw1 from datawindow within w_rpt_1dw int X=14 int Y=204 int Width=2011 int Height=1448 int TabOrder=10 boolean BringToTop=true BorderStyle BorderStyle=StyleLowered! boolean VScrollBar=true boolean LiveScroll=true end type type uo_1 from uo_tlbar within w_rpt_1dw int X=0 int Y=0 int TabOrder=10 boolean BringToTop=true boolean Border=false BorderStyle BorderStyle=StyleBox! end type on uo_1.destroy call uo_tlbar::destroy end on