MathGroup Archive 2012

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

Search the Archive

Re: How to lock down a Dynamic object in a report

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128259] Re: How to lock down a Dynamic object in a report
  • From: awnl <awnl at gmx-topmail.de>
  • Date: Sat, 29 Sep 2012 20:07:57 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <k466s7$a8m$1@smc.vnet.net>

Hi,

> Is there a way to lock a Dynamic object so it does not respond to
> users? I know it sounds funny, but I have created a LocatorPane to
> organize items in a database.  When I publish my weekly report as a
> CDF, the same LoacatoPane also serves as a nice graphic of the
> current state of the database.  However, the reader can accidentally
> scramble the Locators or try to apply the changes to the database
> which of course serves up errors in CDFReader.  Solutions that don't
> work:
>
> * Deploy only locks down editing of graphics, but controls still
> respond. * Publishing the report as a PDF won't work because I use
> cell grouping and OpenerViews elsewhere in the report. * Recreating
> the LocatorPane as a Graphic is undesirable because I put a lot of
> work into it, and I don't want to have to maintain two complex
> functions like that.
>
> So, is there a wrapper like Deploy that I can use around my
> LocatorPane when I want to publish it as a static object?

You could try to just disable the locators. If they use the default
appearance, that will slightly change (be grayed out). You could
avoid that with a custom appearance definition. This does it for one of 
the documentation examples with a global Style wrapper and overwrites 
the appearance so the locator looks like it would if enabled:

Style[
  DynamicModule[{pt = {1, 1}/2}, {LocatorPane[Dynamic[pt],
     Graphics[{Gray, Disk[]}],
     Appearance ->
      Style[Graphics[{Locator[{0, 0}]}], Enabled -> True]],
    Dynamic[pt]}],
  Enabled -> False
  ]

Depending on the real example you might need to do something more
specific so that you only disable those locators that you actually want
to disable...

hth,

albert



  • Prev by Date: Re: Clearing all variables and definitions: i.e. "resetting" mathematica
  • Next by Date: Re: How to lock down a Dynamic object in a report
  • Previous by thread: Re: How to lock down a Dynamic object in a report
  • Next by thread: Re: How to lock down a Dynamic object in a report