⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w_taskpersonel.srw

📁 pb所需编程技巧和事例
💻 SRW
字号:
$PBExportHeader$w_taskpersonel.srw
forward
global type w_taskpersonel from window
end type
type cb_4 from commandbutton within w_taskpersonel
end type
type cb_3 from commandbutton within w_taskpersonel
end type
type cb_2 from commandbutton within w_taskpersonel
end type
type cb_1 from commandbutton within w_taskpersonel
end type
type cb_exit from commandbutton within w_taskpersonel
end type
type cb_save from commandbutton within w_taskpersonel
end type
type cb_update from commandbutton within w_taskpersonel
end type
type cb_del from commandbutton within w_taskpersonel
end type
type cb_add from commandbutton within w_taskpersonel
end type
type dw_1 from datawindow within w_taskpersonel
end type
type gb_1 from groupbox within w_taskpersonel
end type
end forward

global type w_taskpersonel from window
integer width = 3831
integer height = 2452
boolean titlebar = true
string title = "实验室任务及人员情况"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "Information!"
boolean center = true
cb_4 cb_4
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
cb_exit cb_exit
cb_save cb_save
cb_update cb_update
cb_del cb_del
cb_add cb_add
dw_1 dw_1
gb_1 gb_1
end type
global w_taskpersonel w_taskpersonel

on w_taskpersonel.create
this.cb_4=create cb_4
this.cb_3=create cb_3
this.cb_2=create cb_2
this.cb_1=create cb_1
this.cb_exit=create cb_exit
this.cb_save=create cb_save
this.cb_update=create cb_update
this.cb_del=create cb_del
this.cb_add=create cb_add
this.dw_1=create dw_1
this.gb_1=create gb_1
this.Control[]={this.cb_4,&
this.cb_3,&
this.cb_2,&
this.cb_1,&
this.cb_exit,&
this.cb_save,&
this.cb_update,&
this.cb_del,&
this.cb_add,&
this.dw_1,&
this.gb_1}
end on

on w_taskpersonel.destroy
destroy(this.cb_4)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.cb_exit)
destroy(this.cb_save)
destroy(this.cb_update)
destroy(this.cb_del)
destroy(this.cb_add)
destroy(this.dw_1)
destroy(this.gb_1)
end on

event open;dw_1.SetTransObject(Sqlca)
dw_1.Retrieve()
end event

type cb_4 from commandbutton within w_taskpersonel
integer x = 1234
integer y = 2076
integer width = 302
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "末一条"
end type

event clicked;dw_1.ScrollToRow(dw_1.RowCount())
end event
type cb_3 from commandbutton within w_taskpersonel
integer x = 864
integer y = 2076
integer width = 302
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "下一条"
end type

event clicked;dw_1.ScrollNextRow()
end event

type cb_2 from commandbutton within w_taskpersonel
integer x = 494
integer y = 2076
integer width = 302
integer height = 128
integer taborder = 50
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "上一条"
end type

event clicked;dw_1.ScrollPriorRow()
end event

type cb_1 from commandbutton within w_taskpersonel
integer x = 114
integer y = 2076
integer width = 302
integer height = 128
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "第一条"
end type

event clicked;dw_1.ScrollToRow(0)

end event
type cb_exit from commandbutton within w_taskpersonel
integer x = 2971
integer y = 1996
integer width = 457
integer height = 128
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "退出(E&xit)"
end type

event clicked;close(parent)
end event

type cb_save from commandbutton within w_taskpersonel
integer x = 2290
integer y = 2156
integer width = 539
integer height = 128
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "保存(&Save)"
end type

event clicked;cb_add.enabled=true
cb_del.enabled=true
cb_update.enabled=true
cb_save.enabled=false
cb_exit.enabled=true
dw_1.enabled=false
dw_1.update()

end event

type cb_update from commandbutton within w_taskpersonel
integer x = 1641
integer y = 2156
integer width = 539
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "更改(&Update)"
end type

