123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- $PBExportHeader$w_plugins_edit.srw
- forward
- global type w_plugins_edit from w_publ_edit_choice
- end type
- end forward
- global type w_plugins_edit from w_publ_edit_choice
- integer width = 3611
- integer height = 2180
- string title = "外挂程序编辑"
- boolean minbox = true
- windowtype windowtype = popup!
- event ue_addmx ( )
- event ue_add_file ( )
- event ue_run_file ( )
- end type
- global w_plugins_edit w_plugins_edit
- type variables
- int dw_uc_h
- int dw_uc_w
- end variables
- event ue_addmx();Long li_row, li_cur_row
- li_row = dw_uc.InsertRow (0)
- dw_uc.SelectRow(0,FALSE)
- dw_uc.ScrollToRow (li_row)
- dw_uc.SelectRow(li_row,TRUE)
- end event
- event ue_add_file();Int cur_row
- Integer i,j
- String Pathname
- String Filename[]
- Integer li_row
- cur_row = dw_uc.GetRow()
- IF cur_row <= 0 THEN
- MessageBox(publ_operator,'请先选择行!')
- RETURN
- END IF
- i = GetFileOpenName("Select File",Pathname,Filename[],"EXE","EXE Files (*.EXE),*.EXE,")
- IF i = 0 THEN RETURN
- dw_uc.AcceptText()
- dw_uc.SetRedraw(FALSE)
- IF i = 1 AND Trim(Pathname) <> "" THEN
- IF UpperBound(Filename) = 1 THEN
-
- dw_uc.Object.Filename[cur_row] = Filename[i]
- dw_uc.Object.filepath[cur_row] = Filename[i]
-
- ELSEIF UpperBound(Filename) > 1 THEN
-
- dw_uc.Object.Filename[cur_row] = Filename[i]
- dw_uc.Object.filepath[cur_row] = Filename[i]
- FOR j = 2 TO UpperBound(Filename)
- li_row = dw_uc.InsertRow (0)
- dw_uc.Object.Filename[li_row] = Filename[j]
- dw_uc.Object.filepath[li_row] = Filename[j]
- NEXT
- END IF
- END IF
- dw_uc.SetRedraw(TRUE)
- RETURN
- end event
- event ue_run_file();Int cur_row, ll_dftWinState
- cur_row = dw_uc.GetRow()
- IF cur_row <= 0 THEN
- MessageBox(publ_operator,'请先选择行!')
- RETURN
- END IF
- ll_dftWinState = dw_uc.Object.dftWinState[cur_row]
- WindowState lwstmp
- IF ll_dftWinState = -1 THEN
- lwstmp = Minimized!
- ELSEIF ll_dftWinState = 0 THEN
- lwstmp = Normal!
- ELSE
- lwstmp = Maximized!
- END IF
-
- String ls_run
- ls_run = dw_uc.Object.psw[cur_row] + '&'
- ls_run += publ_userid + '&'
- ls_run += sqlca.Database + '&'
- ls_run += sqlca.UserID + '&'
- ls_run += f_psw_bczh(sqlca.DBPass,0,sys_power_key) + '&'
- ls_run += sqlca.LogID + '&'
- ls_run += sqlca.LogPass + '&'
- ls_run += sqlca.ServerName + '&'
- IF Run(sys_cur_path + dw_uc.Object.filepath[cur_row] + ' - ' +ls_run) = -1 THEN
- MessageBox('错误','运行程序失败!',stopsign!,ok!)
- RETURN
- END IF
- RETURN
- end event
- on w_plugins_edit.create
- call super::create
- end on
- on w_plugins_edit.destroy
- call super::destroy
- end on
- event resize;call super::resize;long w_width,w_height
- w_width = 3630
- w_height = 2200
- if newwidth < w_width then this.width = w_width
- if newheight < w_height then this.height = w_height
- dw_uc.width=this.width - (w_width - dw_uc_w)
- dw_uc.height=this.height - (w_height - dw_uc_h)
- end event
- type cb_func from w_publ_edit_choice`cb_func within w_plugins_edit
- end type
- type cb_exit from w_publ_edit_choice`cb_exit within w_plugins_edit
- integer x = 837
- end type
- type cb_add from w_publ_edit_choice`cb_add within w_plugins_edit
- end type
- event cb_add::clicked;call super::clicked;Long ll_newid,i
- String errmsg
- IF dw_edit_mode THEN
- dw_uc.AcceptText()
-
- dw_uc.Object.Filename[dw_uc.GetRow()] = Trim(dw_uc.Object.Filename[dw_uc.GetRow()])
-
-
- IF dw_uc.Object.Filename[dw_uc.GetRow()] = '' THEN
- MessageBox(publ_operator,'请输入程序名称!')
- RETURN
- END IF
-
- IF dw_uc.Object.fileid[dw_uc.GetRow()] = 0 THEN
- ll_newid = f_sys_scidentity(0,"u_plugins","fileid",errmsg,FALSE,sqlca)
- IF ll_newid <= 0 THEN
- MessageBox(publ_operator,errmsg)
- RETURN
- ELSE
- dw_uc.Object.fileid[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 7
- 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 7
- 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 w_publ_edit_choice`cb_edit within w_plugins_edit
- end type
- event cb_edit::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 7
- dw_uc.SetTabOrder ( i, 0 )
- NEXT
- modifyrow_no = 0
- ELSE
- modifyrow_no = dw_uc.GetRow()
- FOR i = 1 TO 7
- 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 w_publ_edit_choice`cb_delet within w_plugins_edit
- end type
- event cb_delet::clicked;call super::clicked;IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
- RETURN
- END IF
- Long LS_id
- Long LS_LONG = 0
- Long cur_fileid = 0
- String ls_code,arg_msg
- IF DW_UC.GetRow() <= 0 THEN
- MessageBox('','没有操作目标记录!')
- 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 w_publ_edit_choice`cb_choice within w_plugins_edit
- boolean visible = false
- end type
- type dw_uc from w_publ_edit_choice`dw_uc within w_plugins_edit
- integer width = 3561
- integer height = 1892
- string dataobject = "u_plugins_edit"
- boolean hscrollbar = true
- end type
- event dw_uc::clicked;call super::clicked;IF row > 0 THEN
- THIS.AcceptText()
- IF dw_edit_mode THEN
- THIS.SetRow(row)
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(row,TRUE)
-
- IF dwo.Name = 'b_file' THEN
- PARENT.TriggerEvent('ue_add_file')
- ELSEIF dwo.Name = 'b_user' THEN
- PARENT.TriggerEvent('ue_add_user')
- END IF
- END IF
-
- IF dwo.Name = 'b_run' THEN
- PARENT.TriggerEvent('ue_run_file')
- END IF
- END IF
- end event
- event dw_uc::rowfocuschanging;//
- end event
- event dw_uc::rbuttondown;call super::rbuttondown;IF dw_edit_mode THEN
- Long ll_row,ll_column
- ll_row = THIS.GetRow()
- ll_column = THIS.GetColumn()
-
- IF ll_row <= 0 THEN RETURN
- IF ll_column <= 0 THEN RETURN
-
- IF Left(dwo.TYPE,4) = 'text' THEN RETURN
- m_dwchild_rbotton m_print
- m_print = CREATE m_dwchild_rbotton
-
- m_print.m_0.PopMenu(THIS.X + THIS.PointerX() + 50,THIS.Y + THIS.PointerY() + 50)
- END IF
- end event
- event dw_uc::constructor;call super::constructor;dw_uc_h = this.height
- dw_uc_w = this.width
- end event
- type cb_rtr from w_publ_edit_choice`cb_rtr within w_plugins_edit
- end type
- type cb_help from w_publ_edit_choice`cb_help within w_plugins_edit
- end type
- type ln_bar from w_publ_edit_choice`ln_bar within w_plugins_edit
- end type
- type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_plugins_edit
- end type
- type r_bar from w_publ_edit_choice`r_bar within w_plugins_edit
- end type
|