[Lazarus] Memo for touchscreen
Koenraad Lelong
lazarus2 at de-brouwerij.be
Mon Aug 26 21:33:05 CEST 2013
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
More information about the Lazarus
mailing list