$PBExportHeader$w_publ_pageretr_easyq.srw
forward
global type w_publ_pageretr_easyq from w_publ_pageretr
end type
type ddlb_yl from dropdownlistbox within w_publ_pageretr_easyq
end type
type cbx_yl from checkbox within w_publ_pageretr_easyq
end type
type cb_psetup from uo_imflatbutton within w_publ_pageretr_easyq
end type
type cb_2 from uo_imflatbutton within w_publ_pageretr_easyq
end type
type cb_refresh from uo_imflatbutton within w_publ_pageretr_easyq
end type
type cb_help from uo_imflatbutton within w_publ_pageretr_easyq
end type
type cb_copyself from uo_imflatbutton within w_publ_pageretr_easyq
end type
type gb_2 from groupbox within w_publ_pageretr_easyq
end type
type ln_bar from line within w_publ_pageretr_easyq
end type
type ln_bar2 from line within w_publ_pageretr_easyq
end type
type r_bar from rectangle within w_publ_pageretr_easyq
end type
type ln_1 from line within w_publ_pageretr_easyq
end type
type ln_2 from line within w_publ_pageretr_easyq
end type
end forward

global type w_publ_pageretr_easyq from w_publ_pageretr
integer width = 3639
integer height = 2396
string title = "分页查询"
boolean maxbox = true
boolean resizable = true
windowstate windowstate = maximized!
event ue_help ( )
event ue_default_style ( )
event ue_report_style ( )
event ue_save_style ( )
ddlb_yl ddlb_yl
cbx_yl cbx_yl
cb_psetup cb_psetup
cb_2 cb_2
cb_refresh cb_refresh
cb_help cb_help
cb_copyself cb_copyself
gb_2 gb_2
ln_bar ln_bar
ln_bar2 ln_bar2
r_bar r_bar
ln_1 ln_1
ln_2 ln_2
end type
global w_publ_pageretr_easyq w_publ_pageretr_easyq

type variables
boolean if_mdf_title=true
boolean cb_reol
boolean if_retrieveing=false //是否正在retrieve
end variables

event ue_help();Int i
i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".htm")

end event

event ue_default_style();dw_pageretr.SetRedraw(FALSE)

dw_pageretr.SetFilter('')
dw_pageretr.SetRedraw (FALSE)
dw_pageretr.Filter()

dw_pageretr.SetSort('')
dw_pageretr.SetRedraw (FALSE)
dw_pageretr.Sort()

dw_pageretr.uf_reset_layout()
dw_pageretr.uf_save_profile_layout()

dw_pageretr.SetRedraw(TRUE)


end event

event ue_report_style();String ls_dwname

ls_dwname = dw_pageretr.DataObject

s_user_report_style s_style,INS_RT_STRU

s_style.dwname = ls_dwname
s_style.empid = sys_empid

OpenWithParm(w_user_report_style_list,s_style)

INS_RT_STRU =  Message.PowerObjectParm

IF INS_RT_STRU.stylename = '' THEN RETURN

String ls_sort,ls_filter
String ls_visible,ls_width,ls_column_x

ls_sort = INS_RT_STRU.Sort
ls_filter = INS_RT_STRU.Filter
ls_visible = INS_RT_STRU.Visible
ls_width = INS_RT_STRU.Width
ls_column_x = INS_RT_STRU.column_x

dw_pageretr.SetRedraw(FALSE)
dw_pageretr.Modify(ls_visible)
dw_pageretr.Modify(ls_width)
dw_pageretr.Modify(ls_column_x)

dw_pageretr.SetFilter(ls_filter)
dw_pageretr.SetRedraw (FALSE)
dw_pageretr.Filter()

dw_pageretr.SetSort(ls_sort)
dw_pageretr.SetRedraw (FALSE)
dw_pageretr.Sort()
dw_pageretr.SetRedraw(TRUE)


end event

event ue_save_style();IF MessageBox('询问','是否确定要保存当前报表查询方案?',question!,yesno!) = 2 THEN RETURN


dw_pageretr.uf_getnewlayout()

s_user_report_style s_style

s_style.edittype = 0
s_style.Sort = dw_pageretr.curDW_sortstr
s_style.Filter = dw_pageretr.curDW_filterstr
s_style.Visible = dw_pageretr.ins_mdfstr_column_visible
s_style.Width = dw_pageretr.ins_mdfstr_column_width
s_style.column_x = dw_pageretr.ins_mdfstr_column_x
s_style.dwname = dw_pageretr.dataobject
s_style.empid = sys_empid

OpenWithParm(w_report_style_edit,s_style)


end event

