6

The main question is in the title. Here are subtopics I'd like to focus on:

  1. Is there a tutorial related to them anywhere in documentation?

  2. How can I check what are current values of e.g. ButtonBoxOptions?

    Are documentation pages for specific symbols the only source of this information?

  3. How are they related to what CurrentValue[{StyleDefinitions, "Input", ButtonBoxOptions}] gives:

    {ButtonBoxOptionsBaseStyle -> "GenericButton", ...

  4. What is their place and advantages in styles resolving scheme?

    I suspect they are applied somewhere around MakeBoxes but is this documented somewhere?

    They also allow to style boxes collectively (with limitations), is that all?

  5. Can analogous options for custom boxes be created or it is not meant to be accessible from user side?

  6. Do they work consistently or are they full of exceptions?

    I failed to understand why PanelBox case works but TemplateBox doesn't:

    Style[
     Panel[1],
     PanelBoxOptions -> {Background -> Red} (*works well*)
    ]
    
    Style[
      TraditionalForm @ Binomial[a, b],
      TemplateBoxOptions -> {Tooltip -> None} (*fails, tooltip is there*)
    ]
    

    So it seems TemplateBox escapes a standard resolution scheme. What I intuitively get but I would like to have this explained.

Kuba
  • 136,707
  • 13
  • 279
  • 740
  • TemplateBoxOptions -> {Tooltip -> None} is the default Tooltip option value. Style[TraditionalForm@Binomial[a, b], TemplateBoxOptions -> {TooltipDelay -> Infinity}] or Style[TraditionalForm@Binomial[a, b], TemplateBoxOptions -> {TooltipStyle -> Directive[Red, Bold]}] do work as expected. – Karsten7 Sep 07 '16 at 10:34
  • @Karsten7. I'm not sure I got your point. For a Binomial's template the default is Tooltip -> Automatic, defined in Core.nb and it overwrites my Tooltip->None even though I've put that setting on expression level. – Kuba Sep 07 '16 at 10:37
  • I don't know about the "Binomial's template". All I meant was that the option setting Tooltip -> None is the default for TemplateBoxOptions and changing other option settings for TemplateBoxOptions do have the expected effect. Therefore my expectation for using TemplateBoxOptions -> {Tooltip -> None} was that it doesn't have any effect, but now I understand that you expected it to change the settings inherited from the "Binomial's template". – Karsten7 Sep 07 '16 at 11:13
  • @Karsten7. yep I wasn't clear in that. There is a "Binomial" style in Core.nb with TemplateBoxOptions. – Kuba Sep 07 '16 at 11:15

1 Answers1

3

2. How can I check what are current values of e.g. ButtonBoxOptions?

One can get the current values for the $FrontEnd using for example

Options[$FrontEnd, ButtonBoxOptions]
{ButtonBoxOptions -> {Active -> True, Alignment -> {Automatic, Automatic},     
   Appearance -> {Automatic, "Palette"}, AutoAction -> False, 
   Background -> Automatic, BaseStyle -> "GenericButton", 
   BaselinePosition -> Automatic, ButtonData -> Automatic, 
   ButtonFunction :> (FrontEndExecute[{FrontEnd`NotebookApply[
         FrontEnd`InputNotebook[], #1, Placeholder]}] &), ButtonMargins -> 3, 
   ButtonMinHeight -> 1., ButtonNote -> None, ButtonSource -> Automatic, 
   ContentPadding -> True, DefaultBaseStyle -> "Button", 
   DefaultTooltipStyle -> "TooltipLabel", Enabled -> Automatic, 
   Evaluator -> None, FrameMargins -> Automatic, ImageMargins -> Automatic, 
   ImageSize -> Full, Method -> "Queued", Tooltip -> None, TooltipDelay -> 0.,
    TooltipStyle -> {}}}
Options[$FrontEnd, TemplateBoxOptions]
{TemplateBoxOptions -> {BaseStyle -> {}, DefaultBaseStyle -> {}, 
   DefaultTooltipStyle -> "TooltipLabel", DisplayFunction -> None, 
   Editable -> Automatic, Inactive -> False, InactiveStyle -> "InactiveStyle",
    InterpretationFunction -> Automatic, Selectable -> Automatic, 
   SyntaxForm -> Automatic, Tooltip -> None, TooltipDelay -> 0., 
   TooltipStyle -> {}}}

In the Option Inspector they can be found under
Formatting Options ► Expression Formatting ► Controls Options or Specific Box Options

Karsten7
  • 27,448
  • 5
  • 73
  • 134