【问题标题】:AlertDialog error using Marmalade IwNUI: Could not find resource named alertdialog使用 Marmalade IwNUI 的 AlertDialog 错误:找不到名为 alertdialog 的资源
【发布时间】:2014-02-17 21:38:30
【问题描述】:

我正在开发一个 UI 应用程序并尝试将CAlertDialogPtrIwNUI 系统一起使用。我收到一个我无法解读的错误,我尝试添加其他库和系统,但仍然没有用。错误是:

IwAssert failure (GX, 1339). Message: Could not find resource named alertdialog (of type CIwUIElement)
Callstack: CIwResManager::GetResNamed

请帮助我/发送一些反馈,我需要解决这个问题。这是我的一些代码:

class AppPorBen {

//public attribute
    CAlertDialogPtr home_aTest;


//this comes from my main method

    home_aTest = CreateAlertDialog(CAttributes()
    .Set("name", "AlertDialog")
    .Set("title", "s3eNUIAlertDialog")
    .Set("message", "Quiere cerrar esta alerta?")//.Set("message", scrollPosition.m_Y)
    .Set("positiveButtonCaption",   "Yes")
    .Set("negativeButtonCaption",   "No")
    .Set("neutralButtonCaption",    "Maybe")
    );

//this uses the alert dialog on a handler

    home_aTest->Show();

};

谢谢!

【问题讨论】:

    标签: c++ user-interface dialog alert marmalade


    【解决方案1】:

    您的项目中没有所有资源,请从厨房水槽示例中获取资源并编辑您的 mkb

    然后你想在 iwnui 中使用返回键或键盘,你将需要这个:

    while (!s3eDeviceCheckQuitRequest())
    {
    
            s3eKeyboardUpdate();
    
            if ((s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_PRESSED) == S3E_KEY_STATE_PRESSED)
            {
                s3eDeviceRequestQuit();
    
            }
    
            app->Update();
    
        }
    

    相对于

    app->运行();

    【讨论】:

    • 我会试试的,虽然我只是将警报对话框的用法更改为 S3eDialog 低级方法并停止尝试使用 IwNUI 方法......它就像我想要的那样立即工作。跨度>
    • 从长远来看,也许这会是比我发布的更好的解决方案,但我已经更改了我的代码,并且我需要一种更简单的方法来专注于解决我的问题。无论如何都非常感谢!
    【解决方案2】:

    使用 IwNUI 的目的是在开发应用程序时使用更高级别的抽象层。如果我不能直接使用文档中提到的代码,然后使用 Marmalade 提供的默认文件出现未知问题,那么实际问题不再重要,因为它是 Marmalade 包相关的错误。

    解决方案是使用较低级别的代码,直接使用 S3eDialog 扩展,例如以下示例:

    {//This version number isn't known
        s3eDialogAlertInfo info;
        info.m_Message = "The database is in the format of a later version. \n\nPlease update the app to the latest version and try again.";
        info.m_Title = "Error";
        info.m_Button[0] = "OK";
        s3eDialogAlertBox(&info);
        return false;
    }
    

    干杯!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-16
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多