|
EControl Ltd. VCL libraries and software support forum
|
View previous topic :: View next topic |
Author |
Message |
caymon
Joined: 14 Jan 2008 Posts: 2
|
Posted: Tue Apr 01, 2008 4:29 pm Post subject: Cursor trapped in the first line |
|
|
Hello,
I have an empty SyntMemo and I fill it dynamically using this code:
procedure TFrameLogEditor.AddLine(const s: string);
begin
SyntMemo.Lines.Add(s);
SyntMemo.ScrollText(0, SyntMemo.Lines.Count-SyntMemo.VisibleLines, 0);
end {TFrameLogEditor.AddLine};
or this code:
procedure TFrameLogEditor.AddLines(L: TStringList; MaxBufferSize : integer);
begin
SyntMemo.Lines.AddStrings(L);
SyntMemo.ScrollText(0, SyntMemo.Lines.Count-SyntMemo.VisibleLines, 0);
end {TFrameLogEditor.AddLines};
After this, the cursor is like trapped in the first line. For example, if I try to select some text using the mouse, only the first line get selected, the cursor moves in the first line but stay trapped in this line. A click on the vertical scroll-bar, unlocks the cursor which then behaves as expected. Any idea?
regards
Chris |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue Apr 01, 2008 6:36 pm Post subject: |
|
|
Hello,
Fix (ecSyntMemo.pas):
Code: | function TCustomSyntaxMemo.ScrollText(XScrollPos, YScrollPos,
YSubLine: integer): Boolean;
var XAmount, Y1, Y2, i: integer;
R: TRect;
begin
if YScrollPos < 0 then YScrollPos := 0; // <==
Result := False;
.... |
Michael. |
|
Back to top |
|
|
caymon
Joined: 14 Jan 2008 Posts: 2
|
Posted: Wed Apr 02, 2008 2:31 pm Post subject: |
|
|
Thank you!
Chris |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|