/ Forums / Advansys Formativ / Creating Solutions with Formativ / Clearing the mouse/keyboard buffer after displaying a form / Reply To: Clearing the mouse/keyboard buffer after displaying a form



    Thanks for the information. I have experimented some with modal/modeless forms in Formativ but can’t quite get them to waork as I need. I’ll explain what I am doing, maybe that will help.

    I have two processes to get through in my applet.

    The first is a test against a particular mailbox looking for a particular email. This is all handled in Formativ and takes about 2 seconds.

    The second process only happens if the first process succeeds (if it doesn’t the applet displays a msg and exits). This process creates an object against my custom VB ActiveX EXE and calls a function therein. This process takes about 2 seconds to get started (creating/calling the object). At that point a form (VB form) is displayed and the user completes this. The applet code execution waits until the VB function completes.

    Since processes 1 and 2 take 4 to 5 secs to get to the point where the VB form is displayed I display a modeless “Please Wait” dialog right at the start of my applet and only hide it just before displaying the VB form.

    In principle this works fine. However if the user clicks around the edges of the Please Wait form, or around the edges of my VB form then those clicks are stored up and passed to GW once the applet completes.

    Also, a lot of the users are keen on double-clicking the toolbar button (a formativ button) to start the applet in the first place. This means the second click waits until the whole applet has completed before being triggered – it then fails because the email has already been ‘logged’ (the purpose of my applet). I realise this is a training issue but some people just don’t do as they’ve been told.

    Version two of my applet was to try and use a modal form. The way I tried to do this was as follows …

    Create a Please Wait form.
    Add a Timer to it that is enabled and has an interval of 100 (0.1sec)

    Add a sub for the Timer’s event that …
    1) switches the timer off so it can only run once
    2) triggers my main applet – the Please Wait form is hidden in this applet but is still running
    3) unloads the Please wait Form once the applet has completed

    In principle this works better. The Please Wait form won’t allow clicks to be directed at GW. Nor will any be done whilst the VB form is up. Double clicking the Applet’s toolbar button doesn’t start it twice. All perfect.

    The one problem I have is “3)” above – I can’t work out how to get rid of my Modal form. In VB, a modal form ceases to be modal when it is hidden with the .Hide method. In Formativ this justs gets me locked out as I have a form I can’t get to to shutdown!

    Is there a way of instructing the form to stop running?

    I realise I could have a OK button and change the Please Wait to say ‘Log Completed’ or something but I’d rather not. They know they’ve logged it because they just filled in the form, another dialog to say OK to would be very annoying.

    I am running all this is the Creator by the way, the finished applets go out as FlexaLocked. Does that change their ‘form’ behaviour at all?