event clicked;cb_add.enabled=false
cb_del.enabled=false
cb_update.enabled=false
cb_save.enabled=true
cb_exit.enabled=false
dw_1.enabled=true
end event

type cb_del from commandbutton within w_taskpersonel
integer x = 2290
integer y = 2000
integer width = 539
integer height = 128
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "删除(&Del)"
end type

event clicked;dw_1.deleterow(0)
end event

type cb_add from commandbutton within w_taskpersonel
string tag = "jack"
integer x = 1637
integer y = 2000
integer width = 539
integer height = 128
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "添加(&Add)"
end type

event clicked;long ll;
ll=dw_1.InsertRow(0)
dw_1.ScrollToRow(ll)
cb_add.enabled=false
cb_del.enabled=false
cb_update.enabled=false
cb_save.enabled=true
cb_exit.enabled=false
dw_1.enabled=true
end event

type dw_1 from datawindow within w_taskpersonel
integer x = 69
integer y = 68
integer width = 3657
integer height = 1872
integer taborder = 10
boolean enabled = false
string title = "none"
string dataobject = "d_taskpersonel"
boolean vscrollbar = true
boolean livescroll = true
borderstyle borderstyle = stylelowered!
end type

event itemchanged;integer a1,a2,a3,a4,a1234  //人时数,小计
integer b1,b2,b3,b4,b1234  //教师,小计
integer c1,c2,c3,c4,c1234  //实验技术人员,小计
integer d1,d2,sum          //工人,其他,合计

dw_1.AcceptText()

a1=dw_1.GetItemNumber(row,"postgraduate")
a2=dw_1.GetItemNumber(row,"undergraduate")
a3=dw_1.GetItemNumber(row,"technicalschooler")
a4=dw_1.GetItemNumber(row,"other_hours")

b1=dw_1.GetItemNumber(row,"worker_professor")
b2=dw_1.GetItemNumber(row,"worker_lecturer")
b3=dw_1.GetItemNumber(row,"worker_teacher_fulltime_other")
b4=dw_1.GetItemNumber(row,"worker_techer_parttime")

c1=dw_1.GetItemNumber(row,"senior_engineer")
c2=dw_1.GetItemNumber(row,"engineer")
c3=dw_1.GetItemNumber(row,"othertechnician")
c4=dw_1.GetItemNumber(row,"worker_technician_technician")

d1=dw_1.GetItemNumber(row,"worker_general")
d2=dw_1.GetItemNumber(row,"worker_other")

choose case dwo.name
	case "postgraduate","undergraduate","technicalschooler","other_hours"
		a1234=0		
		if not IsNull(a1) then a1234+=a1
		if not IsNull(a2) then a1234+=a2
		if not IsNull(a3) then a1234+=a3
		if not IsNull(a4) then a1234+=a4		
		dw_1.setItem(row,"hours_sum",a1234)
		
	case "worker_professor","worker_lecturer","worker_teacher_fulltime_other","worker_techer_parttime","senior_engineer","engineer","othertechnician","worker_technician_technician","worker_general","worker_other"
		
		b1234=0		
		if not IsNull(b1) then b1234+=b1
		if not IsNull(b2) then b1234+=b2
		if not IsNull(b3) then b1234+=b3
		if not IsNull(b4) then b1234+=b4		
		dw_1.setItem(row,"worker_teacher_sum",b1234)
		
		c1234=0		
		if not IsNull(c1) then c1234+=c1
		if not IsNull(c2) then c1234+=c2
		if not IsNull(c3) then c1234+=c3
		if not IsNull(c4) then c1234+=c4		
		dw_1.setItem(row,"worker_technician_sum",c1234)
		
		sum=b1234+c1234
		if not IsNull(d1) then sum+=d1
		if not IsNull(d2) then sum+=d2
		dw_1.setItem(row,"worker_sum",sum)
		
end choose
			
end event

type gb_1 from groupbox within w_taskpersonel
integer x = 73
integer y = 2008
integer width = 1518
integer height = 228
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
long backcolor = 67108864
end type

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -