毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

医药触摸屏管理系统 第3页

更新时间:2008-3-26:  来源:毕业论文

 

医药触摸屏管理系统 第3页

在代表生产厂家推介按钮的Shape1控件的Click事件中添加如下代码调用“生产厂家推介”表单。

set bell on       &&使Bell有效

SoundPath=Sys(5)+sys(2003)+"\sound\Toll.wav"  &&使Bell定向到WAV文件

set bell to SoundPath,0

?CHR(7)      &&播放该WAV文件

set bell to   &&取消定向

Thisform.Release

Do Form Form\生产厂家推介

Timer控件的Timer事件中添加如下代码实现滚动图片广告和当用户10秒内无操作时调用屏幕保护程序。

for i=1 to 16   &&滚动图片

        myimage="image"+alltrim(str(i))

        thisform.&myimage..left=iif(thisform.&myimage..left < -1016,1016,thisform.&myimage..left-8)

endfor

*******************当用户10秒内无操作时调用屏幕保护程序********************

cbuff=space(16)

mymouse=GetCursorPos(@cBuff)

X=ASC(substr(cBuff,2,1))*256+ASC(substr(cBuff,1,1))

Y=ASC(substr(cBuff,6,1))*256+ASC(substr(cBuff,5,1))

If TotalTimer=100

        Thisform.Release

        Do Form Form\屏幕保护程序

Else

        If MouseX!=X OR MouseY!=Y

                MouseX=ASC(substr(cBuff,2,1))*256+ASC(substr(cBuff,1,1))

                MouseY=ASC(substr(cBuff,6,1))*256+ASC(substr(cBuff,5,1))

                TotalTimer=0

        Else

                TotalTimer=TotalTimer+1

        Endif

Endif

4.2  屏幕保护程序设计

在本系统中还设置了屏幕保护程序。在10秒钟内如果用户不做任何操作,系统将自动调用屏幕保护程序。屏幕保护程序设计结果如图3所示。若图片无法显示请联系QQ752018766

3  屏幕保护程序窗口运行结果

1.表单设计

1)新建一个表单,命名为“屏幕保护程序.scx”,并将表单的Caption属性设置为“屏幕保护程序” ShowWindow属性设置为“2-作为顶层表单”,TitleBar属性设置为“0-关闭”,WindowState属性为“2-最大化”。

2)在表单上添加Timer控件、List控件、MediaPlayer控件和Contain控件。

3)重要控件的重要属性如表2所示。

2                              重要属性及值

对象

属性

Shape

BorderStyle

透明

List

Name

List1

2.代码设计

在表单的Load事件中添加如下代码用于定义程序中所需的变量并为其赋初值及API函数声明。

Public MouseX,MouseY,TotalTimer

Store 0 To MouseX,MouseY,TotalTimer

Declare integer GetCursorPos in user32 String@ lpPoint   &&声明API函数

*获取鼠标的坐标值

cbuff=space(16)

mymouse=GetCursorPos(@cBuff)

MouseX=ASC(substr(cBuff,2,1))*256+ASC(substr(cBuff,1,1))

MouseY=ASC(substr(cBuff,6,1))*256+ASC(substr(cBuff,5,1))

在表单的Init事件中添加如下代码将数据表中保存的视频文件信息添加到List控件中,用于循环播放。

Select Tab_Path

Go Top

Do While !Eof()

        thisform.list1.additem(Alltrim(Tab_Path.屏保路径))     &&添加一个列表项

        Skip

EndDo

thisform.list1.listindex=1     &&指定被选中的索引项

FileName=Alltrim(Thisform.List1.Value)

thisform.C1.mediaplayer1.fileName=&FileName.  &&设置播放曲目

Thisform.Height=768

Thisform.Width=1024

MediaPlayer控件的PlayStateChange事件中添加控制循环播放List控件中的全部视频文件(可以是广告信息)的代码。

if thisform.C1.mediaplayer1.PlayState=0      &&播放停止

        listvalue=thisform.list1.value

        if alltrim(thisform.C1.mediaplayer1.filename)=&listvalue.

                if thisform.list1.listindex<=thisform.list1.listcount-1   &&播放停止

                        thisform.list1.listindex=thisform.list1.listindex+1   &&播放下一首

                        FileName=Alltrim(Thisform.List1.Value)

                        thisform.C1.mediaplayer1.fileName=&FileName.  &&设置播放曲目

                else

                        thisform.list1.listindex=1

                        FileName=Alltrim(Thisform.List1.Value)

                        thisform.C1.mediaplayer1.fileName=&FileName.  &&设置播放曲目

                endif

        else

                FileName=Alltrim(Thisform.List1.Value)

                thisform.C1.mediaplayer1.fileName=&FileName.  &&设置播放曲目

        endif

endif

为了控制当用户操作鼠标时,关闭该屏幕保护程序,需要在Timer控件的Timer事件中添加如下代码:

cbuff=space(16)

mymouse=GetCursorPos(@cBuff)

X=ASC(substr(cBuff,2,1))*256+ASC(substr(cBuff,1,1))

Y=ASC(substr(cBuff,6,1))*256+ASC(substr(cBuff,5,1))

If MouseX!=X OR MouseY!=Y

        Thisform.C1.MediaPlayer1.Stop

        set bell on       &&使Bell有效

        SoundPath=Sys(5)+sys(2003)+"\sound\Toll.wav"  &&使Bell定向到WAV文件

        set bell to SoundPath,0

        ?CHR(7)      &&播放该WAV文件

        set bell to   &&取消定向

        Thisform.Release   &&释放表单

        Do Form Form\Index

Endif

4.3  生产厂家推介模块设计

在程序的主界面单击“生产厂家推介”按钮,即可进入到生产厂家推介模块。生产厂家推介模块主要将生产厂家的所有相关信息以列表的形式显示出来,并通过单击每一个生产厂家的厂名,分别可以进入每一个厂家的详细信息页面。生产厂家推介的运行结果如图4所示。

上一页  [1] [2] [3] [4] [5] [6] 下一页

医药触摸屏管理系统 第3页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。