Here is another VFP bug (or is this a feature by design?). It does this in
VFP7,8,9. I don't have any older versions on this workstation, but I'll try
it in older versions tonight.
Run code. Click Dummy Button. Click Modal. Click Dummy Button. On some
workstations, after you click the Modal button, if you click any of the
buttons, there is no visual indication that the button was pressed. The
click method still fires. Click the Not-Modal button and everything goes
back to normal. At any time you can click the Done button to exit form. The
Dummy Button doesn't do anything, it's just there to click so you can
observe the button to see if it visually depresses when clicked on.
As near as I can tell, if you put a show(1) in the deactivate method and
execute the deactivate method, it somehow prevents the buttons VisualEffect
property from being set to 2 when you click it (2 causes it to appear
depressed). Calling show(0) from deactivate restores this functionality.
There may be more to it, but this as far as I've had time to go.
*----------- start ----------------------
loForm = CREATEOBJECT('myform')
loForm.AddProperty('mode',0)
loform.show
READ events
DEFINE CLASS MyForm as Form
ADD OBJECT cmdHide as CommandButton WITH Caption = "Modal",top=25,LEFT=20
ADD OBJECT cmdShow as CommandButton WITH Caption =
"Not-Modal",TOP=50,LEFT=20
ADD OBJECT cmdDummy as CommandButton WITH Caption = "Dummy
Button",TOP=75,LEFT=20
ADD OBJECT cmdDone as CommandButton WITH Caption = "Done",TOP=100,LEFT=20
PROCEDURE cmdDone.click
Thisform.cmdShow.click
CLEAR EVENTS
thisform.Release
ENDPROC
PROCEDURE cmdHIDE.CLICK
Thisform.mode = 1
thisform.hide
ENDPROC
PROCEDURE cmdSHOW.CLICK
Thisform.mode = 0
thisform.hide
ENDPROC
PROCEDURE DEACTIVATE
THISFORM.Show( Thisform.Mode )
ENDPROC
ENDDEFINE
*----------- end ------------------