This may work cross platform wise, I can't say but anyways, this will reject a copy paste operation. It may look and feel like its taking place but it gets rejected..
Also you can replace the popup menu for the edit with a dummy one, that way the system's menu does not come up either..
I can't say if this works well in Lazarus across the board but it something I've done in Delphi...
You need to set the variable to TRUE to reject the operation... otherwise it behaves normally..
This only works per unit/Form page.. of course..
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Windows,Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TEDIT = Class(stdCtrls.TEDIT)
procedure HandlePaste(Var Msg:TMessage); Message WM_Paste;
procedure HandleCopy(Var Msg:TMessage); Message WM_Copy;
Public
RejectClipBoardOperations:Boolean;
end;
TForm1 = class(TForm)
Edit1: TEdit;
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
Procedure TEdit.HandleCopy(Var msg:TMessage);
Begin
if rejectClipBoardOperations Then
Msg.Result := 1 else Inherited;
end;
Procedure TEdit.HandlePaste(Var Msg:TMessage);
Begin
If rejectClipboardOperations Then
Msg.Result := 1 Else Inherited;
end;
end.
Don't forget to set the variable at runtime somewhere on the EDITS you want this behavior..