开发者

Adobe Adam and Eve (C++ ASL): how to bind Eve variable so to get it updated inside C++ application?

开发者 https://www.devze.com 2023-03-14 19:06 出处:网络
So we know how to compile it, we have seen its demos and loved it. We have seen probably only one real life opensource project based on it. So I look at the samples and see only 3 quite long C++ appli

So we know how to compile it, we have seen its demos and loved it. We have seen probably only one real life opensource project based on it. So I look at the samples and see only 3 quite long C++ applications that can be ofmy intrest ASL\test\adam_tutorial\, ASL\test\adam_smoke\, ASL\test\eve_smoke\. But I still do not get how htving simple Eve file with:

dialog(name: "Clipping Path")
{
 column(child_horizontal: align_fill)
 {
   popup(name: "Path:", bind: @path, items:
     [
     { name: "None", value: empty },
     { name: "Path 1", value: 1 },
     { name: "Path 2", value: 2 }
     ]);
   edit_number(name: "Flatness:", digits: 9, bind: @flatness);
  }
 button(name: "OK", default: true, bind: @result);
}

in it, Adam file bound to it (theoretically, because I do not quite get how to bind Eve to adam and see no tutorialon how to do this), with

sheet clipping_path
{
output:
result          <== { path: path, flatness: flatness };

interface:
unlink flatness : 0.0 <== (path == empty) ? 0.0 : flatness;
path            : 1;
}

in it, make each time flatness variableis changed some C++ function of mine called (A simple one couting new flatness value for example)

So How to implement such thing with Adobe Adam and Eve and Boost ofcourse?

Update

We have tried to do it here and it worked but not in a live feedb开发者_JAVA百科ack way - only on dialog close action. And than here but due to our compile evrething on linux absession we have paused our development in ASL programming and started investing time into ASL compilation on Linux OS.


A good place to ask questions about ASL is on the ASL developer mailing list: http://sourceforge.net/mail/?group_id=132417.

You might want to look at the "Begin" test app . Although this only runs Mac and Win it does demonstrate how to wire things up.

The basic idea is that when a layout description (Eve) is parsed it will call your add_view_proc http://stlab.adobe.com/structadobe_1_1eve__callback__suite__t.html#a964b55af7417ae24aacbf552d1efbda4 with the arguments expression. Normally you use bind_layout_proc for the callback which will handle the argument evaluation for your and call a simplified callback that takes a dictionary with the arguments.

When your callback is invoked, you would typically create an appropriate widget and associate the dictionary to the widget or extract the arguments of interest from the dictionary and store them in a struct. Using the bind argument, you can setup callbacks with the associated sheet (Adam), using the monitor_xxxx functions on sheet_t. Usually you'll use monitor_value and monitor_enabled. When called, you set the value or enabled state on the widget. When the widgets value is changed by the user, and widget is invoked (it may be through an event handler, or a callback, or whatever mechanism your UI toolkit supports) you call sheet_t::set() to set the value of the cell and then sheet_t::update() to cause the sheet to recalculate.

That's about it - When trying to get Adam/Eve going with a new UI framework - start small. I usually start with just a window containing two checkboxs and wire up Eve first. Once that is going add Adam and a simple sheet connecting two boolean cells so you can see if things are happening correctly. Once you have that going you'll find it's pretty simple to get much more complex UIs wired up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号