Consider the following as an example:
DynamicModule[{
$Return
},
Manipulate[
$Return=$Dollars+$Quarters/4;(*first line*)
Row[{"Value of $Return that will be used: ",DecimalForm[N@$Return,{16,2}]}],
{{$Return,10,"Return"},3/4,20,1/4},
{{$Dollars,10,"Dollars"},0,20,1,ControlType->Setter},
{{$Quarters,0,"Quarters"},0,3,1,ControlType->Setter},
ControlPlacement->Top
]
]
This produces an interface where I can specify the value of $Return
that can be changed via the Setters
and the Slider
adjusts accordingly.
If I change the (*first line*) in Manipulate
to
{$Dollars,$Quarters}={1,4}*MixedFractionParts@$Return;
Then the Slider
gives the $Return
value and the Setters
adjust accordingly.
Is there a way to make this Manipulate
have both the Slider
and the Setters
be a way to specify the $Return
value and the others adjusting accordingly?
One more thing, lets say I want to restrict $Return
to be in the range from 3/4
to 20
which means if the $Dollars Setter
is set to 0
then the $Quarters Setter
should grey out the options 0
, 1
and 2
and similarly for 20
the options 1
, 2
and 3
.
This is just a toy example with example numbers so if the mechanism is general then that would be very helpful.