Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bind to _SCREEN's oleDragOver event
Message
De
10/02/2006 03:14:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01095369
Message ID:
01095387
Vues:
8
>i'm trying to bind to the _screen's oledragover event but it won't fire
>(i've put debug code into the oledragover method and it isn't being entered
>at all).
>
>What am i missing?
>
>
>thanks (with apologies to those who've already seen this elsewhere)
>
>Nigel
>
>
>
>I have...
>
>
> goOleHandler= getScreenOleHandler()
> _SCREEN.OLEDROPMODE = 1
> _SCREEN.OLEDROPEFFECTS=1
> =BINDEVENT(_SCREEN,"OLEDragDrop",goOleHandler,"oledragdrop")
> =BINDEVENT(_SCREEN,"OLEDragOver",goOleHandler,"oledragover")
>
>
>function getScreenOleHandler()
>RETURN CREATEOBJECT("ScreenOleDrop")
>
>
>DEFINE CLASS ScreenOleDrop AS custom
> PROCEDURE OLEDRAGDROP
>  LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
>  TRY
>   IF oDataObject.GETFORMAT(15) && list of files from explorer
>    LOCAL laFiles(1)
>    oDataObject.GETDATA(15,@laFiles)
>    FOR EACH lcFile IN laFiles
>     DO FORM IMPORT.scx WITH lcFile
>    NEXT
>   ENDIF
>  CATCH TO oe
>   =postmortem(oe)
>  ENDTRY
> PROCEDURE OLEDRAGOVER
>  LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
>  TRY
>   IF oDataObject.GETFORMAT(15)
>    THIS.OLEDROPHASDATA = 1
>    THIS.OLEDROPEFFECTS = 4
>    nEffect = 4
>   ENDIF
>  CATCH TO oe
>   =postmortem(oe)
>  ENDTRY
>ENDDEFINE
>
a bug, if you bind an OLEXXXXX event, the event don't happen
CREATEOBJECT("MyForm")

DEFINE CLASS MyForm AS Form
 OLEDROPMODE = 1
 OLEDROPEFFECTS=1	
 
  PROCEDURE load
  	ADDPROPERTY(this,"live",this)
  	this.Show
* comment and you can look the caption
    =BINDEVENT(THIS,"OLEDragOver",THIS,"oledragover1",1)

  PROCEDURE OLEDRAGOVER
   LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
   THIS.Caption = "OLEDRAGOVER "+TRANSFORM(SECONDS())
    
  PROCEDURE OLEDRAGOVER1
   LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
   THIS.Caption = THIS.Caption + "  OLEDRAGOVER1"
       
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform