How to avoid the "Open IME" popup in a StringGrid?

delphi, ime

Solution

You can override the virtual `CreateEditor` method like this way (not a good solution though, I know :-):

type
  TStringGrid = class(Grids.TStringGrid)
  protected
    function CreateEditor: TInplaceEdit; override;
  end;

implementation

function TStringGrid.CreateEditor: TInplaceEdit;
begin
  Result := inherited CreateEditor;
  TMaskEdit(Result).PopupMenu := Form1.PopupMenu1;
end;

Problem

In a StringGrid, sometimes I get the unwanted menu below when I right-click. Is this a Windows popup? How to I prevent this popup from appearing rather than my own? I have goAlwaysShowEditor in my Options. I have set StringGrid.PopupMenu to my popup. I've set StringGrid.OnMouseDown to show my popup if it's a right click.

Original source