delphi手势,左右滑动,
控件的OnGesture事件写代码。
放一个TGestureManager控件,设置控件的touch属性为TGestureManager控件。
然后勾选控件的Touch>Gestures>Standard>里的手势类型,left,right,up,down等等,然后在OnGesture事件就可以捕捉到了。
官方的手势图
http://docwiki.embarcadero.com/RADStudio/Berlin/en/TStandardGesture_Enum
Field | Description |
---|---|
GestureID |
The ID of the gesture that is emitted. ID is an integer value uniquely identifying the gesture. |
Location |
The current point on the control's surface. Location contains the X and Y coordinates of the last known point. |
Flags |
A set of TInteractiveGestureFlag options describing the state of the interactive gesture. Flags is only valid if the gesture is interactive. |
Angle |
The angle in radians (rad) in which either the finger or a gesturing device has moved relative to the screen coordinates. Angle is only set for the rotation gesture (TInteractiveGesture = Rotate):
|
Distance |
The distance in pixels from the current point, given by Location, and the previous point. Distance is only set for the zoom and two finger tap gestures (TInteractiveGesture = Zoom or TwoFingerTap). Distance is the distance between the two fingers or gesturing devices that are making the gesture. |
InertiaVector |
The inertia speed given by an X and Y pair. A positive X value means inertia toward the right of the screen, while a negative value means inertia to the left. A positive Y value means inertia toward the bottom of the screen, while a negative value means inertia to the top. InertiaVector is only valid if the event is interactive. |
TapLocation |
Specifies the coordinates of the "tap" and "press and tap" (igPressAndTap) gestures. |
procedure TForm1.GridPanelLayout1Gesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean); begin case EventInfo.GestureID of sgiRight://向右滑动 begin end; end; end;
case EventInfo.GestureID of sgiLeft: begin if TabControl1.ActiveTab <> TabControl1.Tabs[TabControl1.TabCount - 1] then TabControl1.ActiveTab := TabControl1.Tabs[TabControl1.TabIndex + 1]; Handled := True; end; sgiRight: begin if TabControl1.ActiveTab <> TabControl1.Tabs[0] then TabControl1.ActiveTab := TabControl1.Tabs[TabControl1.TabIndex - 1]; Handled := True; end; end;
返回键
procedure TTabbedwithNavigationForm.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin if Key = vkHardwareBack then begin if (TabControl1.ActiveTab = TabItem1) and (TabControl2.ActiveTab = TabItem6) then begin TabControl2.Previous; Key := 0; end; end;
touch与mouseup事件,先出发mouseUp事件,然后才触发ontouch事件。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
2015-03-09 改变画布大小
2015-03-09 c# 数据集调试工具插件
2015-03-09 数据库连接补丁 驱动