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

📄 w_rate.srw

📁 pb所需编程技巧和事例
💻 SRW
字号:
$PBExportHeader$w_rate.srw
forward
global type w_rate from window
end type
type dw_1 from datawindow within w_rate
end type
type ddlb_2 from dropdownlistbox within w_rate
end type
type ddlb_1 from dropdownlistbox within w_rate
end type
type em_2 from editmask within w_rate
end type
type st_8 from statictext within w_rate
end type
type st_new from statictext within w_rate
end type
type rb_2 from radiobutton within w_rate
end type
type rb_1 from radiobutton within w_rate
end type
type cb_2 from commandbutton within w_rate
end type
type cb_1 from commandbutton within w_rate
end type
type st_6 from statictext within w_rate
end type
type st_5 from statictext within w_rate
end type
type em_1 from editmask within w_rate
end type
type st_4 from statictext within w_rate
end type
type st_3 from statictext within w_rate
end type
type st_2 from statictext within w_rate
end type
type st_1 from statictext within w_rate
end type
type ln_1 from line within w_rate
end type
end forward

global type w_rate from window
integer width = 2533
integer height = 1912
boolean titlebar = true
string title = "外汇兑换工具"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
dw_1 dw_1
ddlb_2 ddlb_2
ddlb_1 ddlb_1
em_2 em_2
st_8 st_8
st_new st_new
rb_2 rb_2
rb_1 rb_1
cb_2 cb_2
cb_1 cb_1
st_6 st_6
st_5 st_5
em_1 em_1
st_4 st_4
st_3 st_3
st_2 st_2
st_1 st_1
ln_1 ln_1
end type
global w_rate w_rate

type variables
real a1,a2
end variables

on w_rate.create
this.dw_1=create dw_1
this.ddlb_2=create ddlb_2
this.ddlb_1=create ddlb_1
this.em_2=create em_2
this.st_8=create st_8
this.st_new=create st_new
this.rb_2=create rb_2
this.rb_1=create rb_1
this.cb_2=create cb_2
this.cb_1=create cb_1
this.st_6=create st_6
this.st_5=create st_5
this.em_1=create em_1
this.st_4=create st_4
this.st_3=create st_3
this.st_2=create st_2
this.st_1=create st_1
this.ln_1=create ln_1
this.Control[]={this.dw_1,&
this.ddlb_2,&
this.ddlb_1,&
this.em_2,&
this.st_8,&
this.st_new,&
this.rb_2,&
this.rb_1,&
this.cb_2,&
this.cb_1,&
this.st_6,&
this.st_5,&
this.em_1,&
this.st_4,&
this.st_3,&
this.st_2,&
this.st_1,&
this.ln_1}
end on

on w_rate.destroy
destroy(this.dw_1)
destroy(this.ddlb_2)
destroy(this.ddlb_1)
destroy(this.em_2)
destroy(this.st_8)
destroy(this.st_new)
destroy(this.rb_2)
destroy(this.rb_1)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.st_6)
destroy(this.st_5)
destroy(this.em_1)
destroy(this.st_4)
destroy(this.st_3)
destroy(this.st_2)
destroy(this.st_1)
destroy(this.ln_1)
end on

event open;long rc
SetPointer(Hourglass!)
integer  i

dw_1.settransobject(Sqlca)
dw_1.retrieve()
rc=dw_1.rowcount()

for i=1 to rc
  ddlb_1.additem(dw_1.getitemstring(i,"currencyname"))
  ddlb_2.additem(dw_1.getitemstring(i,"currencyname"))
next
end event

type dw_1 from datawindow within w_rate
integer x = 1189
integer y = 376
integer width = 1230
integer height = 468
integer taborder = 50
boolean titlebar = true
string title = "外汇牌价管理     (退出时保存修改)"
string dataobject = "d_rate"
boolean vscrollbar = true
boolean livescroll = true
borderstyle borderstyle = StyleLowered!
end type

type ddlb_2 from dropdownlistbox within w_rate
string tag = "~"请选择币种~""
integer x = 1746
integer y = 212
integer width = 549
integer height = 496
integer taborder = 40
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean autohscroll = true
boolean hscrollbar = true
boolean vscrollbar = true
string item[] = {""}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;select price 
into :a2
from changerate
where currencyname=:ddlb_2.text
using sqlca;

if a2>0 and a1>0 and em_1.enabled=false then
	em_1.text=string(a1/a2)
end if
st_8.text="可兑换"+ddlb_2.text+":"
end event

