gpt4 book ai didi

c++ - Adobe Eve ASL : how to render eve file into gui window?

转载 作者:太空宇宙 更新时间:2023-11-04 12:18:20 24 4
gpt4 key购买 nike

所以我们有简单的.eve.adam 文件,compiled ASL ,以及 boostadobe 所需的所有内容。我们需要一个跨平台功能来渲染我们的布局,并在我们的平台上作为真实窗口移动(我们需要它用于 Mac OS X、Windows、Linux)。怎么办?

我们已经开始尝试简化我们在 ASL 文件夹中找到的一些教程 (begin) 并获得了一些结果 you can see here .但是我们的方法不是跨平台的,也不是任何容易获得的方法=(所以我们要求您帮助我们了解如何使用 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 上生成这样的窗口:

enter image description here

请帮忙。

最佳答案

We have done it here!)这真的很简单。

来源:

#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;
}

关于c++ - Adobe Eve ASL : how to render eve file into gui window?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6457273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com