Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.1K Views
|
7 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How to control slider value font size?

Posted 2 years ago

POSTED BY: Werner Geiger
7 Replies
POSTED BY: Michael Rogers
Posted 1 year ago

Thanks, Michael, that's a good example of building custom controls. Of course, I can always build my own custom controls if I want, and I do sometimes. But my goal is not to improve the Wolfram system, but to solve my own problems using the Wolfram API.

I tried to find the original manipulator source code in my Wolfram|One installation to fix the bug. But I couldn't find anything like that in Wolfram coding. Maybe you have an idea where it is?

POSTED BY: Werner Geiger
Posted 1 year ago

I am still busy styling value fields within Manipulate controls.

In addition to my previous post, I have a picture that shows what I can and cannot control:

  1. Within the first Manipulate parameter (the expression to be executed), normal styling is of course used.
  2. The Manipulate option LabelStyle controls the styling of static labels.
  3. The Manipulate option LabelStyle does not control the FontSize of value fields. But it does control FontColor and FontSlant.
  4. I have no idea how to control the font size of value fields.
  5. The Manipulate option BaseStyle does not appear to control anything.

Does anyone know how to change the font size (and field size) of the value fields?

Attachment

Attachments:
POSTED BY: Werner Geiger
Posted 1 year ago

See if this does what you want:

Manipulate[
  Style[x,Darker[Green],Bold,14],
  Row[{
    Control@{{x,0.5,"x-Wert"},0,1,AppearanceElements->None},
    Control@{{x,0.5,""},InputField,FieldSize->4}
  }],
  LabelStyle->{12,Blue,Italic}
]
POSTED BY: Hans Milton
Posted 1 year ago

Thanks Hans.

Of course this works, because I can display each value (even dynamically) in a different control field.

But that's not what I want. There are similar font size problems with Slider2D and others. Unfortunately, we don't have complete control over the styling of all elements of Controls. At least we would need something similar to LabelStyle called ValueStyle or something.

POSTED BY: Werner Geiger
Posted 1 year ago

For Slider2D, what is wrong with the result of the code below?

Manipulate[
  ParametricPlot[{Sin[t+d[[1]]],Sin[t+d[[2]]]},{t,0,2Pi}],
  {d,{0,0},{Pi,Pi},Appearance->"Labeled"},
  LabelStyle->{14,Blue,Italic}
]
POSTED BY: Hans Milton
Posted 1 year ago

You're right. Strangely, LabelStyle is honored in terms of FontSize, -Slant, and -Color in Slider2D. The same applies to Slider:

Manipulate[Style[x, Darker[Green], Bold, 14],
 {{x, 0.5, "x-Wert"}, 0, 1, ControlType -> Slider, 
  Appearance -> "Labeled"},
 LabelStyle -> {FontSize -> 12, FontColor -> Blue, FontSlant -> Italic}
 ]

To conclude: I think it's simply a bug in the Manipulator control where they forgot to take FontSize into account.

POSTED BY: Werner Geiger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard