Recent

Author Topic: Droping text file into DBMemo not taken as an "edit".  (Read 4098 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Droping text file into DBMemo not taken as an "edit".
« on: August 19, 2012, 04:24:14 am »
When I drop a text file into a DBMemo, I set at the code for it a DBMemo1.SetFocus.

When I exit the DBMemo by mouse, the text is lost, as if editing had not taken place.

My work around is to type a space over any space of the dropped text, then the text becomes "edited" and the rest is fine.

I'd say, though, that dropping text by dropping a file should be consider as any other editing.

Hope this, if verified, be addressed by the team.

NOTE: SetFocus or not, makes no difference. Clicking on the loaded text of the memo is no edit, of course. But since the memo field was empty, to begin with, this should be an "edit".

Thanks.
« Last Edit: August 19, 2012, 05:42:25 am by Elmug »

geno

  • Full Member
  • ***
  • Posts: 198
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #1 on: August 19, 2012, 05:29:53 pm »
after dropping the text, try setting

  dbMemo1.Modified := True;

<I haven't tested it myself, yet>
version:      Lazarus 1.9   FPC 3.0.4
   
widget set:  x-86_64-linux-gtk 2
OS:             ArchLinux/ Xfce 4.12

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #2 on: August 19, 2012, 07:30:25 pm »
after dropping the text, try setting

  dbMemo1.Modified := True;

<I haven't tested it myself, yet>

Good tip, Geno.

I'll try it out.

Thanks.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #3 on: August 20, 2012, 03:57:30 am »
Geno,

Sorry I could not get this to work.

There's also something I noticed: Dropping a file into the DBMemo box does not give the focus to my application. The focus still remains in the Windows' folder window.

So, even if I give focus to the DBMemo box, I still have to click into it to do the redundant editing mentioned above.

I think dropping a file to the application should bring the focus to the application.


MacWomble

  • Jr. Member
  • **
  • Posts: 79
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #4 on: August 13, 2018, 07:25:02 pm »
Is there a solution for this issue? I got the same problem when inserting from clipboard.
Mint 19.3 Cinnamon, FPC/ Lazarus Trunk 64Bit

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #5 on: August 13, 2018, 10:11:19 pm »
In the control's OnDragOver event set the focus and the edit mode. You can also possibly set it in the OnDropFiles event.
Specialize a type, not a var.

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: Droping text file into DBMemo not taken as an "edit".
« Reply #6 on: August 13, 2018, 10:12:54 pm »
after dropping the text, try setting

  dbMemo1.Modified := True;

<I haven't tested it myself, yet>

*before* dropping... you were close!
Specialize a type, not a var.

 

TinyPortal © 2005-2018