Op 18-07-13 21:24, Malcolm Poole schreef:
 //============================================================

procedure TForm1.LetterAButtonClick ( Sender: TObject ) ;
var
   testcaretpos: Integer;
begin
   testcaretpos := Memo1.SelStart;
   Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + 'A'
     + Copy(Memo1.Text, testcaretpos+1, MaxInt);
   Inc(testcaretpos);
   Memo1.SelStart := testcaretpos;
   Memo1.SetFocus;
end;

Hi Malcolm,

I made a few testprograms that work fine with your code. Now I made a full keyboard (Belgian AZERTY) and I'm having a problem I can't solve.

The keyboard has some "special" characters : é§èçà and others. Those are not 1 byte characters. When I add them, they appear in the memo, but the next character seems to erase the memo. If I have already some lines in it, all disappears and the cursor is on the first line, fully left.
I add the characters with a string :

Kars:='§';
Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + Kars + Copy(Memo1.Text, testcaretpos+1, MaxInt);

Actually, I do this in a procedure with Kars as a parameter.

Any suggestions where to look ?

BTW, I tried this on Lazarus 1.0 on Linux.

Thanks,

Koenraad Lelong


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to