zoukankan      html  css  js  c++  java
  • 关于自定义控件捕获 EButton1Up 事件

    我写了一个自定义控件,该控件支持  Drag ,当我在这个控件中按住不放,然后向 CBA 移动,当移动到 CBA 上面时,松开,
    则自定义控件不处理 EButton1Up 事件,因为拖动的范围超过了这个控件的 Rect 了

    问:怎么才能在Drag 时,检测如果超过了自身的Rect ,则处理 EButton1Up 事件

    另外 HandlePointerEventL 中调用了 CCoeControl 的 HandlePointerEventL 事件
    void CBButton::HandlePointerEventL(const TPointerEvent& aPointerEvent)
            {
            CCoeControl::HandlePointerEventL(aPointerEvent);
    ....
    但还是不行

    -------

    对于这个问题的解决方案是,在 ConstructL 中添加一句话

    this->ClaimPointerGrab(ETrue);

    对于该方法的 sdk  说明如下:

    ClaimPointerGrab()

    IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);

    Description

    Claims pointer grab from another control.

    This ensures that all subsequent pointer events are delivered to it and not to the control that originally owned the grab.

    The function allows a control to claim the pointer grab only if the pointer is already grabbed by another control.

    Parameters

    TBool aSendUpEvent

    Passed as the argument to RWindowBase::ClaimPointerGrab().

    See also:

  • 相关阅读:
    Zju1876 Edit Step Ladders
    Candy糖果盒
    哈希
    最长上升子序列 nlogn
    电费结算
    【luoguP5656】二元一次不定方程(gcd,exgcd,裴蜀定理,不定方程初步)
    DP技巧
    高精
    【CSP烤前注意】
    [Jsoi2015] 种花
  • 原文地址:https://www.cnblogs.com/zziss/p/1874878.html
Copyright © 2011-2022 走看看