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 ------------------

Re: My Bug Of The Week by Ook

Ook
Fri Aug 26 16:10:04 CDT 2005

Update. If on XP with visual styles enabled, it works as expected. On
Win2000 or XP with visual styles disabled, it seems to not depress visually.

"Ook" <no usenet spam at zoot al dot com> wrote in message
news:uTWQ4ynqFHA.2880@TK2MSFTNGP12.phx.gbl...
> 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 ------------------
>
>



Re: My Bug Of The Week by Ook

Ook
Sun Aug 28 01:22:46 CDT 2005

No one tried this? One of our developers uses this technique to switch forms
from non-modal to modal. Unfortunately, this code is running on several
thousand workstations. Fortunately, it's not very noticeable and no one has
complained yet.

"Ook" <no usenet spam at zoot al dot com> wrote in message
news:eNEmQLoqFHA.2076@TK2MSFTNGP14.phx.gbl...
> Update. If on XP with visual styles enabled, it works as expected. On
> Win2000 or XP with visual styles disabled, it seems to not depress
> visually.
>
> "Ook" <no usenet spam at zoot al dot com> wrote in message
> news:uTWQ4ynqFHA.2880@TK2MSFTNGP12.phx.gbl...
>> 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 ------------------
>>
>>
>
>