diff --git a/Parnassus.FMXContainer.pas b/Parnassus.FMXContainer.pas index 9cc9b40..02c4ade 100644 --- a/Parnassus.FMXContainer.pas +++ b/Parnassus.FMXContainer.pas @@ -58,6 +58,7 @@ TFireMonkeyContainer = class(TWinControl) FOnDestroyForm : TOnDestroyFMXFormEvent; FCreateFormCalled : Boolean; FHandlingFMXActivation : Boolean; + FAllowTabKey : Boolean; procedure DoOnCreate; procedure DoOnDestroy; @@ -98,6 +99,7 @@ TFireMonkeyContainer = class(TWinControl) property FireMonkeyFormHandle : HWND read GetHostedFMXFormWindowHandle; property OnCreateFMXForm : TOnCreateFMXFormEvent read FOnCreateForm write FOnCreateForm; property OnDestroyFMXForm : TOnDestroyFMXFormEvent read FOnDestroyForm write FOnDestroyForm; + property AllowTabKey: Boolean read FAllowTabKey write FAllowTabKey default False; property Align; property Anchors; property Constraints; @@ -232,6 +234,7 @@ constructor TFireMonkeyContainer.Create(Owner: TComponent); FNewFMXWndProc := nil; FCreateFormCalled := false; FHandlingFMXActivation := false; + FAllowTabKey := False; //if true Tab is handled inside the FMX form TabStop := true; // Want to be focused on tabs end; @@ -674,6 +677,8 @@ procedure TFireMonkeyContainer.WMGetDlgCode(var Msg: TMessage); begin // From http://stackoverflow.com/questions/5632411/arrow-key-not-working-in-component Msg.Result := DLGC_WANTALLKEYS or DLGC_WANTARROWS or DLGC_WANTCHARS; + if FAllowTabKey then + Msg.Result := Msg.Result or DLGC_WANTTAB; //handle Tabs if Msg.lParam <> 0 then begin M := PMsg(Msg.lParam);