的Adobe前夕ASL:如何呈现前夕文件到GUI窗口? [英] Adobe Eve ASL: how to render eve file into gui window?
问题描述
所以,我们有简单的 .eve
和 .adam
文件,<一个href="http://stackoverflow.com/questions/6397501/how-to-compile-asl-boost-based-adobe-c-gui-library-on-windows-7">compiled翔升和所有的包含所需的提升
和土坯
。我们需要一个跨平台的功能,使我们的布局呈现,并作为移动我们的平台上真正的窗口(我们需要它的Mac OS X,Windows和Linux)。如何做这样的事?
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?
我们已经开始尝试在simplifiing一些教程,我们在翔升文件夹(开始
)找到方向移动,并得到了一些成果<一href="http://$c$c.google.com/p/cloudobserver/source/browse/#svn/branches/v0.4/ASL.AdameAndEve.Tutorial/src/CloudAdamAndEve"相对=nofollow>你可以在这里看到。但是,我们的做法是不跨平台或任何方式EAZY得到=(所以我们恳请您HALP在获得如何显示与亚当和夏娃文件中定义的确定按钮一个简单的窗口?
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:
请帮忙。
推荐答案
<一个href="http://$c$c.google.com/p/cloudobserver/source/browse/branches/v0.4/ASL.AdameAndEve.Tutorial/src/ReturnValue.cpp"相对=nofollow>我们已经做了在这里!)这是非常简单的。
来源:
#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;
}
这篇关于的Adobe前夕ASL:如何呈现前夕文件到GUI窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!