ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to disable CTRL+C only in a specific TImageEnView?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

914 Posts

Posted - Feb 28 2024 :  11:50:49  Show Profile  Reply
It seems that disabling CTRL+C for Clipboard Copy in TImageEnView is possible only globally:

IEGlobalSettings().KeyboardShortcuts[iesCopy] := 0;


But I have several TImageEnView in my application on different forms, and I want to disable CTRL+C only in one of them; how can I do that?

A KeyDown event handler does not disable CTRL+C in TImageEnView:

procedure TformPreview.ImageEnViewPreviewKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if (Shift = [ssCtrl]) then 
  begin
    case Key of
      VK_C:
        begin
          CodeSite.Send('TformPreview.ImageEnViewPreviewKeyDown: ');
        end;
    end;
  end;
end;

xequte

38458 Posts

Posted - Feb 28 2024 :  14:18:18  Show Profile  Reply
Hi Peter

This works in my testing to disable Copy for a particular TImageEnView:

procedure TMainForm.ImageEnView1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ( Shift = [ssCtrl]) and (Key = VK_C ) then
    Key := 0;
end;


Otherwise, you can disable shortcuts for a specific TImageEnView by removing loKeyboardShortcuts from LayerOptions:

https://www.imageen.com/help/TImageEnView.LayerOptions.html



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

914 Posts

Posted - Feb 29 2024 :  10:43:29  Show Profile  Reply
Hi Nigel

Thanks, this helps.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: