Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5132 > unrolled thread

Size of Control[] and OpenerView in Manipulate

Started byW Craig Carter <ccarter@mit.edu>
First post2011-09-22 11:26 +0000
Last post2011-10-04 05:39 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Size of Control[] and OpenerView in Manipulate W Craig Carter <ccarter@mit.edu> - 2011-09-22 11:26 +0000
    Re: Size of Control[] and OpenerView in Manipulate Club de Ultimate Ki-e <ultimatekie@gmail.com> - 2011-10-04 05:39 +0000

#5132 — Size of Control[] and OpenerView in Manipulate

FromW Craig Carter <ccarter@mit.edu>
Date2011-09-22 11:26 +0000
SubjectSize of Control[] and OpenerView in Manipulate
Message-ID<j5f61u$q53$1@smc.vnet.net>
I would like to change the size of some controls in a Manipulate and 
also use an OpenerView.

For reference, I am looking at this nice example from about 9/10 towards 
the bottom of "tutorial/AdvancedManipulateFunctionality":

Manipulate[
 ParametricPlot[{a1 Sin[n1 (x + p1)], a2 Cos[n2 (x + p2)]}, {x, 0,
   20 Pi}, PlotRange -> 1.1, PerformanceGoal -> "Quality",
  Axes -> axes, ImageSize -> size],
 OpenerView[{"Horizontal",
   Column[{Control[{{n1, 1, "Frequency"}, 1, 4}],
     Control[{{a1, 1, "Amplitude"}, 0, 1}],
     Control[{{p1, 0, "Phase"}, 0, 2 Pi}]}, Right]}],
 OpenerView[{"Vertical",
   Column[{Control[{{n2, 5/4, "Frequency"}, 1, 4}],
     Control[{{a2, 1, "Amplitude"}, 0, 1}],
     Control[{{p2, 0, "Phase"}, 0, 2 Pi}]}, Right]}],
 OpenerView[{"Plot options",
   Row[{Control[{axes, {True, False}}],
     Control[{{size, Medium}, {Small, Medium, Large}}]},
    Spacer[20]]}], ControlPlacement -> Bottom]

1. I'd like the Control[] results to be smaller. However, Control 
doesn't seem to have an option to control its ImageSize.

2. If I try to replace Control with, say, Slider for which I can control 
size, it doesn't work. I don't know why it doesn't work, but it doesn't 
look like it is being evaluated.

3. Even better would be to replace Control with a custom control like 
the next example down in the tutorial,  ValueThumbSlider.

Thanks for any explanation or solution, Craig

W Craig Carter
Professor of Materials Science, MIT



[toc] | [next] | [standalone]


#5368

FromClub de Ultimate Ki-e <ultimatekie@gmail.com>
Date2011-10-04 05:39 +0000
Message-ID<j6e666$kdm$1@smc.vnet.net>
In reply to#5132
On Sep 22, 7:26 am, W Craig Carter <ccar...@mit.edu> wrote:
> I would like to change the size of some controls in a Manipulate andalso 
use an OpenerView.
>
> For reference, I am looking at this nice examplefrom about 9/10 towards
> the bottom of "tutorial/AdvancedManipulateFunctionality":
>
> Manipulate[
>  ParametricPlot[{a1 Sin[n1 (x + p1)], a2 Cos[n2 (x + p2)]}, {x, 0,
>    20 Pi}, PlotRange -> 1.1, PerformanceGoal -> "Quality",
>   Axes -> axes, ImageSize -> size],
>  OpenerView[{"Horizontal",
>    Column[{Control[{{n1, 1, "Frequency"}, 1, 4}],
>      Control[{{a1, 1, "Amplitude"}, 0, 1}],
>      Control[{{p1, 0, "Phase"}, 0, 2 Pi}]}, Right]}],
>  OpenerView[{"Vertical",
>    Column[{Control[{{n2, 5/4, "Frequency"}, 1, 4}],
>      Control[{{a2, 1, "Amplitude"}, 0, 1}],
>      Control[{{p2, 0, "Phase"}, 0, 2 Pi}]}, Right]}],
>  OpenerView[{"Plot options",
>    Row[{Control[{axes, {True, False}}],
>      Control[{{size, Medium}, {Small, Medium, Large}}]},
>     Spacer[20]]}], ControlPlacement -> Bottom]
>
> 1. I'd like the Control[] results to be smaller. However, Control
> doesn't seem to have an option to control its ImageSize.
>
> 2. If I try to replace Control with, say, Slider for which I can control
> size, it doesn't work. I don't know why it doesn't work, but it doesn't
> look like it is being evaluated.
>
> 3. Even better would be to replace Control with a custom control like
> the next example down in the tutorial,  ValueThumbSlider.
>
> Thanks for any explanation or solution, Craig
>
> W Craig Carter
> Professor of Materials Science, MIT


Hello,
You need to create your own slider. It's easy:

mySlider[Dynamic[var_], {min_, max_}, size_] :=  Slider[Dynamic[var],
{min, max}, ImageSize -> size]

Now size is an option. You can use it stand-alone

mySlider[Dynamic[x], {0, 1}]

Or in Manipulate:

Manipulate[x, {{x, 1, "jorge"}, mySlider[##, {0, 1}, 50] &}]

Have fun.

Jorge Ramirez
Professor of Mathematics, UNAL, Medellin, Colombia.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web