📄 w_graph.srw
字号:
$PBExportHeader$w_graph.srw
$PBExportComments$图片管理
forward
global type w_graph from w_response
end type
type cb_5 from u_button_2 within w_graph
end type
type pb_1 from picturebutton within w_graph
end type
type cb_4 from u_button_2 within w_graph
end type
type cb_3 from u_button_2 within w_graph
end type
type cb_2 from u_button_2 within w_graph
end type
type cb_1 from u_button_2 within w_graph
end type
type p_1 from picture within w_graph
end type
type dw_2 from u_datawindow within w_graph
end type
type dw_1 from u_datawindow within w_graph
end type
end forward
global type w_graph from w_response
integer width = 2560
integer height = 1580
string title = "图片管理"
cb_5 cb_5
pb_1 pb_1
cb_4 cb_4
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
p_1 p_1
dw_2 dw_2
dw_1 dw_1
end type
global w_graph w_graph
type variables
long ll_selectoldrow,ll_selectnewrow
end variables
on w_graph.create
int iCurrent
call super::create
this.cb_5=create cb_5
this.pb_1=create pb_1
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.p_1=create p_1
this.dw_2=create dw_2
this.dw_1=create dw_1
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.cb_5
this.Control[iCurrent+2]=this.pb_1
this.Control[iCurrent+3]=this.cb_4
this.Control[iCurrent+4]=this.cb_3
this.Control[iCurrent+5]=this.cb_2
this.Control[iCurrent+6]=this.cb_1
this.Control[iCurrent+7]=this.p_1
this.Control[iCurrent+8]=this.dw_2
this.Control[iCurrent+9]=this.dw_1
end on
on w_graph.destroy
call super::destroy
destroy(this.cb_5)
destroy(this.pb_1)
destroy(this.cb_4)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.p_1)
destroy(this.dw_2)
destroy(this.dw_1)
end on
event open;call super::open;dw_1.insertrow(0)
//dw_2.object.datawindow.readonly=true
//dw_2.insertrow(0)
dw_2.retrieve()
end event
type cb_5 from u_button_2 within w_graph
integer x = 1906
integer y = 1332
integer taborder = 70
boolean enabled = false
string text = "取消"
end type
event clicked;call super::clicked;if cb_1.enabled=true and cb_2.enabled=true then
cb_1.enabled=false
cb_2.enabled=false
end if
if cb_3.enabled=false then cb_3.enabled=true
end event
type pb_1 from picturebutton within w_graph
integer x = 1385
integer y = 304
integer width = 101
integer height = 84
integer taborder = 20
integer textsize = -11
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string picturename = ".\Bmp\Open.bmp"
alignment htextalign = left!
vtextalign vtextalign = vcenter!
end type
event clicked;string ls_PathName,ls_FileName,ls_temp
integer li_Rtn
li_Rtn = GetFileOpenName("选择图片文件", ls_PathName, ls_FileName,'bmp',&
"支持的图片格式,*.jpg;*.bmp;*.gif;*.rle;*.wmf,"+&
"位图(.bmp),*.bmp,"+&
"JPEG(.jpg;.jpeg),*.jpg;*.jpeg,"+&
"RunLengthEncode(.rle),*.rle,"+&
"Windows MetaFile(.wmf),*.wmf")
IF li_Rtn <> 1 THEN return
ls_temp=ls_PathName //+ "\" + ls_FileName
dw_1.setitem(1,"address",ls_temp)
p_1.PictureName=ls_temp
p_1.setredraw(true)
//wf_show_picture(ls_pathName,ls_fileName)
//
end event
type cb_4 from u_button_2 within w_graph
integer x = 1527
integer y = 1332
integer taborder = 60
string text = "退出"
end type
event clicked;call super::clicked;close(parent)
end event
type cb_3 from u_button_2 within w_graph
integer x = 389
integer y = 1332
integer taborder = 50
string text = "增加"
end type
event clicked;call super::clicked;long ll_maxid=0,ll_count,ll_typeid
string ls_name
select max(id) into :ll_maxid from graph;
if isnull(ll_maxid) then ll_maxid=0
if ll_maxid<0 then ll_maxid=0
ll_typeid=dw_1.GetItemNumber(1,"typeid")
if isnull(ll_typeid) then
messagebox('错误','类型不能为空!',stopsign!)
dw_1.setfocus()
return
end if
ls_name=trim(dw_1.GetItemString(1,"address"))
if isnull(ls_name) then ls_name=''
if ls_name='' then
messagebox('错误','图片位置不能为空!',stopsign!)
dw_1.setfocus()
return
end if
ls_name=trim(dw_1.GetItemString(1,"name"))
if isnull(ls_name) then ls_name=''
if ls_name='' then
messagebox('错误','名称不能为空!',stopsign!)
dw_1.setfocus()
return
end if
ll_maxid ++
dw_1.object.id[1]=ll_maxid
select count(*) into :ll_count from graph where name=:ls_name;
if ll_count>0 then
messagebox("错误提示","图片名称重复!",stopsign!)
return
else
if dw_1.update()=1 then
//dw_1.reset()
commit;
dw_2.retrieve()
dw_1.reset()
dw_1.insertrow(0)
dw_1.setfocus()
else
rollback;
messagebox('错误','数据更新失败!')
return
end if
end if
messagebox("提示","数据保存成功",Exclamation!)
p_1.picturename="Bmp\back.bmp"
end event
type cb_2 from u_button_2 within w_graph
integer x = 1147
integer y = 1332
integer taborder = 30
boolean enabled = false
string text = "删除"
end type
event clicked;call super::clicked;integer li_box
li_box=messagebox("提示","确定要删除数据吗?",Question!,YesNo!)
if li_box=1 then
dw_1.deleterow(1)
if dw_1.update()=1 then
commit;
dw_2.retrieve()
dw_1.reset()
dw_1.insertrow(0)
dw_1.setfocus()
else
rollback;
messagebox('错误','数据更新失败!')
return
end if
cb_1.enabled=false
cb_2.enabled=false
cb_3.enabled=true
else
return
end if
end event
type cb_1 from u_button_2 within w_graph
integer x = 768
integer y = 1332
integer taborder = 40
boolean enabled = false
string text = "修改"
end type
event clicked;if dw_1.update()=1 then
commit;
dw_2.retrieve()
dw_1.reset()
dw_1.insertrow(0)
dw_1.setfocus()
else
rollback;
messagebox('错误','数据更新失败!')
return
end if
messagebox("提示","数据更新成功!")
cb_1.enabled=false
cb_2.enabled=false
cb_3.enabled=true
end event
type p_1 from picture within w_graph
integer x = 1559
integer y = 16
integer width = 974
integer height = 560
string picturename = ".\Bmp\back.bmp"
boolean border = true
boolean focusrectangle = false
end type
event doubleclicked;string ls_temp
ls_temp=p_1.picturename
openwithparm(w_picture,ls_temp)
end event
type dw_2 from u_datawindow within w_graph
integer x = 23
integer y = 616
integer width = 2496
integer height = 648
integer taborder = 0
string dataobject = "d_graphcx"
boolean vscrollbar = true
end type
event clicked;call super::clicked;ll_selectoldrow=this.getrow()
this.selectrow(ll_selectoldrow,true)
end event
event doubleclicked;call super::doubleclicked;long ll_id
string ls_address
ll_selectoldrow=this.getrow()
this.selectrow(ll_selectoldrow,true)
ll_id=this.getitemnumber(ll_selectoldrow,"id")
dw_1.retrieve(ll_id)
ls_address=this.getitemstring(ll_selectoldrow,"address")
p_1.PictureName=ls_address
p_1.setredraw(true)
cb_1.enabled=true
cb_2.enabled=true
cb_3.enabled=false
end event
event rowfocuschanged;call super::rowfocuschanged;ll_selectnewrow=this.getrow()
this.selectrow(ll_selectoldrow,false)
this.selectrow(ll_selectnewrow,true)
end event
type dw_1 from u_datawindow within w_graph
integer x = 46
integer y = 24
integer width = 1486
integer height = 560
string dataobject = "d_graphs"
boolean border = false
end type
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -