王朝网络
分享
 
 
 

窗体动态效果的实现

王朝mssql·作者佚名  2006-12-17
宽屏版  字体: |||超大  

窗体动态效果的实现

窗体动态效果的实现 最近用pb做了一个触摸屏的程序,项目组要求窗口显示关闭的时候有点动态效果,于是我就写了如下的程序,供大家参考借鉴。

-------------------------------------------------------------------------------------

// 实现关闭窗体时的动态效果

// ---------------------------------------------------------

// 函数名:gf_closequery

// 参数说明:

// window window类型,调用窗口的名字

// closetype integer类型,窗口关闭方式,value = 0~10

// ---------------------------------------------------------

// 申明局部变量

int li_x ,li_y,li_width,li_height,li_ceny,li_cenx,li_xminusy,li_wminush

Integer li_gd

// 取出当前窗口的坐标值、大小值

li_x = window.x

li_y = window.y

li_width = window.width

li_height = window.height

// 设置窗体关闭前的动画效果

// 关键是看哪个值发生了变化——x、y、h、w

CHOOSE CASE closetype

CASE 0 // closetype = 0,从下到上逐渐消失

for li_gd = li_height to 0 step -1

window.height = li_gd

window.show()

next

CASE 1 // closetype = 1,从上到下逐渐消失

for li_gd = li_y to li_height+li_y step 1

window.y = li_gd

window.height = li_height+li_y - li_gd

window.show()

next

CASE 2 // closetype = 2,从右到左逐渐消失

for li_gd = li_width to 0 step -1

window.width = li_gd

next

CASE 3 // closetype = 3,从左到右逐渐消失

for li_gd = li_x to li_x+li_width step 1

window.x = li_gd

window.width = li_x+li_width - li_gd

window.show()

next

case 4 // closetype = 4,从上下向中间挤压逐渐消失

li_ceny = li_y+li_height/2

for li_gd = li_y to li_ceny step 1

window.y = li_gd

window.height = li_height - 2*(li_gd - li_y)

next

case 5 // closetype = 5,从左右向中间挤压逐渐消失

li_cenx = li_x+li_width / 2

for li_gd = li_x to li_cenx step 1

window.x = li_gd

window.width = li_width - 2*(li_gd - li_x)

next

case 6 // closetype = 6,从左上->右下

for li_gd = li_y to li_height+li_y step 1

window.y = li_gd

window.height = li_height+li_y - li_gd

if window.x < li_x + li_width then

window.x = li_x + (li_gd - li_y)

else

window.x = li_x + li_width

end if

if window.width > 0 then

window.width = li_x+li_width - window.x

else

window.width = 0

end if

next

window.x = li_x + li_width

window.y = li_height+li_y

window.width = 0

window.height = 0

window.show()

case 7 // closetype = 7,从右下->左上

for li_gd = li_height to 0 step -1

window.height = li_gd

if window.width > 0 then

window.width = li_width - (li_height - li_gd)

else

window.width = 0

end if

next

window.x = li_x

window.y = li_y

window.width = 0

window.height = 0

window.show()

case 8 // closetype = 8,从右上->左下

for li_gd = li_y to li_height+li_y step 1

window.y = li_gd

window.height = li_height+li_y - li_gd

if window.width > 0 then

window.width = li_width - (li_gd - li_y)

else

window.width = 0

end if

next

window.x = li_x

window.y = li_height+li_y

window.width = 0

window.height = 0

window.show()

case 9 // closetype = 9,从左下->右上

for li_gd = li_x to li_x+li_width step 1

window.x = li_gd

window.width = li_width +li_x -li_gd

if window.height > 0 then

window.height = li_height -(li_gd - li_x)

else

window.height = 0

end if

next

window.x = li_x+li_width

window.y = li_y

window.width = 0

window.height = 0

window.show()

case 10 // closetype = 10,从四面到中间

li_ceny = li_y+li_height/2

li_cenx = li_x+li_width / 2

for li_gd = li_y to li_ceny step 1

window.y = li_gd

window.height = li_height - 2*(li_gd - li_y)

if window.x < li_x + li_cenx then

window.x = li_x + (li_gd - li_y)

else

window.x = li_x + li_cenx

end if

if window.width > 0 then

window.width = li_width - 2*(li_gd - li_y)

else

window.width = 0

end if

next

window.x = li_cenx

window.y = li_ceny

window.width = 0

window.height = 0

window.show()

case else

window.show()

window.width = li_width

window.height = li_height

window.x = li_x

window.y = li_y

END CHOOSE

return 0

***********************************

// 调用该函数在窗体的 closequery 事件中

gf_closequery (w_main,mod(integer(string(now(),"ss")),11))

-------------------------------------------------------------------------------------

上面是关闭时的效果,窗体打开时的动态效果的语句跟上面的差不多,在此就不写啦,如果有需要的可以告诉我,我单独发送。谢谢。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
>>返回首页<<
推荐阅读
 
 
频道精选
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有