Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control font appearance in Manipulator input field?

Apologies for making something that is probably trivial my first question here but I just realized I do not know how to style the font within the input field in a Manipulator control. None of the options for this function are for styling within the input field (AFAIK). I wondered whether an input field option would work:

Style[Manipulator[0.5, Appearance -> {"Open", Tiny}], 
 DefaultOptions -> {InputField -> {BaseStyle -> Directive[Red, 16]}}]

Mathematica graphics

but it didn't. I'm assuming this is trivial but it has me stumped.

Edit

I have tried using a local Manipulator style

Cell[StyleData["Manipulator"],
 ShowStringCharacters->False,
 NumberMarks->False,
 FontFamily:>CurrentValue["PanelFontFamily"],
 FontSize->24,
 FontColor->RGBColor[1,0,0],
 FontWeight->"Bold"]

Mathematica graphics

This is changing the font colour and weight (I do not want these changed in my application, just testing what works and what doesn't) but still not changing the font size. If this stylesheet solution worked I guess it would suffice for now but ultimately I would like to have a tiny manipulator in a Manipulate:

{{x, 40, "Hello World"}, 20, 100, 5, Appearance -> "Open", 
AppearanceElements -> {"InputField", "StepLeftButton", "StepRightButton",    
                        "HideControlsButton"}, ImageSize -> Tiny}

but with a non-tiny font in the input field, and achieve this by direct coding.

like image 280
Mike Honeychurch Avatar asked Dec 21 '11 04:12

Mike Honeychurch


1 Answers

The only way I know to change the size of the text in the field is to hit the entire thing with Magnification. Using Simon's guidance above to do this with Style:

Style[
  Manipulator[0.5, Appearance -> {"Open", Tiny}], 
  DynamicBoxOptions -> {BaseStyle -> Magnification -> 2}
]

Mathematica graphics

like image 136
Mr.Wizard Avatar answered Oct 24 '22 09:10

Mr.Wizard