效果图
源码
1、创建一个DW、命名:d_login
2、创建一个Window窗口,命名:w_login
d_login 源码:
release 9;
datawindow(units=0 timer_interval=0 color=1073741824 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes hidegrayline=no )
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=1283 color="536870912" )
table(column=(type=char(10) updatewhereclause=yes name=userid dbname="userid" )
column=(type=char(10) updatewhereclause=yes name=pass dbname="pass" )
)
text(band=detail alignment="0" text="" border="0" color="33554432" x="0" y="0" height="1283" width="1605" html.valueishtml="0" name=t_backcolor visible="1" font.face="Arial" font.height="-13" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="134217731~trgb(229,207,170)" )
text(band=detail alignment="0" text="" border="0" color="33554432" x="1605" y="0" height="1283" width="1605" html.valueishtml="0" name=t_backcolor2 visible="1" font.face="Arial" font.height="-13" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="0" background.color="8421376~trgb(122,182,182)" )
text(band=detail alignment="0" text="" border="0" color="33554432" x="1104" y="179" height="966" width="1112" html.valueishtml="0" name=t_2 visible="1" font.face="Arial" font.height="-13" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="8421504" )
text(band=detail alignment="0" text="" border="0" color="33554432" x="1064" y="131" height="986" width="1112" html.valueishtml="0" name=t_3 visible="1" font.face="Arial" font.height="-13" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
column(band=detail id=1 alignment="0" tabsequence=10 border="4" color="33554432" x="1452" y="477" height="86" width="589" format="[general]" html.valueishtml="0" name=userid visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="微软雅黑" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
column(band=detail id=2 alignment="0" tabsequence=20 border="4" color="33554432" x="1452" y="666" height="86" width="589" format="[general]" html.valueishtml="0" name=pass visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="微软雅黑" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="密 码:" border="0" color="33554432" x="1126" y="672" height="74" width="271" html.valueishtml="0" name=pass_t visible="1" font.face="微软雅黑" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
text(band=detail alignment="1" text="用户名:" border="0" color="33554432" x="1126" y="483" height="74" width="271" html.valueishtml="0" name=userid_t visible="1" font.face="微软雅黑" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
button(band=detail text="登录" enabled=yes action="0" border="0" color="0" x="1404" y="880" height="134" width="461" vtextalign="0" htextalign="0" name=b_login visible="1" font.face="微软雅黑" font.height="-12" font.weight="700" font.family="2" font.pitch="2" font.charset="134" background.mode="2" background.color="12639424" )
text(band=detail alignment="2" text="用户登录" border="0" color="33554432" x="1349" y="237" height="128" width="589" html.valueishtml="0" name=t_1 visible="1" font.face="微软雅黑" font.height="-18" font.weight="700" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
text(band=detail alignment="2" text="×" border="0" color="0" x="3094" y="13" height="83" width="106" html.valueishtml="0" name=t_close visible="1" font.face="宋体" font.height="-14" font.weight="700" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="553648127" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" )
w_login 源码
forward
global type w_login from window
end type
type dw_1 from datawindow within w_login
end type
end forward
global type w_login from window
integer width = 3207
integer height = 1213
boolean border = false
windowtype windowtype = popup!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
dw_1 dw_1
end type
global w_login w_login
type prototypes
function unsignedlong keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'
end prototypes
on w_login.create
this.dw_1=create dw_1
this.Control[]={this.dw_1}
end on
on w_login.destroy
destroy(this.dw_1)
end on
event open;dw_1.insertrow(0)
dw_1.move(0,-5)
end event
type dw_1 from datawindow within w_login
event uo_dwmove pbm_dwnmousemove
event uo_dwkey pbm_dwnkey
integer width = 3222
integer height = 1261
integer taborder = 30
string title = "none"
string dataobject = "d_login"
boolean border = false
boolean livescroll = true
borderstyle borderstyle = stylelowered!
end type
event uo_dwmove;string ls_Object
long ll_width,ll_height,ll_x,ll_y
if row > 0 then
ls_Object = Lower(This.GetObjectAtPointer())
if pos(ls_Object,'t_close') > 0 then
this.object.t_close.color = 255
else
this.object.t_close.color = 33554432
end if
end if
end event
event uo_dwkey;CHOOSE CASE key
CASE KeyEnter!
send(handle(this),256,9,long(0,0))
CASE KeyDownArrow! //,KeyRightArrow!
keybd_event ( 9, 0, 0 , 0 ) // 按下tab
keybd_event ( 9, 0, 2, 0 ) // 释放tab
Return 1
CASE KeyUpArrow!,KeyLeftArrow!
keybd_event ( 16, 0, 0, 0 ) // 按下shift
keybd_event ( 9, 0, 0 , 0 ) // 按下tab
keybd_event ( 9, 0, 2, 0 ) // 释放tab
keybd_event ( 16, 0, 2, 0 ) // 释放shift
Return 1
END CHOOSE
end event
event buttonclicked;if row > 0 then
choose case dwo.name
case 'b_login'
messagebox("提示","登录")
end choose
end if
end event
event clicked;if row > 0 then
choose case dwo.name
case 't_close'
close(parent)
end choose
end if
end event