on w_publ_pageretr_easyq.create
int iCurrent
call super::create
this.ddlb_yl=create ddlb_yl
this.cbx_yl=create cbx_yl
this.cb_psetup=create cb_psetup
this.cb_2=create cb_2
this.cb_refresh=create cb_refresh
this.cb_help=create cb_help
this.cb_copyself=create cb_copyself
this.gb_2=create gb_2
this.ln_bar=create ln_bar
this.ln_bar2=create ln_bar2
this.r_bar=create r_bar
this.ln_1=create ln_1
this.ln_2=create ln_2
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.ddlb_yl
this.Control[iCurrent+2]=this.cbx_yl
this.Control[iCurrent+3]=this.cb_psetup
this.Control[iCurrent+4]=this.cb_2
this.Control[iCurrent+5]=this.cb_refresh
this.Control[iCurrent+6]=this.cb_help
this.Control[iCurrent+7]=this.cb_copyself
this.Control[iCurrent+8]=this.gb_2
this.Control[iCurrent+9]=this.ln_bar
this.Control[iCurrent+10]=this.ln_bar2
this.Control[iCurrent+11]=this.r_bar
this.Control[iCurrent+12]=this.ln_1
this.Control[iCurrent+13]=this.ln_2
end on

on w_publ_pageretr_easyq.destroy
call super::destroy
destroy(this.ddlb_yl)
destroy(this.cbx_yl)
destroy(this.cb_psetup)
destroy(this.cb_2)
destroy(this.cb_refresh)
destroy(this.cb_help)
destroy(this.cb_copyself)
destroy(this.gb_2)
destroy(this.ln_bar)
destroy(this.ln_bar2)
destroy(this.r_bar)
destroy(this.ln_1)
destroy(this.ln_2)
end on

event activate;IF Trim(dw_pageretr.DataObject) <> '' THEN
	IF cbx_yl.Enabled AND cbx_yl.Visible THEN cbx_yl.TriggerEvent(Clicked!)
END IF

end event

event resize;ln_bar.EndX = THIS.Width
ln_bar2.EndX = THIS.Width
ln_1.EndX = THIS.Width
ln_2.EndX = THIS.Width
r_bar.Width = THIS.Width

dw_pageretr.Width = THIS.Width - dw_pageretr.X - 40
dw_pageretr.Height = THIS.Height - dw_pageretr.Y - 150

end event

event open;call super::open;//long id 必须在首列!
end event

event closequery;if if_retrieveing then
	messagebox("系统提示",'系统正在查询数据,请稍后再退出！')
	return 1
end if
end event

event ue_filter;call super::ue_filter;OPENWITHPARM(w_filter_query,dw_pageretr)
STRING LS_EXPR
LS_EXPR=Message.StringParm	

if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return

dw_pageretr.setfilter(LS_EXPR)
dw_pageretr.SetRedraw (false)
dw_pageretr.filter()
dw_pageretr.SetRedraw (TRUE)
end event

event ue_sort;call super::ue_sort;OPENwithparm(w_sortrow,dw_pageretr)
STRING LS_EXPR
LS_EXPR=Message.StringParm	
IF ISNULL(LS_EXPR) THEN LS_EXPR='   '
if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return

dw_pageretr.setsort(LS_EXPR)

dw_pageretr.SetRedraw (false)
dw_pageretr.sort()
dw_pageretr.SetRedraw (true)
end event

event ue_sentdataout;call super::ue_sentdataout;IF NOT if_power_sendout THEN
	MessageBox(publ_operator,'你没有使用权限！')
	RETURN
END IF

OpenWithParm(w_sentdataout,dw_pageretr)

end event

event user_key;call super::user_key;IF KeyDown(KeyF1!) THEN
	THIS.TriggerEvent('ue_help')
END IF

end event

event key;call super::key;this.triggerevent('user_key')
end event

