触摸事件在 SettingsList 中不起作用(第 5 版 SDK)

发布于 2024-11-07 21:58:12 字数 549 浏览 0 评论 0原文

我使用 Carbide.C++ 2.7 和 S60 5th Ed SDK 来创建我的应用程序,

在我将 SettingsList 添加到我的应用程序后,我从“选项菜单”中删除了“更改”项,并将“退出”更改为“返回”我将左侧按钮标题设置为空 - 而不是选项 - 问题是当我触摸 SettingsList 项目的任何项目时都没有响应,而且我必须使用“Enter 键”打开项目编辑器 - 无论它是卷项或二进制项等 - 那么缺少什么或导致此问题?

任何建议将不胜感激,因为我找不到使用不同 SDK 创建的两个 SettingsList 之间的差异。

我使用 S60 3rd Ed FP1 SDK 创建了另一个应用程序 - 作为一个简单的测试 - 我尝试了它,它可以通过双击触摸和 Enter 键正常工作。 (在 E7 上测试)。

我用 S60 第五版创建了相同的示例,并删除了“更改”菜单,但它不响应触摸事件,而是仅响应 Enter 键事件。 (在 E7 上测试)。

我在 Carbide 事件/属性视图中比较了两个项目,它们是相同的,我打开了两个项目的 src 文件,它们是相同的。

非常感谢。

I'm using Carbide.C++ 2.7 with S60 5th Ed SDK to create my application,

after I added a SettingsList to my application I removed the "Change" item from "Options Menu", And I changed the "Exit" to "Back" and I set the left button title empty - instead of Options - and the problem is that when I touch any item of SettingsList items there is no response, And I have to use the "Enter Key" to open the item editor - whether it's a Volume item or Binary item, etc - So what is missing or causing this issue ?

any suggestions would be appreciated because I couldn't find difference between two SettingsList created using different SDKs.

I created another application with S60 3rd Ed FP1 SDK - as a simple test - and I tried it and it works fine with Double Tap Touch and Enter Key. ( tested on E7).

And I created the same sample with S60 5th Ed , and removed the "Change" menu but it doesn't response to touch event, but response to Enter Key event only . ( tested on E7).

I compared both projects in Carbide Event/properties views and they are the same, I opened both projects src files and they are the same.

Many thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-11-14 21:58:12

我发现 Carbide.C++ 默认情况下不包含“触摸”事件处理,即使我正在创建
我的应用程序使用支持“触摸”事件的第五版 SDK。所以我需要添加EAknTouchCompatible

void AppUi::ConstructL()
{
    // [[[ begin generated region: do not modify [Generated Contents]

        BaseConstructL( EAknEnableSkin  | EAknEnableMSK | EAknTouchCompatible);
        InitializeContainersL();

   // ]]] end generated region [Generated Contents]
}

要使用“一键”激活项目编辑器,我们需要重写 MEikListBoxObserver 支持的虚拟函数

void CSettingItemList::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
{
    if (aEventType == EEventItemClicked || aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked)
           {
               //Now with one Tap it opens the control editor.
               //Using EFalse means not called from menu,
               //so it doesn't show the Edit dialog with binarysetting control (On/Off).
               EditItemL( ListBox()->CurrentItemIndex(), EFalse );              }
            }

}

I figured out that Carbide.C++ doesn't include by default "Touch" event handling even if I'm creating
my application using 5th Ed SDK that supports "Touch" event. So I need to add EAknTouchCompatible.

void AppUi::ConstructL()
{
    // [[[ begin generated region: do not modify [Generated Contents]

        BaseConstructL( EAknEnableSkin  | EAknEnableMSK | EAknTouchCompatible);
        InitializeContainersL();

   // ]]] end generated region [Generated Contents]
}

And to Activate the Item Editor with "One Tap" we need to override the virtual function supported by MEikListBoxObserver

void CSettingItemList::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
{
    if (aEventType == EEventItemClicked || aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked)
           {
               //Now with one Tap it opens the control editor.
               //Using EFalse means not called from menu,
               //so it doesn't show the Edit dialog with binarysetting control (On/Off).
               EditItemL( ListBox()->CurrentItemIndex(), EFalse );              }
            }

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文