LCL/TCheckComboBox: Workaround for issues #39424 and #39427

This commit is contained in:
wp_xyz 2021-10-16 17:45:40 +02:00
parent ad741a8d7a
commit d6a9516c11

View File

@ -359,7 +359,8 @@ begin { do not call inherited ! }
aDropped:=DroppedDown; aDropped:=DroppedDown;
aEnabled:=IsEnabled; aEnabled:=IsEnabled;
aMainItem:= (ARect.Left>0); aMainItem:= (ARect.Left>0);
{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)} // {$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)}
{$IF DEFINED(MSWindows) or DEFINED(Darwin)}
aFocusedEditableMainItemNoDD := (Focused and aMainItem and not aDropped); aFocusedEditableMainItemNoDD := (Focused and aMainItem and not aDropped);
{$ELSE} {$ELSE}
aFocusedEditableMainItemNoDD := False; aFocusedEditableMainItemNoDD := False;
@ -608,7 +609,8 @@ begin { do not call inherited ! }
aEnabled:=IsEnabled; aEnabled:=IsEnabled;
if not (csDesigning in ComponentState) then if not (csDesigning in ComponentState) then
aEnabled:= (aEnabled and ItemState.Enabled); aEnabled:= (aEnabled and ItemState.Enabled);
{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)} // {$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)}
{$IF DEFINED(MSWindows) or DEFINED(Darwin))}
aFocusedEditableMainItemNoDD := (Focused and (ARect.Left>0) and not aDropped); aFocusedEditableMainItemNoDD := (Focused and (ARect.Left>0) and not aDropped);
{$ELSE} {$ELSE}
aFocusedEditableMainItemNoDD := False; aFocusedEditableMainItemNoDD := False;
@ -686,13 +688,15 @@ begin { do not call inherited ! }
end; end;
procedure TCustomCheckCombo.DropDown; procedure TCustomCheckCombo.DropDown;
{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)} //{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)}
{$IF DEFINED(MSWindows) or DEFINED(Darwin)}
{$ELSE} {$ELSE}
var aCursorPos: TPoint; var aCursorPos: TPoint;
aRect: TRect; aRect: TRect;
{$ENDIF} {$ENDIF}
begin begin
{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)} // {$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)}
{$IF DEFINED(MSWindows) or DEFINED(Darwin)}
FRejectDropDown:=False; FRejectDropDown:=False;
{$ELSE} {$ELSE}
aCursorPos:=ScreenToControl(Mouse.CursorPos); aCursorPos:=ScreenToControl(Mouse.CursorPos);
@ -800,7 +804,8 @@ end;
procedure TCustomCheckCombo.Select; procedure TCustomCheckCombo.Select;
begin begin
inherited Select; inherited Select;
{$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)} // {$IF DEFINED(LCLWin32) or DEFINED(LCLWin64)}
{$IF DEFINED(MSWindows)} // no DEFINED(Darwin) here!
if DroppedDown then FRejectToggleOnSelect:=True; if DroppedDown then FRejectToggleOnSelect:=True;
{$ENDIF} {$ENDIF}
if not FRejectToggleOnSelect then if not FRejectToggleOnSelect then