type cb_func from w_publ_pageretr`cb_func within w_publ_pageretr_easyq
integer x = 151
integer y = 0
integer width = 151
integer height = 164
integer taborder = 160
string normalpicname = "setting.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event cb_func::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
String menustr

IF if_ue_retr THEN
	menustr = "Text=查询~tEvent=ue_retr"
END IF

IF if_ue_filter THEN
	IF Len(Trim(menustr)) = 0 THEN
		menustr = "Text=高级筛选~tEvent=ue_filter"
	ELSE
		menustr = menustr + "|" + "Text=高级筛选~tEvent=ue_filter"
	END IF
END IF

IF if_ue_sort THEN
	IF Len(Trim(menustr)) = 0 THEN
		menustr = "Text=排序~tEvent=ue_sort"
	ELSE
		menustr = menustr + "|" + "Text=排序~tEvent=ue_sort"
	END IF
END IF

IF menustr <> "" AND if_ue_sentdataout THEN menustr = menustr + "|" + "Text=-"

IF if_ue_sentdataout THEN
	IF Len(Trim(menustr)) = 0 THEN
		menustr = "Text=数据发送~tEvent=ue_sentdataout"
	ELSE
		menustr = menustr + "|" + "Text=数据发送~tEvent=ue_sentdataout"
	END IF
END IF

//dyy_20100729
IF menustr <> ""  THEN menustr = menustr + "|" + "Text=-"

IF Len(Trim(menustr)) = 0 THEN
	menustr = "Text=保存查询方案~tEvent=ue_save_style"
	menustr = menustr + "|" + "Text=报表查询方案~tEvent=ue_report_style"
	menustr = menustr + "|" + "Text=恢复默认~tEvent=ue_default_style"
	
ELSE
	menustr = menustr + "|" + "Text=保存查询方案~tEvent=ue_save_style"
	menustr = menustr + "|" + "Text=报表查询方案~tEvent=ue_report_style"
	menustr = menustr + "|" + "Text=恢复默认~tEvent=ue_default_style"

END IF

IF Len(Trim(menustr)) <> 0 THEN
	dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
	dmPopupMenu.mf_BuildMenu(THIS, menustr)
	dmPopupMenu.mf_PopMenu()
	DESTROY dmPopupMenu
END IF


end event

type cb_exit from w_publ_pageretr`cb_exit within w_publ_pageretr_easyq
integer x = 1143
integer y = 0
integer width = 151
integer height = 164
boolean border = false
end type

type sle_usual_query from w_publ_pageretr`sle_usual_query within w_publ_pageretr_easyq
integer x = 238
integer y = 184
boolean bringtotop = true
end type

type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_publ_pageretr_easyq
integer x = 2117
integer width = 151
integer height = 164
integer taborder = 120
boolean bringtotop = true
string normalpicname = "p1.ico"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type em_pagerowno from w_publ_pageretr`em_pagerowno within w_publ_pageretr_easyq
integer x = 1815
integer y = 32
integer width = 302
integer height = 96
boolean bringtotop = true
string text = "10000"
end type

type dw_pageretr from w_publ_pageretr`dw_pageretr within w_publ_pageretr_easyq
integer y = 292
integer width = 3538
integer height = 2016
boolean bringtotop = true
boolean titlebar = false
boolean resizable = false
boolean border = true
borderstyle borderstyle = stylelowered!
end type

event dw_pageretr::rbuttondown;call super::rbuttondown;if  if_mdf_title then
if LOWER(LEFT(dwo.type,4))='text'  then
 s_inputbox S_SREU
 STRING LS_STR,column_name
 S_SREU.TITLE='目前标题为: '+dwo.TEXT+' 。请输入新标题: '
 S_SREU.OLD_TEXT=dwo.TEXT
 column_name=DWO.NAME

	openwithparm(w_inputbox,S_SREU)
	LS_STR=Message.StringParm
	if trim(LS_STR)<>'' AND dwo.TEXT<>LS_STR then
 		THIS.Modify(column_name+'.text="'+LS_STR+'"')
	END IF

end if
end if
end event

event dw_pageretr::retrievestart;cb_reol=cb_refresh.enabled
cb_refresh.enabled=false
if_retrieveing=true
end event

event dw_pageretr::retrieveend;cb_refresh.enabled=cb_reol
if_retrieveing=false
end event

event dw_pageretr::doubleclicked;call super::doubleclicked;if  if_mdf_title then
if LOWER(LEFT(dwo.type,4))='text'  then
 s_inputbox S_SREU
 STRING LS_STR,column_name
 S_SREU.TITLE='目前标题为: '+dwo.TEXT+' 。请输入新标题: '
 S_SREU.OLD_TEXT=dwo.TEXT
 column_name=DWO.NAME

	openwithparm(w_inputbox,S_SREU)
	LS_STR=Message.StringParm
	if trim(LS_STR)<>'' AND dwo.TEXT<>LS_STR then
 		THIS.Modify(column_name+'.text="'+LS_STR+'"')
	END IF

end if
end if
end event

type st_1 from w_publ_pageretr`st_1 within w_publ_pageretr_easyq
integer y = 204
string text = "编码含"
end type

