Recent

Author Topic: Drag and Drop text in TMemo will loss data.  (Read 4828 times)

tomitomy

  • Sr. Member
  • ****
  • Posts: 251
Drag and Drop text in TMemo will loss data.
« on: October 29, 2017, 04:45:31 am »
Hi, I put some text in the TMemo, and then select some text then drag and drop, repeat this operation, and then the data will be loss.

Test Code:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Memo1Change(Sender: TObject);
  2. begin
  3.   Caption := IntToStr(Length(Memo1.Text));
  4. end;

There is another problem, when I drag and drop the text, I can not get the current SelStart in the OnChange event.

Test Code:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Memo1Change(Sender: TObject);
  2. begin
  3.   writeln(Format('%d, %d   %s', [Memo1.SelStart, Memo1.SelLength, Memo1.SelText]));
  4. end;

Lazarus 1.8.0RC4 GTK2
OS: Linux Mint MATE 64-bit
« Last Edit: October 31, 2017, 02:46:24 am by tomitomy »

tomitomy

  • Sr. Member
  • ****
  • Posts: 251
Re: Drag and Drop text in TMemo will loss data.
« Reply #1 on: October 31, 2017, 02:55:43 am »
Are these bugs? Or the GTK2 problem? Do I need to report to the bugtracker forum?

Can someone help me? I hope that the second problem can be fixed, so that my Undo/Redo code can work properly.

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Drag and Drop text in TMemo will loss data.
« Reply #2 on: October 31, 2017, 09:10:49 am »
It looks like a bug in gtk2

tomitomy

  • Sr. Member
  • ****
  • Posts: 251
Re: Drag and Drop text in TMemo will loss data.
« Reply #3 on: October 31, 2017, 12:11:40 pm »
It looks like a bug in gtk2

Oh, that's too bad. Thank you for your help, Zeljko.

 

TinyPortal © 2005-2018