LCL, grids, fix Mac (carbon) keyboard navigation, issue #25249

git-svn-id: trunk@46512 -
This commit is contained in:
jesus 2014-10-11 07:23:01 +00:00
parent f50b3f0ecd
commit fa27e75356

View File

@ -6471,12 +6471,21 @@ begin
{$ifdef dbgGrid}DebugLnExit('grid.DoEditorHide [',Editor.ClassName,'] END');{$endif} {$ifdef dbgGrid}DebugLnExit('grid.DoEditorHide [',Editor.ClassName,'] END');{$endif}
end; end;
procedure TCustomGrid.DoEditorShow; procedure TCustomGrid.DoEditorShow;
var
ParentChanged: Boolean;
begin begin
//DebugLn(['TCustomGrid.DoEditorShow ']);
{$ifdef dbgGrid}DebugLnEnter('grid.DoEditorShow [',Editor.ClassName,'] INIT');{$endif} {$ifdef dbgGrid}DebugLnEnter('grid.DoEditorShow [',Editor.ClassName,'] INIT');{$endif}
ScrollToCell(FCol,FRow,true); ScrollToCell(FCol,FRow,true);
// Under carbon, Editor.Parent:=nil destroy Editor handle, but not immediately
// as in this case where keyboard event on editor is being handled.
// After Editor.Visible:=true, a new handle is allocated but it's got overwritten
// once the delayed destroying of previous handle happens, the result is a stalled
// unparented editor ....
ParentChanged := (Editor.Parent<>Self);
if ParentChanged then
Editor.Parent := nil; Editor.Parent := nil;
EditorSetValue; EditorSetValue;
if ParentChanged then
Editor.Parent:=Self; Editor.Parent:=Self;
Editor.Visible:=True; Editor.Visible:=True;
if Focused and Editor.CanFocus then if Focused and Editor.CanFocus then