From: Foster T. B. <fbr...@ad...> - 2005-04-28 16:04:50
|
Serge, After taking a look at your Adam and Eve definitions I think the answer to your question lies in the details of the Adam definition. The Resample Image checkbox is bound to the no_options_params cell, which is defined in Adam as: > no_options_params : false; This means simply that the default value for the cell is false, and the state of the cell changes only in accordance with any controls that are connected to it. In this case, only checkboxes are connected to the cell, so this cell's values will toggle when any of the checkboxes connected to it are toggled. Keep in mind that all the controls bound to this cell will change state at the same time this cell does- all the controls bound to this cell are in sync with one another. Now let's take a look at the Constrain Proportions control, which is bound to the constrain cell, defined in Adam as: > unlink constrain : false <== no_options_params ? constrain : true; Let us break this apart a bit. We will get to the 'unlink' keyword later. For starters the value of the cell initializes to false. Unlike the no_options_params cell however, this cell has a relationship defined for it with the <== operator. In this case Adam will test the output value of no_options_params in order to figure out what the output value of this cell will be. For this to work, note that there are two parts to the value of an interface cell: the input value and the output value. The input value is the value driven by the control: check a checkbox, and the checkbox will set the input value for the cell it is bound to. The output cell is the value Adam reports as the value of the cell to other cells and any callbacks that care about this cell's value. Sometimes the output value of the cell is driven by the input value, sometimes not: it all depends on the relationship defined for the cell in the Adam definition. In our case, the constrain cell's output value is dependent upon the output value of no_options_params. If no_options_params is false, then the output value of constrain will be forced to true. Note here that Adam knows what the output value of constrain should be in this case without considering the input value of the constrain cell. When Adam doesn't consider the input value of a cell, the controls that handle the inputs to that cell are disabled - that is why when the no_options_params cell is false (i.e., when the Resample Image checkbox is unchecked) the Constrain Proportions checkbox is disabled in a checked state. If no_options_params is true, however, the output value of constrain will be whatever the input value of constrain is. Normally, the input and output values of a cell are always the same value - they are 'linked' together. In the linked case, whenever the output value of the cell changes it is reapplied as the input value of the cell also. In the above case, however, that is not the user experience that we are shooting for: what we want is for the Constrained Proportions checkbox to "remember" its non-forced value (i.e., the value the user set it to), so that when the forced state is removed, the value of the checkbox reverts to the value to which the user set it. This is what the 'unlink' keyword is for. 'unlink' separates the input value (the value manipulated by the controls bound to this cell) and the output value (the value reported by Adam as the resultant value of the cell) of the cell, preventing reapplication of the output value of the cell to the input. In the above relationship defined for constrain, it is possible for the value of the cell to be something other than the input value of the cell: namely 'true' when no_options_params is set to 'false'. In that case, we do not want 'true' to get back-propagated to the input value of the constrain cell, as this would override the value set by the user. Instead, we want the input value to stay as the value set by the control/user. The net effect of 'unlink' is a cell that 'remembers' the value the user set for it, while the output value of the cell changes in accordance with the relationship defined for the cell in the Adam definition. When the relationship permits Adam to use the input value of the cell as the output value, the cell's output value becomes the value set by the user. So there are a lot of differences between the Adam definitions of these two cells: one is manipulated solely by the controls that are bound to it (no_options_params), while the other is manipulated by either the controls bound to it or in accordance with the constraint placed on it in the Adam definition (constrain). I hope this helped tackle some of the questions you are having. If you have any more questions (or if I made the situation worse), please keep posting your questions to this mailing list, and we'll try to get them answered for you. Thanks for taking a look at the Adobe Source Libraries! Blessings, Foster On Apr 28, 2005, at 08:11a, serge fukanchik wrote: > Hi, > experimenting with Adam&Eve i can not find out why does checkbox > entitled "Resample image" works and changes it's own value along with > other checkbox's which is bound to the same adam variable. But that > very other checkbox ignores clicks and does not chagne it's value? > > Thank you in advance. > > Here is the code: > dialog(name: "Specialized Resource Point", placement: place_column) > { > group(name: "SSFFeam", indent: 10) > { > /* edit_text(name: "Listen address", indent: 10); > group(name: "Optional parameters") > { > */ > column() > { > checkbox(bind: @no_options_params, name: "Do not use optional > parameters"); > } > /* group(name: "Numbers count", indent: 20) > { > column() > { > edit_number(name: "Call number", digits: 10, bind: @call_number); > edit_number(name: "CorrelationID", digits: 10, bind: > @correlation_id); > edit_number(name: "SCFID", digits: 10, bind: @scf_id); > } > } > } > group(name: "Send answer") > { > checkbox(bind: @send_answer, name: "Send answer"); > edit_text(name: "Phone mask", value: "~"); > } > */ } > group(name: "[ SSF ]") > { > static_text ( wrap: false, name: " Handles connection to ASSP as > CCAFE with ACCP " ); > } > column() > { > row() > { > button(name: "Ok", default: true, action: @cancel, horizontal: > align_right); > button(name: "Cancel", default: false, action: @cancel, horizontal: > align_right); > } > } > > column() > { > checkbox(bind: @scale_styles, name: "Scale Styles"); > checkbox(bind: @constrain, name: "Constrain Proportions"); > > checkbox(bind: @no_options_params, name: "Resample Image:"); > } > } > --------------- > sheet distance_calculator > { > interface: > unlink constrain : false <== no_options_params ? constrain : true; > unlink scale_styles : false <== no_options_params && constrain ? > scale_styles : false; > > > no_options_params : false; > /* send_answer : false; > call_number : 2 <== (no_options_params) ? call_number : empty; > correlation_id : 2 <== (no_options_params) ? correlation_id : empty; > scf_id : 2 <== (no_options_params) ? scf_id : empty;*/ > } > --- > Serge > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel > > -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "What 99 percent of programmers need to know is not how to build components but how to use them." -- Alexander Stepanov |