- fix GetParent - return parent windows too (forms), not only parent controls
 - if control is disabled then perform mouse action from first non-disabled control parent (fixes issue #0017856)

git-svn-id: trunk@28613 -
This commit is contained in:
paul 2010-12-03 17:56:59 +00:00
parent 98d8c393c9
commit dacbb79dc4
2 changed files with 7 additions and 2 deletions

View File

@ -285,6 +285,8 @@ begin
if Control = nil then Exit;
Widget := GetCarbonWidget(Control);
while Assigned(Widget) and not Widget.IsEnabled do
Widget := TCarbonWidget(CarbonWidgetset.GetParent(HWND(Widget)));
if Widget = nil then Exit;
FillChar(Msg, SizeOf(Msg), 0);

View File

@ -1768,8 +1768,11 @@ begin
if not CheckWidget(Handle, 'GetParent') then Exit;
if TCarbonWidget(Handle) is TCarbonControl then
Result :=
HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
begin
Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
if Result = 0 then // no parent control => then parent is a window?
Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
end;
// Carbon windows has no parent
{$IFDEF VerboseWinAPI}