$PBExportHeader$w_publ_edit_choice.srw $PBExportComments$定义加选择窗口 forward global type w_publ_edit_choice from w_publ_base end type type cb_add from uo_imflatbutton within w_publ_edit_choice end type type cb_edit from uo_imflatbutton within w_publ_edit_choice end type type cb_delet from uo_imflatbutton within w_publ_edit_choice end type type cb_choice from uo_imflatbutton within w_publ_edit_choice end type type dw_uc from u_dw_rbtnfilter within w_publ_edit_choice end type type cb_rtr from uo_imflatbutton within w_publ_edit_choice end type type cb_help from uo_imflatbutton within w_publ_edit_choice end type type ln_bar from line within w_publ_edit_choice end type type ln_bar2 from line within w_publ_edit_choice end type type r_bar from rectangle within w_publ_edit_choice end type end forward global type w_publ_edit_choice from w_publ_base integer width = 2062 integer height = 1560 string title = "编缉" boolean minbox = false windowtype windowtype = response! event retrieve_uc ( ) event ue_help ( ) event user_key ( ) cb_add cb_add cb_edit cb_edit cb_delet cb_delet cb_choice cb_choice dw_uc dw_uc cb_rtr cb_rtr cb_help cb_help ln_bar ln_bar ln_bar2 ln_bar2 r_bar r_bar end type global w_publ_edit_choice w_publ_edit_choice type variables boolean ls_update_flag=true long modifyrow_no=0,crl_row //当前行记录 s_edit_tran para_obj //环境信息用于查询 string keyword_string //关键字 未用 date first_date //查询开始日 date end_date //查询结束日,比表达日后一天 int child_column_int //明细dw锁定列数 string ins_sqlerrtext end variables forward prototypes public function integer wf_face_change () end prototypes event retrieve_uc();dw_UC.retrieve() end event event ue_help();Int i i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".html") end event event user_key();IF KeyDown(KeyF1!) THEN THIS.TriggerEvent('ue_help') end if end event public function integer wf_face_change ();IF dw_edit_mode THEN cb_func.Enabled = FALSE cb_choice.Enabled = FALSE cb_delet.Enabled = FALSE cb_rtr.Enabled = FALSE cb_edit.Text = "放弃&E" cb_add.Text = "保存&S" cb_edit.normalpicname = 'Undo.bmp' cb_add.normalpicname = 'Save.bmp' ELSE cb_func.Enabled = TRUE cb_delet.Enabled = TRUE cb_choice.Enabled = TRUE cb_rtr.Enabled = TRUE cb_edit.Text = "修改&E" cb_add.Text = "新建&S" cb_edit.normalpicname = 'OPEN.bmp' cb_add.normalpicname = 'new.bmp' END IF cb_edit.of_init_draw() cb_add.of_init_draw() cb_edit.of_paint() cb_add.of_paint() cb_add.TriggerEvent('ue_textchange') cb_edit.TriggerEvent('ue_textchange') RETURN 1 end function on w_publ_edit_choice.create int iCurrent call super::create this.cb_add=create cb_add this.cb_edit=create cb_edit this.cb_delet=create cb_delet this.cb_choice=create cb_choice this.dw_uc=create dw_uc this.cb_rtr=create cb_rtr this.cb_help=create cb_help this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_add this.Control[iCurrent+2]=this.cb_edit this.Control[iCurrent+3]=this.cb_delet this.Control[iCurrent+4]=this.cb_choice this.Control[iCurrent+5]=this.dw_uc this.Control[iCurrent+6]=this.cb_rtr this.Control[iCurrent+7]=this.cb_help this.Control[iCurrent+8]=this.ln_bar this.Control[iCurrent+9]=this.ln_bar2 this.Control[iCurrent+10]=this.r_bar end on on w_publ_edit_choice.destroy call super::destroy destroy(this.cb_add) destroy(this.cb_edit) destroy(this.cb_delet) destroy(this.cb_choice) destroy(this.dw_uc) destroy(this.cb_rtr) destroy(this.cb_help) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.r_bar) end on event ue_filter;call super::ue_filter;//OPENWITHPARM(w_filter_query,dw_uc) //STRING LS_EXPR //LS_EXPR=Message.StringParm // //if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return // //dw_uc.setfilter(LS_EXPR) // //dw_uc.SetRedraw (false) //dw_uc.filter() //dw_uc.SetRedraw (true) end event event closequery;call super::closequery;IF dw_edit_mode THEN dw_UC.AcceptText() Int ls_row = 0 ls_row = dw_UC.GetNextModified(0, Primary!)+& dw_UC.GetNextModified(0, Filter!)+dw_UC.DeletedCount() IF ls_row > 0 THEN IF MessageBox('是否保存','数据已经改变,是否放弃保存?',Question!,YesNo!,1 ) = 2 THEN RETURN 1 END IF END IF END IF end event event open;call super::open;dw_UC.SetTransObject (sqlca) this.triggerevent('retrieve_uc') end event event resize;call super::resize;ln_bar.endx = this.width ln_bar2.endx = this.width r_bar.width = this.width end event event key;call super::key;this.triggerevent('user_key') end event type cb_func from w_publ_base`cb_func within w_publ_edit_choice integer x = 151 integer width = 151 integer height = 164 string normalpicname = "setting.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type cb_exit from w_publ_base`cb_exit within w_publ_edit_choice integer x = 1138 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type cb_add from uo_imflatbutton within w_publ_edit_choice integer x = 302 integer width = 192 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "新建&S" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;//long ll_newid,i //string errmsg //IF dw_edit_mode THEN // dw_uc.accepttext() // if dw_uc.GetNextModified(0, Primary!)=0 then // MESSAGEBOX(publ_operator,'没有任何修改,不可以保存!') // RETURN // end if // DW_UC.OBJECT.departmentname[DW_UC.GETROW()]=TRIM(DW_UC.OBJECT.departmentname[DW_UC.GETROW()]) // // // IF DW_UC.OBJECT.departmentname[DW_UC.GETROW()]='' THEN // MESSAGEBOX(publ_operator,'请输入部门资料名称!') // RETURN // END IF // // if dw_uc.object.departmentid[dw_uc.getrow()]=0 then // ll_newid=f_sys_scidentity(0,"cw_department","departmentid",errmsg,false) // if ll_newid<=0 then // messagebox(publ_operator,errmsg) // return // else // dw_uc.object.departmentid[DW_UC.GETROW()]=ll_newid // end if // end if //end if // // // //IF dw_edit_mode THEN // string ls_errmsg // if dw_UC.Update() = -1 then // if pos(ins_sqlerrtext,"Cannot insert duplicate key row")>0 then // ls_errmsg="关键内容重复" // else // ls_errmsg="因为网络或其他原因>"+ins_sqlerrtext // end if // rollback; // MessageBox (publ_operator,ls_errmsg+",保存操作失败!",Exclamation!,OK!) // LS_UPDATE_FLAG=FALSE // RETURN // else // commit; // for i=1 to 3 // dw_UC.SetTabOrder ( i, 0 ) // next // LS_UPDATE_FLAG=TRUE // end if // ins_sqlerrtext="" //ELSE // long li_row, li_cur_row // li_cur_row = dw_UC.GetRow() // li_row = dw_UC.InsertRow (0) // for i=1 to 3 // dw_UC.SetTabOrder ( i, i*10 ) // next // dw_uc.selectrow(0,false) // dw_UC.ScrollToRow (li_row) // dw_uc.selectrow(li_row,true) // dw_UC.SetFocus() // modifyrow_no= li_row //END IF // //dw_edit_mode= NOT dw_edit_mode //WF_FACE_CHANGE() // end event type cb_edit from uo_imflatbutton within w_publ_edit_choice integer x = 494 integer width = 192 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "修改&E" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;//long i //IF dw_edit_mode THEN // if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then // dw_UC.deleterow(dw_UC.getrow()) // else // dw_UC.ReselectRow(dw_UC.getrow()) // end if // for i=1 to 3 // dw_UC.SetTabOrder ( i, 0 ) // next // modifyrow_no = 0 //ELSE // modifyrow_no = dw_UC.getrow() // for i=1 to 3 // dw_UC.SetTabOrder ( i, i*10 ) // next // dw_UC.SetFocus() // // dw_UC.selectrow(0,false) // dw_UC.ScrollToRow (modifyrow_no) // dw_uc.selectrow(modifyrow_no,true) // //END IF // //dw_edit_mode= NOT dw_edit_mode //WF_FACE_CHANGE() end event type cb_delet from uo_imflatbutton within w_publ_edit_choice integer x = 686 integer width = 151 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;//IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN //RETURN //END IF // //long LS_id //LONG LS_LONG=0 //string ls_code,arg_msg //IF DW_UC.GETROW()<=0 THEN // MESSAGEBOX('','没有操作目标记录!') // RETURN //END IF //LS_id=DW_UC.OBJECT.departmentid[DW_UC.GETROW()] //select COUNT(*) into :LS_LONG from u_rs_empinfo // where u_rs_empinfo.deptid=:LS_id ; //if SQLCA.SQLCode<>0 then // MessageBox (publ_operator,"数据查询操作失败!(请重试!)",Exclamation!,OK!) // return //end if //IF LS_LONG>0 THEN // MessageBox (publ_operator,"该资料已经使用于人事资料,不可以删除!",Exclamation!,OK!) // RETURN //END IF // //LS_LONG=0 //select COUNT(*) into :LS_LONG from u_sc_workgroup // where u_sc_workgroup.deptid=:LS_id ; //if SQLCA.SQLCode<>0 then // MessageBox (publ_operator,"数据查询操作失败!(请重试!)",Exclamation!,OK!) // return //end if //IF LS_LONG>0 THEN // MessageBox (publ_operator,"该资料已经使用于工组设定中,不可以删除!",Exclamation!,OK!) // RETURN //END IF // //dw_uc.SetRedraw (false) //dw_UC.DeleteRow (0) //dw_UC.TriggerEvent (rowfocuschanged!) // //if dw_UC.Update() = -1 then // rollback; // MessageBox (publ_operator,"删除记录操作失败!",Exclamation!,OK!) //else // commit; //end if //dw_uc.SetRedraw (true) end event type cb_choice from uo_imflatbutton within w_publ_edit_choice integer x = 837 integer width = 151 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "选定" string normalpicname = "ok.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type dw_uc from u_dw_rbtnfilter within w_publ_edit_choice integer y = 176 integer width = 1993 integer height = 1268 integer taborder = 20 boolean bringtotop = true boolean vscrollbar = true end type event dberror;call super::dberror;ins_sqlerrtext=sqlerrtext return 1 end event event rowfocuschanged;call super::rowfocuschanged;IF modifyrow_no >0 AND dw_edit_mode THEN THIS.SETROW(modifyrow_no) THIS.ScrollToRow(modifyrow_no) else this.selectrow(0,false) this.selectrow(currentrow,true) END IF end event event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1 end event event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关 RBUTTON_FILTER_USE=true //右键查询-功能开关 setcolumn_visible_USE= true //自动保存显示列-功能开关 autosave_setlayout_USE= true //自动保存列位置及宽度-功能开关 end event event rbuttondown;IF dw_edit_mode THEN RETURN 1 CALL SUPER::RButtonDown end event event retrieveend;call super::retrieveend;IF RowCount > 0 THEN dw_uc.SelectRow(0,FALSE) dw_uc.SetRow(1) dw_uc.SelectRow(1,TRUE) END IF end event event dwnkey;call super::dwnkey;parent.triggerevent('user_key') //IF dw_edit_mode THEN // IF KeyDown(keydownarrow!) THEN // IF THIS.GetRow() = THIS.RowCount() THEN // PARENT.TriggerEvent('insert_childrow') // END IF // ELSE // IF KeyDown(keyenter!) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN // IF THIS.GetColumnName( ) = 'locacode' AND THIS.GetRow() = THIS.RowCount() THEN // PARENT.TriggerEvent("insert_childrow") // RETURN 1 // END IF // ELSE // IF Key = keyenter! THEN // keybd_event ( 9, 0, 0 , 0 ) // 按下tab // keybd_event ( 9, 0, 2, 0 ) // 释放tab // RETURN 1 // END IF // END IF // END IF // //end if end event type cb_rtr from uo_imflatbutton within w_publ_edit_choice integer width = 151 integer height = 164 integer taborder = 20 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;parent.triggerevent('retrieve_uc') end event type cb_help from uo_imflatbutton within w_publ_edit_choice integer x = 987 integer width = 151 integer height = 164 integer taborder = 20 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 ln_bar from line within w_publ_edit_choice long linecolor = 268435456 integer linethickness = 4 integer beginy = 168 integer endx = 1481 integer endy = 168 end type type ln_bar2 from line within w_publ_edit_choice long linecolor = 16777215 integer linethickness = 4 integer beginy = 172 integer endx = 1513 integer endy = 172 end type type r_bar from rectangle within w_publ_edit_choice long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 1257 integer width = 146 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