Modify Cursor

General TRichView support forum. Please post your questions here
Post Reply
show00
Posts: 11
Joined: Sun Aug 10, 2014 1:13 pm

Modify Cursor

Post by show00 »

when i modify Cursor in OnMouseMove,but the Cursor not change
i must call Format() ?
show00
Posts: 11
Joined: Sun Aug 10, 2014 1:13 pm

Post by show00 »

i can't use GetItemCursor,beacuse i do something in OnPaint,i want use PtInRect to change the cursor
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you need to change cursor inside or outside items?
show00
Posts: 11
Joined: Sun Aug 10, 2014 1:13 pm

Post by show00 »

No items,I draw some areas in OnPaint
when the mouse into different areas ,i want change different curosr

OnMouseMove:
TPoint ptCursor;
GetCursorPos(&ptCursor);
ptCursor = ScreenToClient(ptCursor);
if(pRVESystemBar->PtInSystemBar(Handle,ptCursor))//call PtInRect
{

Cursor = crHandPoint;
}
else
{
Cursor = crDefault;
}

but the cursor not change
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I made a small test:

Code: Select all

procedure TForm3.RichViewEdit1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if X<20 then
    RichViewEdit1.Cursor := crHelp
  else
    RichViewEdit1.Cursor := crIBeam;
end;
The cursor is changed as expected, when the mouse is close to the left border.
show00
Posts: 11
Joined: Sun Aug 10, 2014 1:13 pm

Post by show00 »

my class InheritsFrom TRichViewEdit,i overwrite the OnMouseMove...
Post Reply