$PBExportHeader$w_itemdef_ch_with_itemflag.srw forward global type w_itemdef_ch_with_itemflag from w_publ_choice end type type cbx_mlselect from checkbox within w_itemdef_ch_with_itemflag end type type cbx_all from checkbox within w_itemdef_ch_with_itemflag end type end forward global type w_itemdef_ch_with_itemflag from w_publ_choice integer width = 3611 integer height = 2380 string title = "收支项目选择" cbx_mlselect cbx_mlselect cbx_all cbx_all end type global w_itemdef_ch_with_itemflag w_itemdef_ch_with_itemflag type variables Boolean if_changeselect = TRUE Int if_mlselect = 0 s_itemdef_arr INS_RT_STRU int ins_itemflag = 0 end variables on w_itemdef_ch_with_itemflag.create int iCurrent call super::create this.cbx_mlselect=create cbx_mlselect this.cbx_all=create cbx_all iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cbx_mlselect this.Control[iCurrent+2]=this.cbx_all end on on w_itemdef_ch_with_itemflag.destroy call super::destroy destroy(this.cbx_mlselect) destroy(this.cbx_all) end on event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU) end event event dw_filter;call super::dw_filter;String obj_expr = '' IF Trim(sle_ch.Text) <> '' THEN IF Pos(Trim(sle_ch.Text),'%') = 0 THEN obj_expr = obj_expr+'( itemcode LIKE "%'+Trim(sle_ch.Text)+'%" )' ELSE obj_expr = obj_expr+'( itemcode LIKE "'+Trim(sle_ch.Text)+'" )' END IF END IF dw_ch.SetFilter(obj_expr) dw_ch.SetRedraw(False) dw_ch.Filter() IF dw_ch.RowCount() >= 1 THEN dw_ch.SelectRow(0,False) dw_ch.SelectRow(1,True) END IF dw_ch.SetRedraw(True) end event event open;this.triggerevent('ue_before_open') wf_movetocenter() ins_itemflag = message.doubleparm if_ue_sort=true dw_CH.SetTransObject (sqlca) cb_retrieve.TRIGGEREVENT(CLICKED!) end event event key;call super::key;If KeyDown(KeyEnter!) And KeyDown(KeyControl!) Then cb_choice.TriggerEvent(Clicked!) End If end event type cb_func from w_publ_choice`cb_func within w_itemdef_ch_with_itemflag end type type cb_exit from w_publ_choice`cb_exit within w_itemdef_ch_with_itemflag end type type sle_ch from w_publ_choice`sle_ch within w_itemdef_ch_with_itemflag end type type dw_ch from w_publ_choice`dw_ch within w_itemdef_ch_with_itemflag integer width = 3579 integer height = 1984 string dataobject = "dw_itemdef_index_with_itemflag" end type event dw_ch::rowfocuschanged;IF if_mlselect = 1 THEN IF currentrow <= 0 THEN RETURN IF KeyDown(keycontrol!) THEN IF THIS.IsSelected(currentrow) THEN THIS.SelectRow(currentrow,FALSE) if_changeselect = FALSE ELSE if_changeselect = TRUE END IF ELSE IF NOT THIS.IsSelected(currentrow) THEN THIS.SelectRow(currentrow,TRUE) if_changeselect = FALSE ELSE if_changeselect = TRUE END IF END IF ELSE IF dw_edit_mode THEN RETURN IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) END IF end event event dw_ch::clicked;if row>0 then this.setrow(row) if if_mlselect=1 then if if_changeselect then this.selectrow(row,not this.IsSelected(row)) else if_changeselect=true end if else this.selectrow(0,false) this.selectrow(row,true) end if end if end event type st_1 from w_publ_choice`st_1 within w_itemdef_ch_with_itemflag end type type cb_retrieve from w_publ_choice`cb_retrieve within w_itemdef_ch_with_itemflag end type event cb_retrieve::clicked;dw_ch.retrieve(ins_itemflag) end event type cb_choice from w_publ_choice`cb_choice within w_itemdef_ch_with_itemflag end type event cb_choice::clicked;call super::clicked;Long row,ll_i,chc FOR ll_i = 1 To dw_ch.RowCount() IF dw_ch.IsSelected(ll_i) THEN chc++ INS_RT_STRU.itemid[chc] = dw_ch.Object.itemid[ll_i] INS_RT_STRU.itemcode[chc] = dw_ch.Object.itemcode[ll_i] INS_RT_STRU.itemname[chc] = dw_ch.Object.itemname[ll_i] INS_RT_STRU.itemtype[chc] = dw_ch.Object.itemtype[ll_i] INS_RT_STRU.itemdscrp[chc] = dw_ch.Object.dscrp[ll_i] INS_RT_STRU.itemflag[chc] = dw_ch.Object.itemflag[ll_i] INS_RT_STRU.itemsectype[chc] = dw_ch.Object.itemsectype[ll_i] END IF NEXT IF chc = 0 THEN MessageBox('系统提示','请至少选择一个目标行!',StopSign!) RETURN END IF Close(Parent) end event type ln_bar from w_publ_choice`ln_bar within w_itemdef_ch_with_itemflag end type type ln_bar2 from w_publ_choice`ln_bar2 within w_itemdef_ch_with_itemflag end type type r_bar from w_publ_choice`r_bar within w_itemdef_ch_with_itemflag end type type ln_1 from w_publ_choice`ln_1 within w_itemdef_ch_with_itemflag end type type ln_2 from w_publ_choice`ln_2 within w_itemdef_ch_with_itemflag end type type cbx_mlselect from checkbox within w_itemdef_ch_with_itemflag integer x = 901 integer y = 196 integer width = 256 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 string text = "多选" end type event clicked;IF THIS.Checked THEN if_mlselect = 1 cbx_all.Enabled = TRUE ELSE if_mlselect = 0 cbx_all.Enabled = FALSE cbx_all.Checked = FALSE Long li FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT END IF f_SetProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", String(if_mlselect)) end event event constructor;if_mlselect = Integer(f_ProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", '0')) IF if_mlselect = 0 THEN THIS.Checked = FALSE cbx_all.Enabled = FALSE ELSE THIS.Checked = TRUE cbx_all.Enabled = TRUE END IF end event type cbx_all from checkbox within w_itemdef_ch_with_itemflag integer x = 1111 integer y = 196 integer width = 242 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean enabled = false string text = "全选" end type event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN Long li IF THIS.Checked THEN FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,TRUE) NEXT ELSE FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT END IF end event