MathGroup Archive 2008

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

Search the Archive

Re: How to make an InputField inside of a graphic active...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89623] Re: How to make an InputField inside of a graphic active...
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Sun, 15 Jun 2008 06:13:52 -0400 (EDT)
  • References: <g2th4e$7j4$1@smc.vnet.net> <g3034g$mbc$1@smc.vnet.net>

On Jun 14, 5:30 am, Albert Retey <a... at arcor.net> wrote:
> David Reiss wrote:
> > One can place, say, a Checkbox in a graphic using Inset:
>
> > Deploy[Graphics[{LightGray, Disk[], Inset[Checkbox[]]}]]
>
> > and the resulting Checkbox is active: i.e., you can click on it and
> > the expected behavior happens.
>
> > Now if I try to do this with an InputField as in
>
> > Deploy[Graphics[{LightGray, Disk[], Inset[InputField[]]}]]
>
> > The resulting Inputfield cannot be accessed in the familiar way: i.e.,
> > clicking inside of it and then typing.
>
> > Do the Group members have a suggestion for how to do this sort of
> > thing with an InputField.
>
> > This, of course, is a distilled version of something else.  I am
> > building a CAD application for a customer, and I would like to place
> > input fields within the visual design that is being created so that
> > values can be assigned to various things.  This behavior would be
> > toggeled on and off as needed...
>
> > thanks for any help that you folks can give....
>
> I think the problem is with Deploy, which AFAIK sets ContentSelectable
> to False for Graphics. The following sets it to true for only the Inset
> around the Inputfield which kind of works. I don't know whether that is
> good enough for your customer, since you need to at least double klick
> to select the text to edit, but not always, so it doesn't give a very
> reliable impression, although I think the behavior is deterministic,
> just not easy to follow...
>
> text="hello";
>
> Deploy@Graphics[{
> LightGray,Disk[],
> Black,Inset[InputField[Dynamic[text],String,Enabled->True],\
> ContentSelectable->True]}
>
> ]
>
> Dynamic[text]
>
> hth,
>
> albert


Thank you.  This was very helpful.

Best,

David


  • Prev by Date: Re: interactive dragrect over a raster image
  • Next by Date: Re: Gradient fill as Background for Plot
  • Previous by thread: Re: How to make an InputField inside of a graphic active...
  • Next by thread: Re: Persistent addition to recently opened? Was Re: Notebooks location