Recent

Author Topic: SYnEdit lose cursor  (Read 209 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 593
SYnEdit lose cursor
« on: May 13, 2026, 03:31:46 am »
Hi i started to use synedit but when change to another form and lose the focus don't gat back the focus of cursor again... on pic you can on syna..c efect and other pic is the properties i setup..
Here code i used to gabe focus agai..

Code: Pascal  [Select][+][-]
  1. procedure TFormMain.DefaultDataHandler();
  2. var pos:Tpoint;
  3. begin
  4.    Pos.x:=0;
  5.   Pos.Y:=1;
  6.   DpSerial.OnRxData :=nil;
  7.   DpSerial.OnRxData := @dpSerialRxData;
  8.   MTerminal.ClearAll;
  9.   Mterminal.ExecuteCommand(ecEditorBottom, '',nil);
  10.   MTerminal.SelectionMode:=smNormal;
  11.   MTerminal.SetBookMark(0, 1, 1);
  12.   Mterminal.BlockBegin:= pos;
  13.   sleep(50);
  14.   DpSerial.WriteData(char(27));
  15.   MTerminal.SetFocus;
  16. end;
  17.  
  18.  

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: SYnEdit lose cursor
« Reply #1 on: May 21, 2026, 09:50:48 am »
IIRC BlockBegin does not set the caret (text cursor).  "BlockEnd" maybe...

The caret can be set with
SynEdit.CaretXY
SynEdit.LogigalCaretXY
https://wiki.lazarus.freepascal.org/SynEdit#Logical,_Physical_or_Viewed_caret_position


Not sure why you o ecEditorBottom? You can probably use
SynEdit.TopLine

eldonfsr

  • Hero Member
  • *****
  • Posts: 593
Re: SYnEdit lose cursor
« Reply #2 on: May 22, 2026, 09:14:14 pm »
That true logical was the problem

Thanks so much..


 

TinyPortal © 2005-2018