Delphi XE 之路(6)手势操作

简介: <div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px">  <span style="margin:0px; padding:0px; color:rgb(50,62,50); font-family:simsun">1.在窗体上
  1.在窗体上使用并放置一个TGestures控件是必需的
2.如果要操作控件,并使按件能支持手势操作,还要进行一些相应的设置才能使用
3. Delphi-XE5-手势操作-Gestures-使用方法
本经人试验(由于这玩意开发太慢,没办法一个个试出来,要好久的),主窗体的Touch下的GestureManager属性要指定TGestures控件,然后在Gestures下的Standard属性下要选中相应的动作,比如:
Left:从右到左划动
Right:从左到右划动
Up:从下到上划动
Down:从上到下划动
UpLeft:从下到上左
UpRight:从下到上右
剩下的你自己可以理解了..........
这里建议你只选你要的动作,不要什么动作都支持,那样的结果只会导致你的程序变的巨慢
这里还有一个属性集:
Delphi-XE5-手势操作-Gestures-使用方法
InterActiveGestures:交互手势
igZoom:选择为True后可以支持放大缩小功能
igPan:百度翻译为锅 Delphi-XE5-手势操作-Gestures-使用方法应该是支持画圆等操作(这个等我证实后再更正)
igRotate:旋转
igTwoFingerTap:支持两个手指同时操作
igPressAndTap: 新闻 水龙头(百度翻译)实际应该理解为手指划折线的支持(有待证实)
igLongTap: 长的 水龙头(百度翻译)实际理解为手指画长折线的支持(有待证实)
igDoubleTap:双击操作(字面理解,也没实践)

4.不支持动作的解决
可在窗体上放置一个标签用来显示动作值,即在窗体的onGesture事件中捕获EventInfo.GestureID的常量,通常从右往左手势的值为1,从左至右的手势值为2,如果能正确显示相应数值,基本上手势是在这个应用上被支持了,但至于你的手势是否被响应了,这要看你的代码了。

5.手势参考
Delphi 把可以识别的手势分成了 3 类: 标准手势、自定义手势、交互手势(InteractiveGestures).

其中的交互手势用鼠标不好模拟, 可能只能用于触摸屏;

Delphi 预定义了 34 种标准手势, 并定义成 TStandardGesture 枚举类型:
TStandardGesture = (  sgLeft            = sgiLeft,  sgRight          = sgiRight,  sgUp              = sgiUp,  sgDown            = sgiDown,  sgUpLeft          = sgiUpLeft,  sgUpRight        = sgiUpRight,  sgDownLeft        = sgiDownLeft,  sgDownRight      = sgiDownRight,  sgLeftUp          = sgiLeftUp,  sgLeftDown        = sgiLeftDown,  sgRightUp        = sgiRightUp,  sgRightDown      = sgiRightDown,  sgUpDown          = sgiUpDown,  sgDownUp          = sgiDownUp,  sgLeftRight      = sgiLeftRight,  sgRightLeft      = sgiRightLeft,  sgUpLeftLong      = sgiUpLeftLong,  sgUpRightLong    = sgiUpRightLong,  sgDownLeftLong    = sgiDownLeftLong,  sgDownRightLong  = sgiDownRightLong,  sgScratchout      = sgiScratchout,  sgTriangle        = sgiTriangle,  sgSquare          = sgiSquare,  sgCheck          = sgiCheck,  sgCurlicue        = sgiCurlicue,  sgDoubleCurlicue  = sgiDoubleCurlicue,  sgCircle          = sgiCircle,  sgDoubleCircle    = sgiDoubleCircle,  sgSemiCircleLeft  = sgiSemiCircleLeft,  sgSemiCircleRight = sgiSemiCircleRight,  sgChevronUp      = sgiChevronUp,  sgChevronDown    = sgiChevronDown,  sgChevronLeft    = sgiChevronLeft,  sgChevronRight    = sgiChevronRight);

