窗体动态效果的实现

news/2024/7/5 11:53:33

   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))
-------------------------------------------------------------------------------------


http://www.niftyadmin.cn/n/4049297.html

相关文章

Finalize什么时候被调用

Finalize方法在垃圾回收结束时被调用&#xff0c;有五种一下情况会导致开始垃圾回收。 第0代已满 第0代满时&#xff0c;垃圾回收会自动开始。改时间是目前导致Finalize方法被调用的最常见的一种方式&#xff0c;因为随着应用程序代码运行并分配新对象&#xff0c;这个时间会自…

Appium元素定位方式

1.由于Appium继承了Selenium,所以Selenium胡定位方式都可以使用。通过sdk->\tools 下的uiautomatorviewer工具获取id、name、classname等 2.uiautomator&#xff1a;driver.find_elements_by_android_uiautomator("uiautomator定位串")&#xff0c;实际上是调用ui…

ORACLE客户端连服务器的注意事项

ORACLE客户端连服务器的注意事项&#xff1a;(转载) 1. 通过SQL*NET协议&#xff0c;ORACLE客户端连服务器时一般需要配置sqlnet.ora和tnsnames.ora。 它们默认的目录在$ORACLE_HOME/network/admin 目录下 也可以设置环境变量TNS_ADMIN指向你想用的sqlnet.ora和t…

poj3417(LCA+DP)

题目连接&#xff1a;http://poj.org/problem?id3417 tarjan树DP 来自&#xff1a;http://www.cnblogs.com/scau20110726/archive/2013/05/31/3110666.html 1 #include<cstdio>2 #include<cstring>3 #include<algorithm>4 #include<cmath>5 using nam…

升级android studio 4.1没有flutter、Dart插件

升级Android Studio 4.1.3没有flutter、Dart插件&#xff0c;无法创建flutter项目。 搜索发现Android Studio 4.1.3安装之后不再自带flutter和dart ,需要自己手动安装。 点击Android Studio -> Preferences 搜索安装flutter和dart插件 在Marketplace搜索flutter和dart并…

java web实例训练知识错误总结(三)

一、request的getParameter()和getAttribute()的区别 getParameter 是用来接受用post个get方法传递过来的参数的.getAttribute 必须先setAttribute.&#xff08;1&#xff09;request.getParameter() 取得是通过容器的实现来取得通过类似post&#xff0c;get等方式传入的数据&a…

回家过年啦!

上上个星期六的晚上还是很冷&#xff08;1月6号&#xff09;&#xff0c;突然在星期天晚上在被窝里面感觉很热&#xff0c;自己第一次感觉到春天已经来到了&#xff01;我有一种说不出的心情。身处湖州&#xff0c;自己有一种很想回家的感觉&#xff0c;很想看看爸爸妈妈的感觉…