type cb_nextpage from w_publ_pageretr`cb_nextpage within w_publ_pageretr_easyq
integer x = 2267
integer width = 78
integer height = 164
integer taborder = 150
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type ddlb_yl from dropdownlistbox within w_publ_pageretr_easyq
integer x = 1522
integer y = 48
integer width = 261
integer height = 532
integer taborder = 70
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
boolean enabled = false
string text = "适当大小"
boolean vscrollbar = true
string item[] = {"100%","75%","50%","25%","200%","150%"}
borderstyle borderstyle = stylelowered!
end type

event constructor;if THIS.TotalItems ( )>=1 then THIS.SelectItem(1)
end event

event selectionchanged;dw_pageretr.Object.DataWindow.Print.Preview.Zoom	= INTEGER(LEFT(TRIM(this.text),LEN(TRIM(this.text)) - 1))
if cbx_yl.enabled and cbx_yl.visible then cbx_yl.triggerevent(clicked!)

end event

type cbx_yl from checkbox within w_publ_pageretr_easyq
integer x = 1317
integer y = 48
integer width = 206
integer height = 76
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 134217739
string text = "预览"
end type

event clicked;ddlb_yl.Enabled = THIS.Checked
IF THIS.Checked THEN
	IF Lower(dw_pageretr.Object.DataWindow.Print.Preview) = 'yes' THEN RETURN
	dw_pageretr.Object.DataWindow.Print.Preview = 'yes'
	dw_pageretr.Object.DataWindow.Print.Preview.Rulers = "yes"
ELSE
	IF Lower(dw_pageretr.Object.DataWindow.Print.Preview) = 'no' THEN RETURN
	dw_pageretr.Object.DataWindow.Print.Preview = 'NO'
END IF

end event

event constructor;THIS.BackColor = 14215660

end event

type cb_psetup from uo_imflatbutton within w_publ_pageretr_easyq
integer x = 576
integer width = 265
integer height = 164
integer taborder = 50
boolean bringtotop = true
string text = "页面设置"
string normalpicname = "PRINTFLD.BMP"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;s_print_value s_print

s_print.obj_dw = dw_pageretr
s_print.dft_printername = ''

OpenWithParm(w_sys_printpage_value,s_print)


end event

type cb_2 from uo_imflatbutton within w_publ_pageretr_easyq
integer x = 841
integer width = 151
integer height = 164
integer taborder = 50
boolean bringtotop = true
string text = "打印"
string normalpicname = "print.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;IF NOT if_power_print THEN
	MessageBox(publ_operator,'你没有使用权限！')
	RETURN
END IF

IF dw_pageretr.RowCount() >= 1 THEN
	cbx_YL.Checked = TRUE
	cbx_YL.TriggerEvent(Clicked!)
	OpenWithParm(w_sys_printpagesetting,dw_pageretr)
ELSE
	MessageBox('NO','数据窗口中没有任何记录，不能打印！')
END IF

end event

type cb_refresh from uo_imflatbutton within w_publ_pageretr_easyq
integer width = 151
integer height = 164
integer taborder = 160
boolean bringtotop = true
string text = "刷新"
string normalpicname = "refresh.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type cb_help from uo_imflatbutton within w_publ_pageretr_easyq
integer x = 992
integer width = 151
integer height = 164
integer taborder = 60
boolean bringtotop = true
string text = "帮助"
string normalpicname = "help.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;PARENT.TriggerEvent('ue_help')

end event

type cb_copyself from uo_imflatbutton within w_publ_pageretr_easyq
integer x = 302
integer width = 274
integer height = 164
integer taborder = 170
boolean bringtotop = true
string text = "打开副本"
string normalpicname = "COPY.BMP"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;window lw_win
s_edit_index_tran s_rpinfo
s_rpinfo.if_retrieve_all = TRUE 
openwithparm(lw_win,s_rpinfo,parent.Classname())
lw_win.WindowState = Normal!
end event

type gb_2 from groupbox within w_publ_pageretr_easyq
boolean visible = false
integer x = 590
integer y = 308
integer width = 279
integer height = 268
integer taborder = 20
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 15793151
end type

type ln_bar from line within w_publ_pageretr_easyq
long linecolor = 268435456
integer linethickness = 4
integer beginy = 172
integer endx = 2007
integer endy = 172
end type

type ln_bar2 from line within w_publ_pageretr_easyq
long linecolor = 16777215
integer linethickness = 4
integer beginy = 176
integer endx = 2039
integer endy = 176
end type

type r_bar from rectangle within w_publ_pageretr_easyq
long linecolor = 16777215
integer linethickness = 4
long fillcolor = 1073741824
integer x = 2437
integer width = 146
integer height = 140
end type

event constructor;this.fillcolor = 14215660
this.linecolor = 14215660
this.x = -1
this.y = -1
this.height = ln_bar.beginy - 5

end event

type ln_1 from line within w_publ_pageretr_easyq
long linecolor = 268435456
integer linethickness = 4
integer beginy = 284
integer endx = 2016
integer endy = 284
end type

type ln_2 from line within w_publ_pageretr_easyq
long linecolor = 16777215
integer linethickness = 4
integer beginy = 288
integer endx = 2048
integer endy = 288
end type

