[Gambas-user] File Chooser Drag and Drop

Bruce Steers bsteers4 at gmail.com
Sun Jul 17 11:04:33 CEST 2022


On Sun, 17 Jul 2022 at 09:58, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Sun, 17 Jul 2022 at 03:28, sbungay <sbungay at smartsonsite.com> wrote:
>
>>    Using the file chooser I want to drag one of the files from it
>> (represented by its icon) to a text area and on dropping it have the
>> text area load the file. Can't seem to get this to work, anyone have an
>> example project I can examine?
>>
>
> I just did this...
>
> https://gitlab.com/bsteers4/gambas/-/commit/51330ea23b08922593741daba56789e820329ca3
>
> Now i can turn on Dragging of file paths/names in DirChooser and
> FileChooser.
>
> The bad news is the Choosers are not so easy to import as they use various
> different class files from gb.form
> Also i've only supported dragging/dropping the text as text/plain.
> Not sure if it helps you?  You can see the code needed but you'll have to
> figure out how to import the Choosers into your own project.
>

Maybe Benoit could do something similar (but better coding of course ;) )
I do not trust my understanding of the Drag method and checking
Drag.Pending and exactly what to do.
I could need more/better handling than..







*Public Sub fvwChoose_MouseMove()  If Not $bDragFiles Then Return  If
Mouse.Left Then     If Drag.Pending Then Return
fvwChoose.Drag(GetPath(), "text/plain")  EndifEnd*

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220717/d2fef1bc/attachment.htm>


More information about the User mailing list