Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First bug in VFP8SP1 discovered
Message
De
10/10/2003 15:25:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00836211
Message ID:
00837622
Vues:
39
>>>Regarding this issue (which nailed us too, I might add), here is what really angers me: Try as I might, I COULD NOT get bindevents to work with the _Screen object in the original release of VFP8. I even posted some questions about this to UT but nobody responded, and then I found that bizzare-assed subclassing-an-object-outside-its-class-definition workaround in VFP help that worked fine until SP1. If bindevents would have worked with _screen the way it was supposed to, this would never have been a problem. But it wasn't an either-or situation, so now MSFT has broken countless VFP applications out there.
>>>
>>>Now PLEASE, can anybody tell me: In SP1, does bindevents work with the _screen object?... or do you still get a no-show when it's time for your bound events to be invoked?
>>>
>>>>My resize code for _Screen worked perfectly for VFP8 but since I installed SP1 i gives me a
>>>>Unknown member oScr in the following code when I try to instanciate this class:
>>>>
>>>>
DEFINE CLASS ScreenHook AS Custom
>>>>    oScr = _SCREEN  && Set a property referenace to the Screen object
>>>>	oVFP = _VFP
>>>>
>>>>	FUNCTION oScr.Resize
>>>>		IF TYPE("Applic") = "O" AND !ISNULL(Applic) AND ;
>>>>			PEMSTATUS(Applic, "ResizeDesktop",5)
>>>>		
>>>>			Applic.ResizeDesktop
>>>>		ENDIF
>>>>	ENDFUNC
>>>>ENDDEFINE
>>>>
>>>>
>>>>I´m getting real dissapointed by installing this SP1....
>>>>
>>>>Walter
>>
>>This works for me in VFP8 and SP1:
>>
>>
>>_Screen.Newobject("oSH","ScreenHook")
>>Bindevent(_Screen,'Resize',_Screen.oSH,'Resize')
>>Bindevent(_Screen,'Moved',_Screen.oSH,'Moved')
>>Bindevent(_Screen,'RightClick',_Screen.oSH,'RightClick')
>>
>>Define Class ScreenHook As Custom
>> Procedure Resize()
>>  *
>>  * Code to handle the main VFP screen being resized
>>  *
>>  Wait Window Nowait "Resize"
>> Endproc
>> Procedure Moved()
>>  *
>>  * Code to handle the main VFP screen being moved
>>  *
>>  Wait Window Nowait "Moved"
>> Endproc
>>
>> Procedure RightClick
>>  *
>>  * Could be code to do a "shortcut" menu on main VFP screen RightClick
>>  *
>>  Wait Window Nowait "Rightclick"
>> Endproc
>>Enddefine
>>
>
>Jim, thank you. Can you tell me: Does the delegate object have to be a member of the parent object? For example, what if you had used
> oFreeStandingObject=NEWOBJECT("oSH","ScreenHook")
>instead of _Screen.NewObject() to instantiate the ScreenHook class. That's what I tried doing using the example in VFP help under BindEvent(), and it did not work. I did not try _screen.newobject()

That code works for me, at least it does what it is supposed to do, which is keeping the Class Browser up against the right edge of the VFP screen when the VFP screen is resized. This is a modification of that code which removes the Class Browser from the picture, and just fires a WAIT WINDOW on the resize. Works fine for me.
PUBLIC oHandler
oHandler=NEWOBJECT("myhandler")
BINDEVENT(_SCREEN,"Resize",oHandler,"myresize")

DEFINE CLASS myhandler AS Session
   PROCEDURE myresize
 		wait window Program() nowait
 	endproc 
ENDDEFINE
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform