Page 1 of 1

Slow paste. Is there a way to put an hourglass cursor ?

Posted: Wed Aug 23, 2017 7:26 pm
by gdemers_logilys
When I copy text from an outlook reply window (it looks like some kind of word editor embedded in outlook), it takes several seconds to paste it into my TRichViewEdit. It's way faster if I copy the same text from outlook while viewing original mail. (not in edit mode).

I don't mind the wait, but I would like to change the cursor to crHourGlass. I can change the cursor in the OnPaste event, but I don't know where to put my code to put it back to crDefault. Is there a way to do it ?

Have a nice day !

Re: Slow paste. Is there a way to put an hourglass cursor ?

Posted: Thu Aug 24, 2017 9:24 am
by Sergey Tkachenko

Code: Select all

procedure TForm3.RichViewEdit1Paste(Sender: TCustomRichViewEdit;
  var DoDefault: Boolean);
const
  Pasting: Boolean = False;
begin
  if Pasting then
    exit;
  Pasting := True;
  try
    Screen.Cursor := crHourGlass;
    Sender.Paste;
    Screen.Cursor := crDefault;
    DoDefault := False;
  finally
    Pasting := False;
  end;
end;
update: corrected, added assignment DoDefault := False