使用marmalade sdk 6.3.1在Windows Phone上创建基本控件

时间:2013-07-11 06:28:34

标签: windows-phone-8 marmalade marmalade-iwui

我想在Windows Phone 8中设计样本表格,如下面的屏幕截图:

enter image description here

以下代码为hello world示例

// Include header files for S3E (core system) and IwGx (rendering) modules
#include "s3e.h"
#include "IwGx.h"

// Standard C-style entry point. This can take args if required.
int main()
{
    // Initialise the IwGx drawing module
    IwGxInit();

    // Set the background colour to (opaque) blue
    IwGxSetColClear(0, 0, 0xff, 0xff);

    // Loop forever, until the user or the OS performs some action to quit the app
    while(!s3eDeviceCheckQuitRequest()
          && !(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
          && !(s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN)
          )
    {
        // Clear the surface
        IwGxClear();

        // Use the built-in font to display a string at coordinate (120, 150)
        IwGxPrintString(120, 150, "Hello, World!");

        // Standard EGL-style flush of drawing to the surface
        IwGxFlush();

        // Standard EGL-style flipping of double-buffers
        IwGxSwapBuffers();

        // Sleep for 0ms to allow the OS to process events etc.
        s3eDeviceYield(0);
    }

    // Shut down the IwGx drawing module
    IwGxTerminate();

    // Return
    return 0;
}

我尝试了大量关于如何创建按钮和文本框的搜索,并在marmalade sdk上使用c++代码添加了按钮的监听器,但没有找到任何帮助我的任何东西将不胜感激。

1 个答案:

答案 0 :(得分:2)

你需要使用IwUI api。查看marmalade SDK附带的示例或使用启动板。有一些很好的评论示例演示了IwUI的使用,如果你想看看原生的控件,你也可以尝试IwNUI。由于某些错误,尚未为Windows 8平台添加IwNUI模块,但很快就会添加。