Changes between Version 5 and Version 6 of rp_xml_enable
- Timestamp:
- Apr 12, 2010 6:52:24 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
rp_xml_enable
v5 v6 3 3 In some cases, you may have one input element that makes sense only when another element has a certain value. For example, suppose that you have a {{{<boolean>}}} that turns on a Recombination Model. If the model is on, then the user must also specify the minority carrier lifetime for electrons and holes. When the Recombination Model is on, these other elements should be active and editable; when it is off, they should be inactive and grayed out, as shown below: 4 4 5 [[ image(zoo_enable1.gif)]]5 [[rpimage(zoo_enable1.gif)]] 6 6 7 7 You can include this functionality in your Rappture program by adding an {{{<enable>}}} condition to each of the affected elements. For example, … … 35 35 Here is an example of a {{{<choice>}}} element, with a panel of controls beneath it that changes based on the current choice: 36 36 37 [[ image(zoo_enable2.gif)]]37 [[rpimage(zoo_enable2.gif)]] 38 38 39 39 Each panel is a {{{<group>}}} that gets enabled only when the appropriate choice is selected. … … 80 80 In addition to simple choices and boolean values, the {{{<enable>}}} condition can also depend on numerical values. For example, suppose you have a parameter such as High-Energy Lifetime, that gets used only when another paramter exceeds some threshold: 81 81 82 [[ image(zoo_enable3.gif)]]82 [[rpimage(zoo_enable3.gif)]] 83 83 84 84 In this case, the trick is that the value of the Tight-Binding Energy has units of {{{eV}}} and we must remove the units before comparing any values. We do this by adding {{{:eV}}} to the path when requesting the value in the {{{<enable>}}} condition: