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 deactivate built-in shortcut CTRL+O?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

860 Posts

Posted - Mar 26 2021 :  04:23:33  Show Profile  Reply
Although the "Open File..." button is NOT VISIBLE on the ImageEnViewToolbar, the shortcut CTRL+O invokes the Open Dialog (and then loads the selected file in ImageEnView).

Is it possible to DEACTIVATE this built-in shortcut CTRL+O (because I provide my own method to load files controlled by my application)?

PeterPanino

860 Posts

Posted - Mar 26 2021 :  10:17:59  Show Profile  Reply
The same problem arises with the shortcut ALT+ENTER for invoking the Layer Properties dialog:

• I need to prevent the user from invoking the Layer Properties for the Background Layer

• The Layer Properties dialog should be invoked only for a SELECTED LAYER. Instead, the Layer Properties dialog is invoked with the shortcut ALT+ENTER even if no Layer is selected! In this case, it shows the properties of the previously selected Layer! (Which is totally intransparent).

So I need to disable the built-in shortcut ALT+ENTER, so I can control myself when and for what the Layer Properties dialog is invoked.


Go to Top of Page

PeterPanino

860 Posts

Posted - Mar 26 2021 :  12:49:32  Show Profile  Reply
This is VERY STRANGE: Now I have DEACTIVATED ImageEnView.LayerOptions.loKeyboardShortcuts which of course also deactivates the ALT+ENTER shortcut at run-time.

So I have assigned the ALT+ENTER shortcut to my own menu-item. But it does not work! When I press the ALT+ENTER keys the mouse cursor shakes a little bit - so this is a sign that it has an effect - but the menu-item handler with the ALT+ENTER shortcut is not triggered!

So I have deactivated LayerOptions.loKeyboardShortcuts and still something blocks my own ALT+ENTER shortcut!? What is going on here?
Go to Top of Page

PeterPanino

860 Posts

Posted - Mar 29 2021 :  18:58:30  Show Profile  Reply
As a workaround, I have created an Action with the ALT+ENTER shortcut. It seems that Action shortcuts OVERRIDE all other (e.g. menu) shortcuts. This allows me to do my own thing with ALT+ENTER.
Go to Top of Page

xequte

38180 Posts

Posted - Mar 30 2021 :  18:58:55  Show Profile  Reply
Hi Peter

In the upcoming update, keyboard shortcuts can be disabled for toolbars:

ImageEnViewToolbar1.KeyboardShortcuts := False;


Also, the state and execution of toolbar buttons/actions can be customized using new events:

procedure TMainForm.ImageEnViewToolbar1ActionExecute(Action: TBasicAction; var Handled: Boolean);
begin
  // override save handling
  if Action is TImageEnViewSave then
  begin
    SaveCurrentImage();
    Handled := True;
  end;
end;

procedure TMainForm.ImageEnViewToolbar1ActionUpdate(Action: TBasicAction; var Handled: Boolean);
begin
  // Disable opening once we have a valid image
  if Action is TImageEnViewPromptToOpen then
  begin
    TImageEnViewPromptToOpen(Action).Enabled := ImageEnView1.IsEmpty2;
    Handled := True;
  end;
end;


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

PeterPanino

860 Posts

Posted - Mar 31 2021 :  14:47:57  Show Profile  Reply
Hi Nigel,

this is very good news. Thank you for your excellent work!

When will the update be available?
Go to Top of Page

xequte

38180 Posts

Posted - Mar 31 2021 :  16:53:23  Show Profile  Reply
Mid April or so.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: