Some years ago, Rolf Mertig created a palette CellProperties.nb that
included toggle buttons for selected cells to be open/closed,
evaluatable/non-evaluatable, active/inactive,
initialization/non-initialiation; it includes a button to duplicate
selected cells and two buttons for opening or closing all selected
groups. That palette is available at:
http://www.mertig.com/mathdepot/
It's an easy thing to modify his palette so as to include setting
Opacity->0.5 when cells are made non-evaluatable (and back to Opacity->1
when evaluatable).
At least it's easy now that I know the forgotten "secret". As Ingolf
Dahl kindly reminded me, the Palettes menu has an item "Generate
Notebook from Palette" along with an item "Generate Palette from
Selection". I have so much "palette creep" on my menu I didn't even see
those, and I had quite forgotten about them -- which is unforgivable
because it's easy to (re-)learn of their existence by looking up
"palette" in the Documentation Center.
dflatin at rcn.com wrote:
> On Feb 2, 11:38 pm, Murray Eisenberg <mur... at math.umass.edu> wrote:
>> It's always nice to be able to save one mouse movement/click! (An
>> instance of the Archimedean Ordering Property: if you add a very small
>> number to itself enough times, you can get an arbitrary large large
>> number. Or, one-time U.S. Senator Everett M. Dirkson is alleged to have=
>
>> said about government spending, "A billion here, a billion there, and
>> pretty soon you're talking about REAL money.")
>>
>> So I added the obvious thing to the buttons so now the palette also
>> offers the option to close or open the cell.
>>
>> When using CreatePalette upon a Grid with the four buttons, I evaluated:
>>
>> Options[CreatePalette]
>>
>> It's an awesomely long list!
>>
>>
>>
>> dr DanW wrote:
>>> On Feb 1, 1:16 am, Makinator <luvly.jubbly.makina... at gmail.com> wrot=
> e:
>>>> Please could someone help me,
>>>> I would like to to set-up mathematica's notebook to automatically
>>>> change color to some custom color, when I set this cell as non-
>>>> evaluatable. And vice versa, when I set it to evaluatable to change
>>>> color to default.
>>>> THX
>>> I have created buttons that simultaneously change the Evaluatable
>>> option and a visible attribute of the cell and put the buttons in a
>>> palette that is always on my screen. Of course, if you change
>>> Evaluatable from the menu, the cells appearance will change in sync,
>>> so you always have to use the buttons to turn it on or off.
>>> I have found that changing the Opacity of the cell to 50% works well
>>> when I set Evaluatable->False. It lets me see the syntax highlighting=
>
>>> and the dim appearance makes it clear that it does nothing (well, it
>>> looks dim on a Mac. On Windows XP, it just looks a little foggy.)
>>> Here is the code for creating the two buttons:
>>> EvaluateButton = Button["Cell Evaluatable",
>>> SelectionMove[SelectedNotebook[], All,
>>> Cell]; SetOptions[NotebookSelection[InputNotebook[]],
>>> Evaluatable -> True, Opacity -> 1]; , Appearance -> "Palette=
> ",
>>> ImageSize -> Small];
>>> NotEvaluateButton = Button["Cell Not Evaluatable",
>>> SelectionMove[SelectedNotebook[], All,
>>> Cell]; SetOptions[NotebookSelection[InputNotebook[]],
>>> Evaluatable -> False, Opacity -> 0.5]; , Appearance ->
>>> "Palette",
>>> ImageSize -> Small];
>>> In both cases, the button function makes sure that the whole cell is
>>> selected, then sets Evaluatable and Opacity.
>>> Put these buttons in a Grid[] and use CreatePalette[], then save the
>>> resulting palette.
>> --
>> Murray Eisenberg
>
> I liked this idea so I made a palette with two toggle buttons, one for
> evaluatable and one for open/close
>
> ToggleEvaluateButton = Button[
> Style["Toggle Evaluatable", 9],
> Module[{ns},
> SelectionMove[SelectedNotebook[], All, Cell];
> ns = NotebookSelection[InputNotebook[]];
> If[Evaluatable /. Options[ns],
> SetOptions[ns, Evaluatable -> False, Opacity -> 0.5],
> SetOptions[ns, Evaluatable -> True, Opacity -> 1]
> ]
> ],
> Appearance -> "Palette"
> ];
> ToggleOpenCellButton = Button[
> Style["Toggle Open/Close", 9],
> Module[{ns},
> SelectionMove[SelectedNotebook[], All, Cell];
> ns = NotebookSelection[InputNotebook[]];
> If[CellOpen /. Options[ns],
> SetOptions[ns, CellOpen -> False],
> SetOptions[ns, CellOpen -> True]
> ]
> ],
> Appearance -> "Palette"
> ];
>
> CreatePalette[Column[{ToggleEvaluateButton, ToggleOpenCellButton}]]
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305