Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you handle this folks?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00393112
Message ID:
00394137
Vues:
11
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> (Me:)
>>>This way, users cannot close until after
>>the crucial stuff happens. By the way,
>>the effect of the X button is to execute
>>your shutdown routine IMMEDIATELY
>>after the line of code that is currently
>>executing -- not the current procedure,
>>but the current line of code.
<<<<snip>>>

>>> (Jess:)
>That's very true. And as Eric says, it is a weird and annoying behaviour.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It certainly can be annoying, but I am not sure how weird it is. Remember, that that little X is a Windows "item" not a FoxPro item. It ends the current application, no matter what the application is (Word, Excel, Jess's SuperDatabaseLanguage, what have you). It's just a Windows issue to take into account, not unlike, say, the issue of icons on minimized apps, or TaskManager allowing a user to close your app externally. What I do find weird is how little this behavior is discussed, documented, or even dealt with in many common frameworks.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> (Me:)
>>Again, one could argue "bad design" in
>>such a case as the one outlined about,
>>and you'd be right, but trust me this
>>one can burn you. In fact, I have
>>placed _screen.Closable code in my routines
>>that change mousepointers to and from an
>>hourglass, to help capture most circumstances.

>>> (Jess:)
>What we did is, ON SHUTDOWN is set to default
>just before calling the form. We did it by
>changing the way we call form in the menu.
>Instead of using ON SELECTION BAR 1 OF
>blah... DO FORM our_form, we make it
>DO CALLFORM WITH "ourform" and in the
>CALLFORM routine we have this code:

>PROCEDURE CallForm ( cForm )
> WAIT WINDOW "Loading form wait..." NOWAIT
> _SCREEN.MOUSEPOINTER = 11
> ON SHUTDOWN
> DO FORM (cform)
>ENDPROC
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

That'll do it. And I prefer wrapping DO FORM calls and the like anyway, in case there's ever a reason to change the way you execute DO FORM -- if you decide to store forms as objects, or if Microsoft introduces some sort of quicker NewForm command in VFP 7 SP 2, etc. ;-)
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform