EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cursor trapped in the first line

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
caymon



Joined: 14 Jan 2008
Posts: 2

PostPosted: Tue Apr 01, 2008 4:29 pm    Post subject: Cursor trapped in the first line Reply with quote

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
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue Apr 01, 2008 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
caymon



Joined: 14 Jan 2008
Posts: 2

PostPosted: Wed Apr 02, 2008 2:31 pm    Post subject: Reply with quote

Thank you!

Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
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