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

📄 w_bookhandle.srw

📁 很普通的一个程序
💻 SRW
字号:
$PBExportHeader$w_bookhandle.srw
forward
global type w_bookhandle from window
end type
type cb_exit from commandbutton within w_bookhandle
end type
type cb_add from commandbutton within w_bookhandle
end type
type cb_next from commandbutton within w_bookhandle
end type
type cb_prior from commandbutton within w_bookhandle
end type
type cb_delete from commandbutton within w_bookhandle
end type
type cb_change from commandbutton within w_bookhandle
end type
type cb_giveup from commandbutton within w_bookhandle
end type
type cb_save from commandbutton within w_bookhandle
end type
type dw_1 from datawindow within w_bookhandle
end type
end forward

global type w_bookhandle from window
integer x = 462
integer y = 260
integer width = 2309
integer height = 1308
boolean titlebar = true
string title = "图书管理窗口"
boolean controlmenu = true
long backcolor = 79741120
string icon = "C:\Program Files\Powersoft\ArtGal\Icons\foldget.ico"
boolean center = true
cb_exit cb_exit
cb_add cb_add
cb_next cb_next
cb_prior cb_prior
cb_delete cb_delete
cb_change cb_change
cb_giveup cb_giveup
cb_save cb_save
dw_1 dw_1
end type
global w_bookhandle w_bookhandle

type variables
integer changeflag
end variables
on w_bookhandle.create
this.cb_exit=create cb_exit
this.cb_add=create cb_add
this.cb_next=create cb_next
this.cb_prior=create cb_prior
this.cb_delete=create cb_delete
this.cb_change=create cb_change
this.cb_giveup=create cb_giveup
this.cb_save=create cb_save
this.dw_1=create dw_1
this.Control[]={this.cb_exit,&
this.cb_add,&
this.cb_next,&
this.cb_prior,&
this.cb_delete,&
this.cb_change,&
this.cb_giveup,&
this.cb_save,&
this.dw_1}
end on

on w_bookhandle.destroy
destroy(this.cb_exit)
destroy(this.cb_add)
destroy(this.cb_next)
destroy(this.cb_prior)
destroy(this.cb_delete)
destroy(this.cb_change)
destroy(this.cb_giveup)
destroy(this.cb_save)
destroy(this.dw_1)
end on

event open;dw_1.SetTransObject(SQLCA)
dw_1.Retrieve()
dw_1.Enabled=False


end event
type cb_exit from commandbutton within w_bookhandle
integer x = 1879
integer y = 960
integer width = 347
integer height = 108
integer taborder = 90
integer textsize = -18
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "方正舒体"
string text = "退出"
boolean cancel = true
end type

event clicked;Close(parent)

end event
type cb_add from commandbutton within w_bookhandle
integer x = 1879
integer y = 556
integer width = 325
integer height = 108
integer taborder = 90
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = "增   加"
end type

event clicked;Integer li_Row
cb_add.Enabled=false
cb_delete.Enabled=false
cb_change.Enabled=false
cb_next.Enabled=false
cb_prior.Enabled=false
cb_save.Enabled=True
cb_giveup.Enabled=True

dw_1.Enabled=True
dw_1.Setfocus()
//插入一条空行记录,以待修改
li_Row=dw_1.InsertRow(0)
//滚动到指定行
dw_1.ScrollToRow(li_Row)

end event
type cb_next from commandbutton within w_bookhandle
integer x = 672
integer y = 1080
integer width = 430
integer height = 108
integer taborder = 80
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = "下一条记录"
end type

event clicked;//移动到下一条
dw_1.ScrollNextRow()
end event
type cb_prior from commandbutton within w_bookhandle
integer x = 123
integer y = 1068
integer width = 430
integer height = 108
integer taborder = 70
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = "上一条记录"
end type

event clicked;//移动到上一条记录
dw_1.ScrollPriorRow()

end event
type cb_delete from commandbutton within w_bookhandle
integer x = 1879
integer y = 700
integer width = 325
integer height = 108
integer taborder = 60
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = "删   除"
end type

event clicked;integer Net
Net=MessageBox("警告:","你确信要删除这条记录吗?",&
           Question!,YesNo!,2)
//删除当前光标所在行
if Net = 1 then 
	dw_1.DeleteRow(0)
end if
end event
type cb_change from commandbutton within w_bookhandle
integer x = 1202
integer y = 1080
integer width = 411
integer height = 108
integer taborder = 50
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = "允许修改"
end type

event clicked;choose case changeflag
case 0
	cb_add.Enabled=false
	cb_delete.Enabled=false
	cb_change.Enabled=false
	cb_next.Enabled=false
	cb_prior.Enabled=false
	cb_save.Enabled=True
	cb_giveup.Enabled=True
	dw_1.Enabled=True
	dw_1.Setfocus()
	changeflag=1
case 1
	cb_add.Enabled=true
	cb_delete.Enabled=true
	cb_change.Enabled=true
	cb_next.Enabled=true
	cb_prior.Enabled=true
	cb_save.Enabled=false
	cb_giveup.Enabled=false
	dw_1.Enabled=false
	changeflag=0
end choose



end event
type cb_giveup from commandbutton within w_bookhandle
integer x = 1861
integer y = 228
integer width = 325
integer height = 112
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
boolean enabled = false
string text = "放   弃"
end type

event clicked;dw_1.Enabled=False
Rollback Using SQLCA;
//dw_im.Reset()
dw_1.Retrieve()

cb_add.Enabled=True
cb_delete.Enabled=True
cb_change.Enabled=True
cb_next.Enabled=True
cb_prior.Enabled=True
cb_save.Enabled=False
cb_giveup.Enabled=False

cb_Prior.Setfocus()


end event
type cb_save from commandbutton within w_bookhandle
integer x = 1861
integer y = 76
integer width = 325
integer height = 108
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
boolean enabled = false
string text = "保   存"
end type

event clicked;Integer li_ReturnCode
string n1_bh
date no_bo

no_bo=date("2000-1-1")
li_ReturnCode=dw_1.UpDate()

//If li_ReturnCode > 0 then 
// Commit Using SQLCA;
// n1_bh=dw_im.getitemstring(dw_im.getrow(),1)
//  UPDATE "maindata"  
//     SET "jd" = :no_bo  
//   WHERE "maindata"."bh" = :n1_bh   ;
//else
// Messagebox("数据库操作错误",&
//  "错误 005: 对数据库的更新操作错误!放弃修改。",&
//  StopSign!,&
//  OK!)
// Rollback using SQLCA;
// dw_im.Retrieve() 
//end if

dw_1.retrieve()

cb_add.Enabled=true
cb_delete.Enabled=true
cb_change.Enabled=true
cb_next.Enabled=true
cb_prior.Enabled=true
cb_save.Enabled=False
cb_giveup.Enabled=False

dw_1.enabled=False
cb_Prior.Setfocus()
end event
type dw_1 from datawindow within w_bookhandle
integer x = 73
integer y = 84
integer width = 1719
integer height = 952
integer taborder = 10
string dataobject = "d_bookhandle"
borderstyle borderstyle = stylelowered!
end type

⌨️ 快捷键说明

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