diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index b6d4c4ab75..48d5618770 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -1094,7 +1094,8 @@ Begin if not ((AWinControl = nil) or (AWinControl <> Self) and (GetParentForm(AWinControl) = Self) - and ((csLoading in ComponentState) or AWinControl.CanFocus)) + and ((csLoading in ComponentState) or not (Visible and Enabled) + or AWinControl.CanFocus)) then RaiseGDBException(SCannotFocus); // EInvalidOperation.Create(SCannotFocus); @@ -1827,6 +1828,9 @@ end; { ============================================================================= $Log$ + Revision 1.170 2005/01/04 11:26:26 micha + let canfocus imply that setfocus can be called + Revision 1.169 2004/12/27 00:06:44 mattias added DestroyHandle after ShowModal to save resources diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index b1a826f998..f86b8c9ec7 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -736,11 +736,11 @@ begin if Form <> nil then begin Control := Self; - while Control <> Form do - begin + repeat if not (Control.FVisible and Control.Enabled) then Exit; + if Control = Form then break; Control := Control.Parent; - end; + until false; Result := True; end; end; @@ -4232,6 +4232,9 @@ end; { ============================================================================= $Log$ + Revision 1.295 2005/01/04 11:26:26 micha + let canfocus imply that setfocus can be called + Revision 1.294 2005/01/03 22:44:31 mattias implemented TControl.AnchorSide