Adobe Eve ASL:如何将 eve 文件渲染到 gui 窗口中?

发布于 2024-11-16 21:20:08 字数 1603 浏览 1 评论 0原文

所以我们有简单的 .eve.adam 文件,已编译的 ASL,以及 boostadobe 所需的所有内容。我们需要一个跨平台函数来渲染我们的布局,并在我们的平台上像真实窗口一样移动(我们需要它用于 Mac OS X、Windows、Linux)。这样的事该怎么办呢?

我们已开始尝试简化在 ASL 文件夹 (begin) 中找到的一些教程,并取得了一些成果 你可以在这里看到。但是我们的方法不是跨平台的,也不是很容易得到=(所以我们请求您帮助如何显示一个带有由 adam 和 eve 文件定义的 ok 按钮的简单窗口?

这是简单的 Adam 和简单的 eve 文件的示例,

layout my_dialog
{
    view dialog(name: localize(\"<xstr id='my_dialog_name'>My Dialog</xstr>\"))
    {
        slider(bind: @my_value, format: {first: 0, last: 100});
        edit_number(name: 'Value:', bind: @my_value, format: '#', alt: 'Alters the value of the slider');
        button (items: [
                           { name: localize(\"<xstr id='ok'>OK</xstr>\"), action: @ok, bind: @result, alt: 'Perform the command with the current settings' },
                           { name: localize(\"<xstr id='reset'>Reset</xstr>\"), action: @reset, modifiers: @opt, alt: 'Reset the dialog settings' }
                       ]);
    }
}

sheet my_sheet
{
interface:
   my_value: 42;
output:
   result <== { value: my_value };
}

它们应该在 Windows 上生成这样的窗口:

在此处输入图像描述

请帮忙。

So We have simple .eve and .adam files, compiled ASL, and all includes required for boost and adobe. We need a crossplatform function to make our layout rendered, and movable as real window on our platform (we need it for Mac OS X, Windows, Linux). How to do such thing?

We have started trying to move in direction of simplifiing some tutorials we found in ASL folder (begin) and got some results you can see here. But our approach is not crossplatform or any way eazy to get=( So we ask for your halp in getting how to display a simple window with ok button defined by adam and eve files?

Here is example of simple Adam and simple eve files

layout my_dialog
{
    view dialog(name: localize(\"<xstr id='my_dialog_name'>My Dialog</xstr>\"))
    {
        slider(bind: @my_value, format: {first: 0, last: 100});
        edit_number(name: 'Value:', bind: @my_value, format: '#', alt: 'Alters the value of the slider');
        button (items: [
                           { name: localize(\"<xstr id='ok'>OK</xstr>\"), action: @ok, bind: @result, alt: 'Perform the command with the current settings' },
                           { name: localize(\"<xstr id='reset'>Reset</xstr>\"), action: @reset, modifiers: @opt, alt: 'Reset the dialog settings' }
                       ]);
    }
}

sheet my_sheet
{
interface:
   my_value: 42;
output:
   result <== { value: my_value };
}

that shall generate a window like this on windows:

enter image description here

Please help.

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

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

发布评论

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

评论(1

他是夢罘是命 2024-11-23 21:20:08

我们已经完成就在这里!) 这真的很简单。

来源:

#include <boost/thread/tss.hpp>
#include <adobe/future/modal_dialog_interface.hpp>
#include <boost/filesystem/path.hpp>

using namespace std;

inline bool always_break(adobe::name_t, const adobe::any_regular_t&)
    { return true; }

void dialog()
{
    stringstream       sheet;
    stringstream       layout;
    boost::filesystem::path icon_directory_path;

    // The sheet for the dialog
    sheet <<
                        "sheet my_sheet\n"
                        "{\n"
                        "interface:\n"
                        "   my_value: 42;\n"
                        "output:\n"
                        "   result <== { value: my_value };\n"
                        "}\n"
    ;

    // the layout
    layout <<
                                "layout my_dialog\n"
                                "{\n"
                                "    view dialog(name: 'My Dialog')\n"
                                "    {\n"
                                "        slider(bind: @my_value, format: {first: 0, last: 100});\n"
                                "        edit_number(name: 'Value:', bind: @my_value, format: '#', alt: 'Alters the value of the slider');\n"
                                "        button (items: [\n"
                                "                           { name: 'OK', action: @ok, bind: @result, alt: 'Perform the command with the current settings' },\n"
                                "                           { name: 'Reset', action: @reset, modifiers: @opt, alt: 'Reset the dialog settings' }\n"
                                "                       ]);\n"
                                "    }\n"
                                "}\n"
        ;

    // finally set up the params for the modal dialog interface call
    adobe::dialog_result_t result(adobe::handle_dialog(adobe::dictionary_t(),
                                                       adobe::dictionary_t(),
                                                       adobe::dictionary_t(),
                                                       adobe::dialog_display_s,
                                                       layout,
                                                       sheet,
                                                       &always_break,
                                                       icon_directory_path));

    int is_checked(result.command_m[adobe::static_name_t("value")].cast<int>());
        cout << "return value: " << is_checked << endl;
}

int  main(  )
{
        dialog();
        cin.get();
    return 0;
} 

We have done it here!) it is really simple.

Source:

#include <boost/thread/tss.hpp>
#include <adobe/future/modal_dialog_interface.hpp>
#include <boost/filesystem/path.hpp>

using namespace std;

inline bool always_break(adobe::name_t, const adobe::any_regular_t&)
    { return true; }

void dialog()
{
    stringstream       sheet;
    stringstream       layout;
    boost::filesystem::path icon_directory_path;

    // The sheet for the dialog
    sheet <<
                        "sheet my_sheet\n"
                        "{\n"
                        "interface:\n"
                        "   my_value: 42;\n"
                        "output:\n"
                        "   result <== { value: my_value };\n"
                        "}\n"
    ;

    // the layout
    layout <<
                                "layout my_dialog\n"
                                "{\n"
                                "    view dialog(name: 'My Dialog')\n"
                                "    {\n"
                                "        slider(bind: @my_value, format: {first: 0, last: 100});\n"
                                "        edit_number(name: 'Value:', bind: @my_value, format: '#', alt: 'Alters the value of the slider');\n"
                                "        button (items: [\n"
                                "                           { name: 'OK', action: @ok, bind: @result, alt: 'Perform the command with the current settings' },\n"
                                "                           { name: 'Reset', action: @reset, modifiers: @opt, alt: 'Reset the dialog settings' }\n"
                                "                       ]);\n"
                                "    }\n"
                                "}\n"
        ;

    // finally set up the params for the modal dialog interface call
    adobe::dialog_result_t result(adobe::handle_dialog(adobe::dictionary_t(),
                                                       adobe::dictionary_t(),
                                                       adobe::dictionary_t(),
                                                       adobe::dialog_display_s,
                                                       layout,
                                                       sheet,
                                                       &always_break,
                                                       icon_directory_path));

    int is_checked(result.command_m[adobe::static_name_t("value")].cast<int>());
        cout << "return value: " << is_checked << endl;
}

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