[Gambas-user] Filling a text area with a Text file using drag and drop...

BB adamnt42 at gmail.com
Thu Oct 12 07:10:28 CEST 2023


On 12/10/23 3:24 pm, BB wrote:
>
> On 12/10/23 2:18 pm, Denis Crowther wrote:
>> On 10/12/23 10:00, sbungay wrote:
>>>    If a text file is dragged from a file manager to a text area, the 
>>> drop event of the text area is not raised. Why is that and can it be 
>>> changed?
>>
>> Works here.
>>
>> Did you set: Drop = True in the IDE or code?
>>
> Yes, it appears that the form designer Drop property is not set or 
> saved (in the IDE) so it has to be set via code.
>
> To be more explicit, the IDE default value for the Drop property is 
> true, so when the form is saved, this is not output to the .form file. 
> Since the property is just a boolean, when the form is loaded at 
> runtime that property is not set thus it is false. This is a bug.
>
> b
>
>
Someone with bugtracker access could raise that so Benoit sees it.

-----------

So perhaps the answer to Stephen's question is "You must set the 
TextArea.Drop property in code, viz

' Gambas class file

Public Sub Form_Open()

   TextArea1.Drop = True

End

Public Sub TextArea1_Drop()
   
   TextArea1.Text = File.Load(Drag.Paste("text/uri-list")[0])

End

b

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231012/7c069724/attachment-0001.htm>


More information about the User mailing list