, , , ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

Utility -- Create and Destory (None Specified)

At 31 DEC 1998 01:21:02PM Greg James wrote:

I have a form that uses the Utility function to Create/Destroy controls (Static, Edit Field, & Combo Boxes) as a user scrolls through a set of questions contained in a user-specific record.

It works fine except that when Edit Fields are destroyed, they leave a 'shadow' of the edit field control behind. Neither the Static nor Combo Box control types exhibit the same behavior. I have noticed that the edit fields are destroyed (removed from the form) completely if the form that the controls are on (were on) loses focus.

For example:

For ObjectNum=1 To ObjectCount

X=Utility('DESTROY',ObjectList)

Msg(@Window,ObjectList)

Next ObjectNum

If, after each control is destroyed, focus switches to a message box, the control and its 'shadow' are completely removed.

Obviously, this wouldn't work too well for the end user, so I am currently doing this:

For ObjectNum=1 To ObjectCount

Type=Get_Property(ObjectList,'TYPE')

If Type _EQC 'EDITFIELD' Then

Set_Property(ObjectList,'VISIBLE',FALSE$)

End

X=Utility('DESTROY',ObjectList)

Next ObjectNum

Is this a known bug, or is this occurring because of the way I am creating the Edit Fields? It doesn't seem to affect performance to set the edit fields to invisible before destroying them, but perhaps there is a better solution to this problem.

Any advice would be appreciated.

gjames@cyberhighway.net onmouseover=window.status=happy new year;return(true)"

International Severity Information Systems, Inc.


At 04 JAN 1999 03:36PM Stephen Revelation wrote:

Greg,

I'm not quite sure where this sample code is being performed. That is, in what event? And in what control or form? Also, when you say edit field could you clarify if it is an edit box or an edit line.

I personally got a simplified version of your form to 'destroy' edit lines without a problem using the GOTFOCUS event. I simply used the Utility command on the suceeding control's GOTFOCUS event and the edit line disappeared cleanly ,(no shadow). If you could explain your application set-up in any further detail it might help us.

Good luck.

Stephen Revelation


At 04 JAN 1999 06:13PM Greg James wrote:

I am using the Utility function to destroy and create controls from the click event of a button. The controls that are leaving the 'shadows' are edit lines. I would be happy to send you an appbackup of the application if that would help you to help me figure out what is going on.


At 05 JAN 1999 04:52PM Stephen Revelation wrote:

Greg,

Thus far I have not been able to recreate your situation. Yes, e-mail me a copy of your appbackup and we'll see if we can recreate it based on your work. Have you tried your script to a GOTFOCUS event yet? Any luck?

Regards,

Stephen Revelation


At 06 JAN 1999 12:23PM Greg James wrote:

Stephen,

The table that I use with this program is quite large. It might be necessary for me to mail the application to you. Please call if you get a chance and we will discuss this is greater detail.

Thanks,

Greg James

ISIS, Inc.

801-466-5595 x120


At 06 JAN 1999 05:54PM Stephen Savage wrote:

Greg,

Just send me the script where you think the problem located. Whatever related code you can send will be great.

Regards,

Stephen Revelation


At 11 JAN 1999 04:43PM Gene Gleyzer Revelation wrote:

Greg,

Leaving the shadow is a known bug of the Ctl3d.dll. I ran into the same problem implementing the SIZE property. The workaround I used was the same one you've found – making the control invisible first. If you worry about the performance I would suggest doing this unconditionally – if a contros is already hidden, removing it take virtually no time.

Gene

View this thread on the Works forum...