MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

On placement of controls around Manipulate display area and positioning of control varibles relative to the control itself.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84854] On placement of controls around Manipulate display area and positioning of control varibles relative to the control itself.
  • From: "Nasser Abbasi" <nma at 12000.org>
  • Date: Wed, 16 Jan 2008 23:04:15 -0500 (EST)

After playing with Manipulate in the last few weeks, I've learned a little 
more about it, but I am still not able to do something very simple.

I need to position the variable name of the control itself, below the 
control.  Let take a simple example. Let the control be a Checkbox.  So I 
need to have

                  checkbox_here
                       variable

The above on its own, is easy to do as follows by using Row and Label

Manipulate[Text["testing.."],
        Row[{Labeled[Checkbox[Dynamic[c]], Style["2nd", 10], Bottom]}]
]

But now, suppose I want to have the above to the left of Manipulate display 
area, this is also easy, use ControlPlacement

Manipulate[Text["testing.."],
   Row[{Labeled[Checkbox[Dynamic[c]], Style["2nd", 10], 
Bottom]}],ControlPlacement->Left
]

But what if I want to have some control above the Manipulate display area 
and some to the left and some below?
now, the problem starts to show up. I can use ControlPlacement on INDIVIDUAL 
controls, as long as the controls are in the standard Manipulate form, which 
is {x,{from,to,increment}} as in this example

Manipulate[Text["testing..."],
  {{a, 0.1, "a"}, 0.01, 1, 0.01, ControlPlacement -> Top},
  {{b, 0.1, "b"}, 0.01, 1, 0.01, ControlPlacement -> Bottom},
  Row[{Labeled[Checkbox[Dynamic[c]], Style["click me", 10], Bottom]}], 
ControlPlacement -> Left
]

Notice in the above, the ControlPlacement->Left, is OUTSIDE the scope of the 
Checkbox, so what this controlPlacement is saying: Take all the above 
controls and place to the left of the display area, but leave the ones which 
has already controlPlacement specified.

Now the problem comes up. I want to have more than one  Labeled checkbox as 
above (so I can control where the label goes), but at the same time, but 
able to place one checkbox above the display area, and one to the left.

There does not seem to be a way to do this. For example, this below does not 
work, the problem is that things such as Row, Item, etc,, which can use 
inside Manipulate, can NOT take its own controlPlacement:

Manipulate[Text["testing..."],

  Row[{Labeled[Checkbox[Dynamic[c]], Style["click me", 10], Bottom]}],
  ControlPlacement -> Top,

  Row[{Labeled[Checkbox[Dynamic[c]], Style["click me", 10], Bottom]}],
  ControlPlacement -> Left
]

The above is INVALID syntax.

I also tried to use ControlType->Checkbox, but then I am back to square one, 
I can;t then control where I place the label on the control (say below the 
control).

I can't use Labeled to wrap the control with, as Labeled is now allowed to 
be used unless wrapped by Row or Item inside Manipulate.

So, any one know how to do the above? It seems to me there are some design 
limitations here.

Another Limitation I found with Manipulate is that I am unable to position 
the open control associated with say Slider, (these are the controls one 
gets when the click on the little '+' to the right of the slider to fast 
forward, etc...), I am unable to place these to the right of the slider, 
i.e. at the same level. They always open below the slider. One should be 
able to also control the positioning of these.

thank you
Nasser



  • Prev by Date: Re: NIntegrate HypergeometricU
  • Next by Date: Re: problem with MLGetReal64Array
  • Previous by thread: Re: Mouse operation, slider, dynamics, plot combination
  • Next by thread: Re: Can you minimize a notebook window from a notebook in Version