Add controls to a form actions

Add controls to a form actions

Post by Q0o » Wed, 11 Mar 2009 21:28:01


using vfp9sp2...

when i add a control to a form, i want to automatically have a program run
to reset the name, or ask a question and set the control source, etc...

how can i do this?
 
 
 

Add controls to a form actions

Post by Fred Taylo » Wed, 11 Mar 2009 23:50:02

It's called a "builder".

http://www.yqcomputer.com/

You can also check out the Fox WIKI for some "how-to" usage.

http://www.yqcomputer.com/ ~BuilderB

BuilderB was the original version, and BuilderD is a data driven version by
Doug Hennig.

--
Fred

 
 
 

Add controls to a form actions

Post by Q0o » Thu, 12 Mar 2009 01:31:01

thanks Fred, i have created several builders. very familiar with them but...

i am looking for a way to make something happen automatically when i add a
control to a form, to make things happen without the developer having to even
think about it.
 
 
 

Add controls to a form actions

Post by Olaf Dosch » Thu, 12 Mar 2009 07:54:49

Hi CJ,

I'm afraid there's no real event for that, even ProjectHook
does only allow you to react to creating a new file in the
projectmanager it's hooked in, eg a new class, but not
a new object (eg control) in a class (eg a form).

Bye, Olaf.
 
 
 

Add controls to a form actions

Post by Q0o » Thu, 12 Mar 2009 22:50:09

how about using the windows message queue?
 
 
 

Add controls to a form actions

Post by Olaf Dosch » Thu, 12 Mar 2009 23:38:08

What do you expect to find in there?
The thing that will change if you add an object
in an open designer is the array ASELOBJ()
will create, so having a timer periodically
testing if ASELOBJ() creates an array with
a new object reference is perhaps the best
option you have.

Bye, Olaf.
 
 
 

Add controls to a form actions

Post by Dan Freema » Fri, 13 Mar 2009 00:11:22

Or turn on builder lock.
 
 
 

Add controls to a form actions

Post by Olaf Dosch » Fri, 13 Mar 2009 00:39:32

> Or turn on builder lock.
???

Hmm, I found it, but it seems to be reverse
from what you say:

Form Controls toolbar
If the Builder Lock is not on, foundation classes dropped from the Form
Controls toolbar may launch an associated builder.

So this is a feature of FFX foundation classes?!

Bye, Olaf.
 
 
 

Add controls to a form actions

Post by Dan Freema » Fri, 13 Mar 2009 01:19:20

No, it well pre-dates foundation classes. It goes all the way back to VFP3.
Sounds like the help file is wrong. (I'll look later.)

Builder lock forces builder to run when controls are dropped onto a designer
(form or class). If only default builders are in the builder.app driver
table, that builder will run. If multiple builders are registered for the
just-dropped class, user gets a picklist.

Dan
 
 
 

Add controls to a form actions

Post by Olaf Dosch » Fri, 13 Mar 2009 01:24:24

> So this is a feature of FFX foundation classes?!
Forget that question. I found that button in the toolbar.
Never used builders, at least not excessive.

@CJ
You can of course use BuilderB or D and create builders
with no UI, that simply modify .name or other properties.

Bye, Olaf.
 
 
 

Add controls to a form actions

Post by Q0o » Fri, 13 Mar 2009 04:30:13

thanks guys... i dont want to use builder locks or a builder.
some builders i dont want to come up.

basically this came about from wanting to have a standard name for a grid on
a pageframe in our app...

i name every grid glist and i always know what to type when im in code.

other developers never update a name or always pick a different name.

anyway, just wanted to start with something that would set the grid name to
glist when i drop it on a pageframe page.

aselobj and a timer may be the only option, or maybe modifying my form
builder to check and rename stuff

thanks...
 
 
 

Add controls to a form actions

Post by Dan Freema » Fri, 13 Mar 2009 05:00:21

As Olaf said, BuilderB will bring about exactly what you want.

Dan