Changes between Version 5 and Version 6 of rp_xml_enable


Ignore:
Timestamp:
Apr 12, 2010 6:52:24 AM (14 years ago)
Author:
mmc
Comment:

changed image() macro to rpimage() so images work properly

Legend:

Unmodified
Added
Removed
Modified
  • rp_xml_enable

    v5 v6  
    33In 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:
    44
    5 [[image(zoo_enable1.gif)]]
     5[[rpimage(zoo_enable1.gif)]]
    66
    77You can include this functionality in your Rappture program by adding an {{{<enable>}}} condition to each of the affected elements.  For example,
     
    3535Here is an example of a {{{<choice>}}} element, with a panel of controls beneath it that changes based on the current choice:
    3636
    37 [[image(zoo_enable2.gif)]]
     37[[rpimage(zoo_enable2.gif)]]
    3838
    3939Each panel is a {{{<group>}}} that gets enabled only when the appropriate choice is selected.
     
    8080In 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:
    8181
    82 [[image(zoo_enable3.gif)]]
     82[[rpimage(zoo_enable3.gif)]]
    8383
    8484In 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: