Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Barbara Peisch
  Where is Barbara Peisch?
 Oceanside
 California - United States
 Barbara Peisch
 To: Michael C. Butler
  Where is Michael C. Butler?
 Austin
 Texas - United States
 Michael C. Butler
 Tags
Subject: RE: Making items visible
Thread ID: 104280 Message ID: 104316 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Monday, August 14, 2006 10:24:28 PM         
   


Just for the future...you can use a MESSAGEBOX() instead of WAIT WINDOW in a top-level form. And MESSAGEBOX() has a timeout (starting with VFP 7).

> Thanks for the ideas, but because this is a top-level form, and not in the foxpro screen, the WAIT WINDOW message will not appear for the user...
>
> After playing with the code, I found that you are correct in that the method executes everything before the REFRESH no matter where it is...
>
> However, if I issue WAIT WINDOW "" TIMEOUT 1, right after the refresh, I found that the form does update correctly before continuing....
>
> MB
>
>
>
> > > Good morning....
> > >
> > >
> > > I have a login form with two(2) text boxes, and two(2) command buttons.
> > > Text1 = name
> > > text2 = password
> > > Command1 = login
> > > command2 = cancel
> > > label1 = "Connection to tables...Please wait...."
> > >
> > > label1 is initially visible=.F.
> > >
> > > Now, when the user enters his name / password, and clicks the login button, it calls the login method:
> > > thisform.login()
> > >
> > >
> > > LOGIN method:
> > > with thisform
> > > .label1.visible = .T. &&turn on message
> > > .command1.enabled = .f. && disable buttons so users can not click them again
> > > .command2.enable = .F.
> > > endwith
> > >
> > > ....
> > > verify username / password code goes here
> > > It is connecting to an oracle backend, and verifying that the connection is good.
> > > ....
> > >
> > >
> > > If failed
> > > with thisform
> > > .label1.visible = .F. &&turn message off
> > > .command1.enabled = .T. && reenable buttons
> > > .command2.enable = .T.
> > > =messagebox("Login Failed...Please try again")
> > > .refresh
> > > endwith
> > > return
> > > else
> > > do form mainform
> > > endif
> > >
> > >
> > > My problem is this:
> > > When the user clicks on the LOGIN button, there is a LONG delay between when the button is clicked, and when the label1 actually becomes visible...
> > >
> > > Is it almost like it it executing the oracle connection code, before it updates the form, even though I have issued a refresh BEFORE that code executes...
> > >
> > > Once the connection takes place, the main forms loads quickly, and releases the login form...
> > > It is really annoying for the customers, when the label does not appear telling them what is going on.
> > > They think the system is frozen, when in fact it is not....
> > >
> > >
> > > Any ideas?

> >
> > Hi Michael,
> >
> >
> > You can issue a WAIT WINDOW command before the codes that connects to the Oracle database. Like:
> >
> >
> > with thisform
> > .label1.visible = .T. && /// you can remove this now
> > .command1.enabled = .f. && disable buttons so users can > .command2.enable = .F.
> > endwith
> > WAIT WINDOW "Connecting to the server, please wait..." NOWAIT
> >
> >
> > I think because the method finishes first the connection before returning the focus on the login form. So the controls are not yet refresh.
> >
> > You can remove the label that says the message altogether because the Wait Window Nowait will be displayed and inform the users of the status.
> >
> >
> > Regards,
> >
> >
> > ReyM




-BP
www.peisch.com

ENTIRE THREAD

Making items visible Posted by Michael C. Butler @ 8/14/2006 4:41:51 PM
RE: Making items visible Posted by Rey Magdalaga @ 8/14/2006 5:13:38 PM
RE: Making items visible Posted by Michael C. Butler @ 8/14/2006 8:18:14 PM
RE: Making items visible Posted by Barbara Peisch @ 8/14/2006 10:24:28 PM
RE: Making items visible Posted by Michael C. Butler @ 8/15/2006 1:20:23 PM
RE: Making items visible Posted by Vinay Pagaria @ 8/19/2006 8:15:39 AM
RE: Making items visible Posted by tushar @ 8/14/2006 6:46:36 PM
RE: Making items visible Posted by Pete Sass @ 8/18/2006 6:59:36 PM
RE: Making items visible Posted by Michael C. Butler @ 8/21/2006 11:01:49 PM