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

📄 w_comp_photo.srw

📁 powerbuilder
💻 SRW
📖 第 1 页 / 共 2 页
字号:
$PBExportHeader$w_comp_photo.srw
$PBExportComments$收货人照片保存信息
forward
global type w_comp_photo from window
end type
type cb_5 from commandbutton within w_comp_photo
end type
type cb_4 from commandbutton within w_comp_photo
end type
type st_3 from statictext within w_comp_photo
end type
type cb_3 from commandbutton within w_comp_photo
end type
type cb_2 from commandbutton within w_comp_photo
end type
type cb_1 from commandbutton within w_comp_photo
end type
type ole_1 from olecustomcontrol within w_comp_photo
end type
type p_1 from picture within w_comp_photo
end type
type sle_2 from singlelineedit within w_comp_photo
end type
type st_2 from statictext within w_comp_photo
end type
type sle_1 from singlelineedit within w_comp_photo
end type
type st_1 from statictext within w_comp_photo
end type
type gb_1 from groupbox within w_comp_photo
end type
type gb_2 from groupbox within w_comp_photo
end type
type gb_3 from groupbox within w_comp_photo
end type
end forward

global type w_comp_photo from window
integer width = 2894
integer height = 1652
boolean titlebar = true
string title = "Untitled"
boolean controlmenu = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
event uo_command pbm_syscommand
cb_5 cb_5
cb_4 cb_4
st_3 st_3
cb_3 cb_3
cb_2 cb_2
cb_1 cb_1
ole_1 ole_1
p_1 p_1
sle_2 sle_2
st_2 st_2
sle_1 sle_1
st_1 st_1
gb_1 gb_1
gb_2 gb_2
gb_3 gb_3
end type
global w_comp_photo w_comp_photo

type variables
us_tree_product_info iut_info

string is_comid,is_man //所属单位、收货人
string is_path //照片文件名

end variables

forward prototypes
public subroutine f_get_comp_photo ()
public subroutine f_photo_list ()
public function integer f_comp_sava_image ()
end prototypes

public subroutine f_get_comp_photo ();//获取数据库对应的收货人信息


blob lbl_data
long ll_w,ll_h

is_comid = trim(iut_info.product_no)
is_man = trim(iut_info.product_name)

if isnull(is_comid) or is_comid = '' then return
if isnull(is_man) or is_man = '' then return

sle_1.text = trim(gf_getmessage(is_comid,'1')) //所属企业
sle_2.text = trim(is_man) //收货人姓名

filedelete(is_path)

sqlca.autocommit = true
selectblob photo_data into :lbl_data from comp_photo where use_id = :gs_comid and p_co = :is_comid and pd_man1 = :is_man;
sqlca.autocommit = false

if isnull(lbl_data) then
	st_3.visible = true
else
	uf_blob_convert_wj(lbl_data,is_path)
	ll_w = p_1.width
	ll_h = p_1.height
	p_1.picturename = ''
	p_1.picturename = is_path
	p_1.width = ll_w
	p_1.height = ll_h
	st_3.visible = false
end if

end subroutine

public subroutine f_photo_list ();//启动摄像头

string ls_comp,ls_ifile




if ole_1.object.NumDevices < 1 then 
	messagebox('','当前无摄像头驱动信息!')
	return
end if

ls_ifile = gs_curpath+'config.dat'		
ls_comp = trim(profilestring(ls_ifile,'mcnnom','comp_id','0'))
		
if not(ole_1.object.IsConnected) then
	ole_1.object.connect(long(ls_comp))
	ole_1.object.AudioCompressorIndex = 1 
	ole_1.object.Preview = true
	ole_1.object.SaveJPGChromFactor = 36
	ole_1.object.SaveJPGLumFactor = 32
	ole_1.object.Interval = 60000
	ole_1.object.CaptionLeft = 0
	ole_1.object.CaptionTop = 0
	ole_1.object.FrameFile = is_path	
else
end if
end subroutine

public function integer f_comp_sava_image ();//将摄像头数据保存为文件并显示


ole_1.object.CaptureFrame()
ole_1.object.EndCapture()

if FileExists(is_path) then 
   p_1.setredraw(false)
	p_1.picturename = ''
	p_1.picturename = is_path
	st_3.visible = false
	p_1.width = 1157
	p_1.height = 988
   p_1.setredraw(true)
else
	this.enabled = true
	return 0
end if

return 1

end function

on w_comp_photo.create
this.cb_5=create cb_5
this.cb_4=create cb_4
this.st_3=create st_3
this.cb_3=create cb_3
this.cb_2=create cb_2
this.cb_1=create cb_1
this.ole_1=create ole_1
this.p_1=create p_1
this.sle_2=create sle_2
this.st_2=create st_2
this.sle_1=create sle_1
this.st_1=create st_1
this.gb_1=create gb_1
this.gb_2=create gb_2
this.gb_3=create gb_3
this.Control[]={this.cb_5,&
this.cb_4,&
this.st_3,&
this.cb_3,&
this.cb_2,&
this.cb_1,&
this.ole_1,&
this.p_1,&
this.sle_2,&
this.st_2,&
this.sle_1,&
this.st_1,&
this.gb_1,&
this.gb_2,&
this.gb_3}
end on

on w_comp_photo.destroy
destroy(this.cb_5)
destroy(this.cb_4)
destroy(this.st_3)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.ole_1)
destroy(this.p_1)
destroy(this.sle_2)
destroy(this.st_2)
destroy(this.sle_1)
destroy(this.st_1)
destroy(this.gb_1)
destroy(this.gb_2)
destroy(this.gb_3)
end on

event open;blob lbl_data //照片数据


this.title = '收货人照片信息'
is_path =  gs_curpath + 'picture\comp_photo.bmp' //照片暂存的路径及文件名
iut_info = message.powerobjectparm //获取收货人的信息

if not isvalid(iut_info) then 
	messagebox(gs_tip,'未传递有效的信息!')
	close(this)
	return
else
end if

f_get_comp_photo() //获取收货人对应的信息
f_photo_list() //启动摄像头

end event

event closequery;ole_1.object.disconnect()
end event

event activate;

//cb_4.triggerevent(clicked!)

end event

type cb_5 from commandbutton within w_comp_photo
integer x = 914
integer y = 1404
integer width = 370
integer height = 92
integer taborder = 70
integer textsize = -10
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "测试(&Z)"
end type

event clicked;f_comp_sava_image()
end event

type cb_4 from commandbutton within w_comp_photo
integer x = 480
integer y = 1404
integer width = 370
integer height = 92
integer taborder = 70
integer textsize = -10
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "刷新(&F)"
end type

event clicked;if not isvalid(w_pdct_out) then return

iut_info = w_pdct_out.uf_get_comp_photo() //获取当前收货人的信息

if  not isvalid(iut_info) or isnull(iut_info) then return

⌨️ 快捷键说明

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