View previous topic :: View next topic |
Author |
Message |
jfudickar
Joined: 12 Jun 2006 Posts: 38 Location: Eschborn, Germany
|
Posted: Thu Dec 18, 2008 7:11 pm Post subject: Howto GotoXY vertical centered? |
|
|
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 |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Fri Dec 19, 2008 10:17 am Post subject: |
|
|
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 |
|
|
jfudickar
Joined: 12 Jun 2006 Posts: 38 Location: Eschborn, Germany
|
Posted: Fri Dec 19, 2008 2:38 pm Post subject: |
|
|
Thanks Michael,
the scrollcaret was the trick.
Greetings
Jens |
|
Back to top |
|
|
|