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 

Howto GotoXY vertical centered?

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



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Thu Dec 18, 2008 7:11 pm    Post subject: Howto GotoXY vertical centered? Reply with quote

Hi Michael,

i want to center the current line vertical in the visible area of the memo after a Memo.ExecCommand(smGotoXY, @p);

Any idea how ?

Greetings
Jens
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Fri Dec 19, 2008 10:17 am    Post subject: Reply with quote

Hi Jens,

Code below shows implementation using TSyntKeyMapping.OnExecuteCommand event:

Code:
procedure TSyntEditMain.SyntKeyMapping1ExecuteCommand(Sender: TObject;
  Command: Integer; Data: Pointer; var Handled: Boolean);
begin
  with TSyntaxMemo(Sender) do
    if Command = smGotoXY then
      begin
        CaretPos := PPoint(Data)^;
        ScrollCaret(CaretPos, saCenter, saNone);
      end;
end;


Michael..
Back to top
View user's profile Send private message Send e-mail
jfudickar



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Fri Dec 19, 2008 2:38 pm    Post subject: Reply with quote

Thanks Michael,

the scrollcaret was the trick.

Greetings
Jens
Back to top
View user's profile Send private message Visit poster's website
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