Jump to content

Pamen

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by Pamen

  1. Hi, I'm quite new to Delphi (12.2, FMX) so maybe I'm just missing some explanations. I have a FMX application with a main window and main menu (I see the issue on Windows 32/64 bit). The application shows other child windows and independent non-modal windows. When a shortcut is pressed in any active window and the shortcut is not directly handled by the child window, main window "intercepts" the shortcut. The event fires before any private code is executed and main window gets activated, child deactivated. This makes the whole application unusable, which is a pity after some 100K of lines of code....
  2. OK, found myself. Sometimes it is good to wait for someone surely more competent to help and not get an answer 🙂 Main form needs a subclasses TMenuItem, which nullifies the event, if the form is not active. Basically a variation of this, one also needs to typecast some references to FMX.Menus.TMenuItem for this not to throw compiler errors type TMenuItem = class(FMX.Menus.TMenuItem) protected procedure DialogKey(var Key: Word; Shift: TShiftState); override; end; procedure TMenuItem.DialogKey(var Key: Word; Shift: TShiftState); begin if MainForm.Active = false then exit; // MainForm must be declared and initialized in TForm.OnCreate or so inherited; end;
×