123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- $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
|