Enum Symbol
sgLeft image:64GestLeft.gif
sgRight image:64GestRight.gif
sgUp image:64GestUp.gif
sgDown image:64GestDown.gif
sgUpLeft image:64GestUpLeft.gif
sgUpRight image:64GestUpRight.gif
sgDownLeft image:64GestDownLeft.gif
sgDownRight image:64GestDownRight.gif
sgLeftUp image:64GestLeftUp.gif
sgLeftDown image:64GestLeftDown.gif
sgRightUp image:64GestRightUp.gif
sgRightDown image:64GestRightDown.gif
sgUpDown image:64GestUpDown.gif
sgDownUp image:64GestDownUp.gif
sgLeftRight image:64GestLeftRight.gif
sgRightLeft image:64GestRightLeft.gif
sgUpLeftLong image:64GestUpLeftLong.gif
sgUpRightLong image:64GestUpRightLong.gif
sgDownLeftLong image:64GestDownLeftLong.gif
sgDownRightLong image:64GestDownRightLong.gif
sgScratchout image:64GestScratchOut.gif
sgTriangle image:64GestTriangle.gif
sgSquare image:64GestSquare.gif
sgCheck image:64GestCheck.gif
sgCurlicue image:64GestCurlicue.gif
sgDoubleCurlicue image:64GestDoubleCurlicue.gif
sgCircle image:64GestCircle.gif
sgDoubleCircle image:64GestDoubleCircle.gif
sgSemiCircleLeft image:64GestSemiCircleLeft.gif
sgSemiCircleRight image:64GestSemiCircleRight.gif
sgChevronUp image:64GestChevronUp.gif
sgChevronDown image:64GestChevronDown.gif
sgChevronLeft image:64GestChevronLeft.gif
sgChevronRight image:64GestChevronRight.gif
目录
相关文章
|
5月前
《QT从基础到进阶·十八》QT中的各种鼠标事件QEvent
《QT从基础到进阶·十八》QT中的各种鼠标事件QEvent
61 0
|
存储
VB来开发打字高手游戏,灵活运用时钟控件【VB学习笔记2020课堂版09】
VB来开发打字高手游戏,灵活运用时钟控件【VB学习笔记2020课堂版09】
VB来开发打字高手游戏,灵活运用时钟控件【VB学习笔记2020课堂版09】
|
Java Android开发 UED
delphi xe 之路(30)Delphi XE7 update1进步太大了
<span style="background-color:rgb(255,255,255)"><span style="color:rgb(64,64,64); font-family:'Microsoft YaHei','Helvetica Neue',SimSun; font-size:14px; line-height:21px">1.更新的bug列表并不全</span><br s
2568 0
Delphi XE之路(4)横屏问题
<span style="font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px">    查资料,drawable-port下为竖屏,drawable-land为横屏。在工程文件里再次添加loading.png文件,设置输出路径为drawable-land,编译执行。横屏下也能执行了!</span><br
1887 0
|
Android开发
delphi xe 之路(26)xe7开发的安卓程序,体积宏大
<span style="font-family:verdana,'ms song',宋体,Arial,微软雅黑,Helvetica,sans-serif; line-height:21px">原因没找到,但似乎可以这样解决: </span><br style="margin:0px; padding:0px; font-family:verdana,'ms song',宋体,Arial,
3274 0
Delphi XE之路(12) 手机屏幕自适应程序问题
<div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px"> <span style="margin:0px; padding:0px">布局ScaledLayout不是滚动屏幕的那种,感觉就是屏幕大了,就整体放大,屏幕小了就整体缩小
2967 0
delphi xe 之路(18)在图片上写字
<table cellspacing="0" cellpadding="0" id="blogContentTable" style="margin:0px; padding:0px; border-collapse:collapse; border-spacing:0px; color:rgb(68,68,68); font-family:punctuation,微软雅黑,Tohoma;
2702 0
|
数据库 索引
delphi xe 之路(20)clientdataset的详细介绍02
<div style="margin:0px; padding:0px; font-family:punctuation,微软雅黑,Tohoma; font-size:14px; line-height:22px"> <span style="margin:0px; padding:0px; color:rgb(12,12,12); font-family:simsun">ClientD
2396 0
|
IDE 开发工具
delphi xe 之路(14)使用FireMonkeyStyle
<p>FireMonkey使用Style来控制控件的显示方式。</p> <p>每个控件都有一个StyleLookup属性,FireMonkey就是通过控件的这个属性来在当前窗体的StyleBook控件中查找匹配的Style,如果找到了这个Style,那么控件就使用这个Style来显示。</p> <p> </p> <p>StyleBook是一个Style的集合,里面可以有窗体的Styl
3061 0