realbasic-nug.fr
[Top] [All Lists]

Re: Désactiver (ou du moins contrôler ) le drag'n drop dans

To: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Subject: Re: Désactiver (ou du moins contrôler ) le drag'n drop dans un editField
From: Nicolas Jullien <jullien.n@free.fr>
Date: Thu, 26 Jun 2008 18:45:42 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug.fr-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug.fr-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <p06240808c48968988221@[62.161.36.122]>
References: <E5F637B2-38A6-4D39-8378-7426CE21C31C@free.fr> <p06240802c488fa85b592@[62.161.36.122]> <FECA4291-50B8-420A-AA5E-FCBF9BD1C40C@free.fr> <p06240804c48905d45c13@[62.161.36.122]> <0FC8766F-5F1C-418C-A4B5-49A13E44EAEF@free.fr> <EB3754F3-CDAE-4899-8AA2-F86481B31402@mac.com> <717C8F51-F0DB-483D-BD34-9047F1673BA7@free.fr> <p06240808c48968988221@[62.161.36.122]>
Reply-to: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Sender: realbasic-nug.fr-bounces@lists.realsoftware.com
Oubliez mon dernier message
Ca marche, mais pour l'instant ca fait pas ce que je veux, et ca risque d'etre pas facile d'empecher la modif du contenu de l'editField dans l'evenement TextChange qui est lancé une fois que le texte est changé !



Le 26 juin 08 à 17:42, Jean-Luc Arnaud a écrit :

Le 26 juin 08 à 14:28, Arnaud Nicolet a écrit :

Le 26 juin 08 à 13:44 (soir), Nicolas Jullien a écrit:

Je viens de trouver mais alors c'est pas satisfaisant du tout !

http://support.realsoftware.com/listarchives/realbasic-nug/ 2007-12/msg00233.html

How to stop an EditField to automatically accept any text dropped on? The DropObject event never fires, so I can't control the text dropped
 onto the editField.

This is not a great method, but I'd simply think that if the text has changed without a keydown event or the cut/paste/clear menu item (or
by code), it's a text drop.
I'd make a new class (as EditField) and add a property (TextWillChange As Boolean). Then you put "TextWillChange=true" in the menu handlers of the cut and paste menu items and in the keydown event (and anywhere
you change the text in code).

C'est un peu désespérant !
SVP, Real Guys débogez RB !

Bon, je reconnais là l'un de mes anciens messages, désolé que ma solution ne vous convienne pas. Comment se fait-il que vous disiez avoir trouvé, mais qu'en même temps ce n'est pas satisfaisant? Ça veut donc dire que vous n'avez pas trouvé, j'aurais cru.
J'ai trouvé une des solutions proposées (la votre donc) mais en meme temps c'est pas satisfaisant car ca montre qu'il s'agit donc d'un hack/trick mais pas d'une solution propre d'interception de l'event drag comme on aurait pu l'espérer dans un monde sans bug.


Personnellement, j'utilise ceci :

Dans un EditFiled :
        Open : Me.AcceptTextDrop
        DragEnter : DropText=obj.Text
        DragExit : DropText=""
        TextChange :
                If DropText<>"" Then
                  Me.Text=DropText
                  DropText=""
                End If


Cela fonctionne bien (au moins pour mes besoins !)

JLA






<Prev in Thread] Current Thread [Next in Thread>