Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removeobject skips some objects
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00835738
Message ID:
00835851
Views:
9
>Joe,
>
>If I have over anxious users or long running code I always do this in the button Click event:

This wouldn't work for me as there are numerous (right now 10) applications that they launch from this menu system.

>this.Enabled = .f.
>* do the long running thing
>this.Enabled = .t.

They can't since I am using getwindow/getwindowtext/setforeground API calls
to prevent that.

>If you use a timer to reenable the button then they can still endup relaunching the process several times.

That's a pretty good idea, I may try that.

>You can use one timer set to an interval of say 10 seconds, and a tLastClicked property on the button. When the button is clicked set .tLastClicked = datetime() and then in the timer do something like this:
>
>
for each loControl in this.parent.objects
>   if ( ! loControl.Enabled )
>      loControl.Enabled = datetime() > ( loControl.tLastClicked + 90 )
>   endif
>endfor
>
>you might want to do some PEMStatus() checks etc but this gives you the basic idea.
>
>>Because vapps may have changed which will add and/or remove buttons. The buttons are disabled as soon as the user clicks them. This is because some of the apps they launch have a lag time of maybe 60 seconds or so before they appear. We found that if we don't disable the button, the users click repeatedly (starting the app maybe 20 times) before they see the app start. The timer re-enables the button after a pause of about 90 seconds. So as far as I can tell, I need a timer for each button.
Previous
Reply
Map
View

Click here to load this message in the networking platform