Hello,
caret is not shown after pressing "pGoToLineClick".
Background:
if have selected a memo-line and put it's y-pos into a variable named "rveYpos" (pMarkYposClick).
Now I scroll in memo and after a time I want to go back to the position of "rveYpos" (pGoToPosClick).
All runs fine. Only caret (Schreibmarke) is hidden.
What's to do to show caret ?
After clicking into memo caret appears (where mouse-cursor hit memo).
Jürgen
Private
rveYpos: integer;
...
procedure TForm1.pMarkYposClick(Sender: TObject);
var x: integer;
begin
rve.GetItemCoords(rve.CurItemNo,x,rveYpos);
end;
procedure TForm1.pGoToPosClick(Sender: TObject);
begin
rve.scrollTo(rveYpos);
//rve.Reformat;
rve.setfocus; //caret doesn't appear
end;
cursor is hidden after using rve.scrollTo
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks.Sergey Tkachenko wrote:ScrollTo just scrolls the editor's window to the specified scrollbar position.
The caret is still in the same location as before, and if this is location becomes invisible, the caret becomes invisible too.
You need to deside what do you want to change - the caret location of vertical position.
I can jump to each line (problem font.size or number of lines of a paragraph), but not to the line near a wanted memo-y-position)
I have a database rve-memo and have to write a topic always to the same place of each memo (perhaps I change font.size or number of lines of a paragraph or I change memo and have to write a topic at the same position ... .
"rve.GetItemCoords(rve.CurItemNo,x,rveYpos)" tells me y-position of wanted place (for a topic)
By clicking a button I jump to "rveYpos" whether font.size or number of lines of a paragraph have changed in meantime.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Do you want to move caret to the specified Y position?
Code: Select all
var RVData:TCustomRVFormattedData;
ItemNo, OffsetInItem: Integer;
rv.GetItemAt(0, Y, RVData, ItemNo, OffsetInItem, False);
RVData := TCustomRVFormattedData(RVData.Edit);
RVData.SetSelectionBounds(ItemNo, OffsetInItem, ItemNo, OffsetInItem);
Thanks. That is it.Sergey Tkachenko wrote:Do you want to move caret to the specified Y position?
Code: Select all
var RVData:TCustomRVFormattedData; ItemNo, OffsetInItem: Integer; rv.GetItemAt(0, Y, RVData, ItemNo, OffsetInItem, False); RVData := TCustomRVFormattedData(RVData.Edit); RVData.SetSelectionBounds(ItemNo, OffsetInItem, ItemNo, OffsetInItem);
For these few lines I try many hours ....