-2
$\begingroup$

I like this, but.. .. how could I put the labels to know +- over where value I are moving?

for examples, between 0 and 8.

 Manipulate[{u*v}, Row[{Control[{u, 0, 1}], Control[{v, 0, 1}]}], 
  ControlType -> VerticalSlider, ControlPlacement -> Up]
$\endgroup$

1 Answer 1

3
$\begingroup$

You may try:

Manipulate[If[a == a, ToExpression[ToString@u <> s <> ToString@v]],
           Row[{Control[{u, 0., 1., VerticalSlider}],
                Control[{v, 0., 1., VerticalSlider}],
                Column[{Control[{s, {"+", "-", "*", "/"}, Setter}], 
                        Button["Calc", a = ! a]}]}], 
           Initialization -> (a = True), 
           TrackedSymbols :> {a}]

Mathematica graphics

Edit

More on that:

ValueThumbSlider[v_] := ValueThumbSlider[v, {0, 1}];
ValueThumbSlider[Dynamic[var_], {min_, max_}] := 
 LocatorPane[
  Dynamic[If[! NumberQ[var], var = min]; {0, var}, (var = Last[#]) &],
  Graphics[{AbsoluteThickness[1.5], Line[{{0, min}, {0, max}}],
    Dynamic[{Text[var, {1.5, var}, {0, -1}], 
      Polygon[{Offset[{0, 0}, {0, var}], Offset[{-5, -5}, {0, var}], 
        Offset[{-5, 5}, {0, var}]}]}]},
   ImageSize -> {30, 300}, PlotRange -> {{-1, 1}, {min, max}},
   PlotRangePadding -> {{Automatic, 1}, None},
   AspectRatio -> 10, Axes -> {False, True}, 
   Ticks -> {None, {min, max}}],
  {{0, min}, {0, max}}, Appearance -> None]; Panel@
 DynamicModule[{x, y, s}, 
  Column[{Row[{ValueThumbSlider[Dynamic@x], 
      ValueThumbSlider[Dynamic@y], 
      Column[{SetterBar[Dynamic@s, {"+", "-", "*", "/"}]}]}], 
    Dynamic@ToExpression[ToString@x <> ToString@s <> ToString@y]}]]

Mathematica graphics

$\endgroup$
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.