Kruno
Programmer
- Aug 24, 2002
- 16
WAIT WINDOW is used mostly with TIMEOUT or NOWAIT clause. I have never used NOCLEAR clause before.
When user selects an item from listbox (e.g. filled with filenames), before he clicks on commandbutton to do something with it, I want to show him what he selected and what will happen after clicking.
Wait window and commandbutton's MOUSEENTER method will serve to show such dynamic message.
Case #1: WAIT WINDOW sometext NOWAIT and "sometext" will show shortly and dissapear while you are continuing to move mouse over commandbutton's pixels.
Case #2: using NOCLEAR clause will make "sometext" staying visible while you are moving your mouse. To switch off showing "sometext" you put WAIT CLEAR in MOUSELEAVE method. But when you enter with mouse again, wait window does not show anymore!
Case #3: The trick is to add WAIT WINDOW '' TIMEOUT 0.001. Yes, NOCLEAR is nice feature but needs CLEAR + TIMEOUT to work properly. Unfortunately when you decide to click the commandbutton you need two clicks !
Case #4: To solve this new problem you have to add TIMEOUT 0.001 after NOCLEAR (e.g.WAIT WINDOW sometext NOCLEAR TIMEOUT 0.001). You will need just one click to activate commandbutton and "sometext" will show properly everytime you enter with mouse over commandbutton.
Kruno Malovic
When user selects an item from listbox (e.g. filled with filenames), before he clicks on commandbutton to do something with it, I want to show him what he selected and what will happen after clicking.
Wait window and commandbutton's MOUSEENTER method will serve to show such dynamic message.
Case #1: WAIT WINDOW sometext NOWAIT and "sometext" will show shortly and dissapear while you are continuing to move mouse over commandbutton's pixels.
Case #2: using NOCLEAR clause will make "sometext" staying visible while you are moving your mouse. To switch off showing "sometext" you put WAIT CLEAR in MOUSELEAVE method. But when you enter with mouse again, wait window does not show anymore!
Case #3: The trick is to add WAIT WINDOW '' TIMEOUT 0.001. Yes, NOCLEAR is nice feature but needs CLEAR + TIMEOUT to work properly. Unfortunately when you decide to click the commandbutton you need two clicks !
Case #4: To solve this new problem you have to add TIMEOUT 0.001 after NOCLEAR (e.g.WAIT WINDOW sometext NOCLEAR TIMEOUT 0.001). You will need just one click to activate commandbutton and "sometext" will show properly everytime you enter with mouse over commandbutton.
Kruno Malovic
Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 53, ;
Left = 150, ;
Height = 27, ;
Width = 84, ;
Caption = "Case #1", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 98, ;
Left = 150, ;
Height = 27, ;
Width = 84, ;
Caption = "Case #2", ;
Name = "Command2"
ADD OBJECT command3 AS commandbutton WITH ;
Top = 143, ;
Left = 150, ;
Height = 27, ;
Width = 84, ;
Caption = "Case #3", ;
Name = "Command3"
ADD OBJECT command4 AS commandbutton WITH ;
Top = 187, ;
Left = 150, ;
Height = 27, ;
Width = 84, ;
Caption = "Case #4", ;
Name = "Command4"
PROCEDURE command1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT WINDOW TRANSFORM(TIME()) NOWAIT
ENDPROC
PROCEDURE command1.Click
WAIT WINDOW 'Done !' TIMEOUT 1
ENDPROC
PROCEDURE command2.MouseLeave
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT clear
ENDPROC
PROCEDURE command2.Click
WAIT WINDOW 'Done !' TIMEOUT 1
ENDPROC
PROCEDURE command2.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT WINDOW TRANSFORM(TIME()) noclear
ENDPROC
PROCEDURE command3.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT WINDOW TRANSFORM(TIME()) NOCLEAR
ENDPROC
PROCEDURE command3.Click
WAIT WINDOW 'Done !' TIMEOUT 1
ENDPROC
PROCEDURE command3.MouseLeave
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT clear
WAIT WINDOW '' TIMEOUT 0.001
ENDPROC
PROCEDURE command4.MouseLeave
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT clear
WAIT WINDOW '' TIMEOUT 0.001
ENDPROC
PROCEDURE command4.Click
WAIT WINDOW 'Done !' TIMEOUT 1
ENDPROC
PROCEDURE command4.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
WAIT WINDOW TRANSFORM(TIME()) NOCLEAR TIMEOUT 0.001
ENDPROC
ENDDEFINE