2014-02-17 22 views
0

我正在開發一個UI應用程序,並嘗試使用CAlertDialogPtrIwNUI系統。我遇到了一個我無法解讀的錯誤,我嘗試添加其他庫和系統,但仍然沒有用。錯誤是:使用Marmalade的AlertDialog錯誤IwNUI

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(); 

}; 

謝謝!

回答

0

使用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; 
} 

乾杯!

0

你沒有所有的資源在你的項目,抓住從廚房水槽例如那些和編輯您MKB

,然後你要使用的返回鍵或鍵盤iwnui你需要這樣的:

while (!s3eDeviceCheckQuitRequest()) 
{ 

     s3eKeyboardUpdate(); 

     if ((s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_PRESSED) == S3E_KEY_STATE_PRESSED) 
     { 
      s3eDeviceRequestQuit(); 

     } 

     app->Update(); 

    } 

作爲並列於

APP->運行();

+0

雖然我只是將警報對話框的使用改爲S3eDialog低級別的方法,並停止嘗試使用IwNUI方法,但我會嘗試它,它只是立即工作,正如我想的那樣。 – chaotive

+0

從長遠來看,也許這是比我發佈的更好的解決方案,但我已經改變了我的代碼,並且更簡單的方法專注於我的問題的解決方案,這正是我所需要的。反正非常感謝! – chaotive