Recent

Author Topic: TMemo SelText problems (again?) in Linux  (Read 1406 times)

fedkad

  • Full Member
  • ***
  • Posts: 176
TMemo SelText problems (again?) in Linux
« on: February 25, 2018, 12:38:50 pm »
Well, I am currently on latest trunk of Lazarus (1.9.0) / Linux: SVN 57370.

(The problem reported for 1.8.0 at https://bugs.freepascal.org/view.php?id=32583 looks solved.)

However, this time another problem has (re-)appeared. On an empty new form, drop a memo and a button, and run the following code:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   with Memo1 do
  4.   begin
  5.     Text := '1234<>7890';
  6.     SelStart := 5;
  7.     SelLength := 0;
  8.     SelText := 'abce';
  9.     SetFocus;
  10.   end;
  11. end;

It works as expected. However, when you replace the statement containing SelText with the following:

Code: Pascal  [Select][+][-]
  1.     SelText := 'aöçe';

it doesn't.

The following code works in 1.8.0:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   with MemoTest do
  4.   begin
  5.     Text := '1234<>7890';
  6.     SelStart := 5;
  7.     SelLength := 0;
  8.     {$ifdef Linux}
  9.     //Bug: https://bugs.freepascal.org/view.php?id=32583
  10.     Application.ProcessMessages;
  11.     {$endif}
  12.     SelText := 'aöçe';
  13.     SetFocus;
  14.   end;
  15. end;
   

It seems that some Unicode stuff is messed up!
« Last Edit: February 25, 2018, 04:04:30 pm by fedkad »
Lazarus 2.2.6 / FPC 3.2.2 on x86_64-linux-gtk2 (Ubuntu/GNOME) and x86_64-win64-win32/win64 (Windows 11)

fedkad

  • Full Member
  • ***
  • Posts: 176
Lazarus 2.2.6 / FPC 3.2.2 on x86_64-linux-gtk2 (Ubuntu/GNOME) and x86_64-win64-win32/win64 (Windows 11)

 

TinyPortal © 2005-2018