delphi FMX常用事件类型及其别名

delphi FMX常用事件类型及其别名

 

一、System.Classes {标准事件 Standard events }
type
  TNotifyEvent = procedure(Sender: TObject) of object;
  TGetStrProc = procedure(const S: string) of object;

 

二、TControl class(TFmxObject, IControl, IContainerObject, IAlignRoot, IRotatedControl, IAlignableObject,
    IEffectContainer, IGestureControl, ITabStopController, ITriggerAnimation, ITriggerEffect)

  public

    property CustomSceneAddRect: TCustomSceneAddRectEvent read FCustomSceneAddRect write FCustomSceneAddRect;
    property OnDragEnter: TDragEnterEvent read FOnDragEnter write FOnDragEnter;
    property OnDragLeave: TNotifyEvent read FOnDragLeave write FOnDragLeave;
    property OnDragOver: TDragOverEvent read FOnDragOver write FOnDragOver;
    property OnDragDrop: TDragDropEvent read FOnDragDrop write FOnDragDrop;
    property OnDragEnd: TNotifyEvent read FOnDragEnd write FOnDragEnd;
    property OnKeyDown: TKeyEvent read FOnKeyDown write FOnKeyDown;
    property OnKeyUp: TKeyEvent read FOnKeyUp write FOnKeyUp;
    property OnClick: TNotifyEvent read FOnClick write SetOnClick stored OnClickStored;
    property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
    property OnCanFocus: TCanFocusEvent read FOnCanFocus write FOnCanFocus;
    property OnEnter: TNotifyEvent read FOnEnter write FOnEnter;
    property OnExit: TNotifyEvent read FOnExit write FOnExit;
    property OnMouseDown: TMouseEvent read FOnMouseDown write FOnMouseDown;
    property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove;
    property OnMouseUp: TMouseEvent read FOnMouseUp write FOnMouseUp;
    property OnMouseWheel: TMouseWheelEvent read FOnMouseWheel write FOnMouseWheel;
    property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
    property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
    property OnPainting: TOnPaintEvent read FOnPainting write FOnPainting;
    property OnPaint: TOnPaintEvent read FOnPaint write FOnPaint;
    property OnResize: TNotifyEvent read FOnResize write FOnResize;
    property OnResized: TNotifyEvent read FOnResized write FOnResized;
    property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
    property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
    property OnApplyStyleLookup: TNotifyEvent read FOnApplyStyleLookup write FOnApplyStyleLookup;

  published
    property Touch: TTouchManager read GetTouchManager write SetTouchManager;
    property OnGesture: TGestureEvent read FOnGesture write FOnGesture;
    property OnTap: TTapEvent read FOnTap write FOnTap;
  end;

三、FMX.Types

3.1、别名事件

  TMouseEvent = procedure(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single) of object;
  TMouseMoveEvent = procedure(Sender: TObject; Shift: TShiftState; X, Y: Single) of object;
  TMouseWheelEvent = procedure(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean) of object;
  TKeyEvent = procedure(Sender: TObject; var Key: Word; var KeyChar: WideChar; Shift: TShiftState) of object;
  TProcessTickEvent = procedure(Sender: TObject; time, deltaTime: Single) of object;
  TVirtualKeyboardEvent = procedure(Sender: TObject; KeyboardVisible: Boolean; const Bounds : TRect) of object;
  TTapEvent = procedure(Sender: TObject; const Point: TPointF) of object;
  TTouchEvent = procedure(Sender: TObject; const Touches: TTouches; const Action: TTouchAction) of object;


3.2、事件接口类,比如:

  IFreeNotification = interface
    ['{FEB50EAF-A3B9-4b37-8EDB-1EF9EE2F22D4}']
    procedure FreeNotification(AObject: TObject);
  end;

  IFreeNotificationBehavior = interface
    ['{83F052C5-8696-4AFA-88F5-DCDFEF005480}']
    procedure AddFreeNotify(const AObject: IFreeNotification);
    procedure RemoveFreeNotify(const AObject: IFreeNotification);
  end;

四、System.Types

4.1、异步多线程事件

  /// <summary>
  ///    Interface returned from various "BeginXXX" methods in order to provide asynchronous execution of code.
  /// </summary>
  IAsyncResult = interface
    ///  <summary>
    ///    Returns an event suitable for use to block until the asynchronous call is complete. This event is also suitable for
    ///    use in a list to allow waiting for all or any to be signaled. See the TMultiWaitEvent.WaitForXXX class
    ///    functions.
    ///  </summary>
    function GetAsyncWaitEvent: TMultiWaitEvent;
    ///  <summary>
    ///    Event suitable for use to block until the asynchronous call is complete. This event is also suitable for
    ///    use in a list to allow waiting for all or any to be signaled. See the TMultiWaitEvent.WaitForXXX class
    ///    functions.
    ///  </summary>
    property AsyncWaitEvent: TMultiWaitEvent read GetAsyncWaitEvent;

  TMultiWaitEvent = class abstract
  public
    ///  <summary>
    ///    Rather than use a constructor which will create an instance of <strong>this</strong> class, this will
    ///    return an instance of the registered descendent type that provides the actual implementation.
    ///  </summary>
    class function Create: TMultiWaitEvent; static;
    /// <summary>Wait until at least one of the indicated TMultiWaitEvents are signaled or Timeout is reached.
    ///    Returns the TMultiWaitEvent instance which was signaled and caused the function to return. Event is
    ///    undefined if Timeout is reached.
    /// </summary>
    class function WaitForAny(const Events: array of TMultiWaitEvent; out Event: TMultiWaitEvent; Timeout: Cardinal = INFINITE): TWaitResult; overload; static;

5、System.Classes

5.1、异步事件


  TAsyncProcedureEvent = procedure (const ASyncResult: IAsyncResult) of object;
  TAsyncFunctionEvent = procedure (const ASyncResult: IAsyncResult; out Result: TObject) of object;
  TAsyncConstArrayProcedureEvent = procedure (const ASyncResult: IAsyncResult; const Params: array of const) of object;
  TAsyncConstArrayFunctionEvent = procedure (const ASyncResult: IAsyncResult; out Result: TObject; const Params: array of const) of object;

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

专讲冷知识

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值