type ddlb_1 from dropdownlistbox within w_rate
string tag = "~"请选择币种~""
integer x = 416
integer y = 228
integer width = 549
integer height = 488
integer taborder = 30
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean autohscroll = true
boolean hscrollbar = true
boolean vscrollbar = true
string item[] = {""}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;select price 
into :a1
from changerate
where currencyname=:ddlb_1.text
using sqlca;
if a2>0 and a1>0 and em_1.enabled=false then
	em_1.text=string(a1/a2)
end if
st_4.text="输入"+ddlb_1.text +"的金额:"
end event

type em_2 from editmask within w_rate
integer x = 1038
integer y = 1092
integer width = 699
integer height = 96
integer taborder = 40
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
string mask = "###,###.00"
boolean usecodetable = true
end type

type st_8 from statictext within w_rate
integer x = 105
integer y = 1288
integer width = 914
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 134217856
long backcolor = 67108864
string text = "可兑换  "
boolean focusrectangle = false
end type

type st_new from statictext within w_rate
integer x = 1033
integer y = 1284
integer width = 704
integer height = 96
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 32768
long backcolor = 134217737
boolean focusrectangle = false
end type

type rb_2 from radiobutton within w_rate
integer x = 599
integer y = 608
integer width = 517
integer height = 96
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "人工输入"
end type

event clicked;em_1.enabled=true
end event

type rb_1 from radiobutton within w_rate
integer x = 594
integer y = 476
integer width = 517
integer height = 96
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "自动"
boolean checked = true
end type

event clicked;em_1.enabled=false
end event

type cb_2 from commandbutton within w_rate
integer x = 1856
integer y = 1244
integer width = 517
integer height = 132
integer taborder = 30
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "退出"
end type

event clicked;integer li_rc
// Accept the last data entered into the datawindow
dw_1.AcceptText()
//Check to see if any data has changed
IF dw_1.DeletedCount()+dw_1.ModifiedCount() > 0 THEN
	li_rc = MessageBox("警告:将要关闭!", "保存更改吗?", Question!, YesNoCancel!, 3)
	//如果选择保存后关闭
	IF li_rc = 1 THEN
		connect;
	If dw_1.Update() = 1 then
		commit;
	else 
		rollback using sqlca;
	End if
	//用户选择关闭窗口但不更改
	ELSEIF li_rc = 2 THEN		
		close(parent)
	//用户选择放弃关闭窗口
	ELSE
		RETURN 1
	END IF
ELSE
	// 数据没有变化,仅关闭窗口
	close(parent)
END IF
end event
type cb_1 from commandbutton within w_rate
integer x = 1847
integer y = 1044
integer width = 517
integer height = 132
integer taborder = 30
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "计算"
end type

event clicked;double oldmoney,rate
em_1.getdata(rate)
em_2.getdata(oldmoney)
st_new.text=string(oldmoney*rate)
end event

type st_6 from statictext within w_rate
integer x = 59
integer y = 568
integer width = 517
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "汇率输入选择"
boolean focusrectangle = false
end type

type st_5 from statictext within w_rate
integer x = 82
integer y = 820
integer width = 416
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "汇  率"
boolean focusrectangle = false
end type

type em_1 from editmask within w_rate
integer x = 585
integer y = 808
integer width = 517
integer height = 96
integer taborder = 40
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean enabled = false
string text = "0.00"
borderstyle borderstyle = stylelowered!
string mask = "####.000"
end type

type st_4 from statictext within w_rate
integer x = 87
integer y = 1088
integer width = 914
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "请输入金额  "
boolean focusrectangle = false
end type

type st_3 from statictext within w_rate
integer x = 1303
integer y = 236
integer width = 347
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "兑换币种 "
boolean focusrectangle = false
end type

type st_2 from statictext within w_rate
integer x = 59
integer y = 236
integer width = 293
integer height = 76
integer textsize = -12
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 128
long backcolor = 67108864
string text = "原币种 "
boolean focusrectangle = false
end type

type st_1 from statictext within w_rate
integer x = 626
integer y = 40
integer width = 1467
integer height = 148
integer textsize = -18
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = fixed!
fontfamily fontfamily = modern!
string facename = "楷体_GB2312"
long textcolor = 32768
long backcolor = 67108864
string text = "外币兑换计算器 (仅供参考)"
boolean focusrectangle = false
end type

type ln_1 from line within w_rate
long linecolor = 134217857
integer linethickness = 10
integer beginx = 37
integer beginy = 1212
integer endx = 2427
integer endy = 1212
end type

⌨️ 快捷键说明

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