Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-03

Arrow keys casue my control to lose focus

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

I am porting some controls for my Cross Codebot library, and one of them is a generic grid type control. The problem is on Ubuntu with Gtk pressing the arrows keys causes my grid to lose focus, even though I am handling WMGetDlgCode.

Here is brief video of the problem:

https://www.youtube.com/watch?v=COpz4Sia1fY

And the relevent code:

procedure WMGetDlgCode(var Msg: TWMGetDlgCode); message WM_GETDLGCODE;
procedure TContentGrid.WMGetDlgCode(var Msg: TWMGetDlgCode);
begin
  inherited;
  Msg.Result := DLGC_WANTARROWS or DLGC_WANTCHARS or DLGC_WANTALLKEYS;
end;

Yet focus is still lose when my grid is focused and an arrow key is pressed. Does anyone know how to stop focus from leaving under the conditions I've outlined?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150306/7902e318/attachment.html>

Reply by email