【问题标题】:delphi xe 7 Tlistbox main form loose focus after draganddropdelphi xe 7 Tlistbox主窗体拖放后焦点松动
【发布时间】:2016-12-29 09:23:17
【问题描述】:

我在delphi xe7中发现了一个bug,拖拽TlistBoxitem后,对所有组件形成松散效果。

我必须点击表单才能获得鼠标输入效果。 我看到(在调试模式下)TlistBox 通过调用 os dragAndDrop 服务的操作系统开始拖放。来自 FMX.ListBox 单元

if AllowDrag then
      begin
        Screenshot := ItemDown.MakeScreenshot;
        try
          AniCalculations.MouseLeave;
          FMouseSelecting := False;
          // start drag service
          Root.BeginInternalDrag(Selected, Screenshot);
        finally
          Screenshot.Free;
        end;
      end;

我尝试在 delphi berlin 上进行拖放,错误已修复。我看不到源,因为它是轻型版本。

我没有在网上找到任何解决方案。

我做了一个项目示例:http://www.partage-fichiers.com/upload/qgbl1e5g

拖放项目后 mouseenter(在所有组件上)并单击 Tlabel (hittest=true) 不会触发

【问题讨论】:

  • 我测试了主窗体不会失去焦点并且不会停用
  • 好吧,对不起,我提出了一个类似的问题stackoverflow.com/questions/15821670/…,但我在 firemonkey 工作,我认为这不仅仅是 TlistBox 的错误
  • 我们很难在没有复制的情况下进行调查。我们不能有minimal reproducible example吗?
  • 嗨,大卫,抱歉我的帖子不好,您可以在不编码的情况下重现该错误(仅图形):使用 delphi xe7 在 FMX 中创建一个带有 Tbutton 和 Tlistbox 的表单,插入多个 TlistBoxItem。在一个 Item 的内部 dragAndDrop 之后,不会触发 TButton 的 mouseEnter。我写了一个小代码,因为我在“myListBox.Root.BeginInternalDrag(aItem, Screenshot);”处隔离了错误如果还不够,我会发布一个最小的代码还是谢谢你
  • 我不想像那样胡闹。如果我需要努力帮助你,我会做其他事情。

标签: drag-and-drop firemonkey delphi-xe7 tlistbox


【解决方案1】:

用于获取 mouseenter 和 mouseclick 事件之后

BeginInternalDrag(mylistboxItem, Screenshot);

MyListBox.Root.Captured := nil;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-15
    • 2010-12-26
    • 1970-01-01
    • 1970-01-01
    • 2012-01-14
    • 1970-01-01
    • 1970-01-01
    • 2011-09-23
    相关资源
    最近更新 更多