Cocoa: Fix #40680, the issue in TDbLookupCombobox with csDropDownList

This commit is contained in:
rich2014 2024-01-13 21:25:23 +08:00
parent 48b54337bc
commit 309603fa93

View File

@ -27,7 +27,7 @@ uses
// Libs // Libs
MacOSAll, CocoaAll, Classes, sysutils, MacOSAll, CocoaAll, Classes, sysutils,
// LCL // LCL
Controls, StdCtrls, Graphics, LCLType, LMessages, LCLProc, LCLMessageGlue, Forms, Controls, StdCtrls, ComboEx, Graphics, LCLType, LMessages, LCLProc, LCLMessageGlue, Forms,
// LazUtils // LazUtils
LazUTF8, TextStrings, LazUTF8, TextStrings,
// Widgetset // Widgetset
@ -1929,7 +1929,7 @@ begin
begin begin
rocmb := NSView(TCocoaReadOnlyComboBox.alloc).lclInitWithCreateParams(AParams); rocmb := NSView(TCocoaReadOnlyComboBox.alloc).lclInitWithCreateParams(AParams);
if not Assigned(rocmb) then Exit; if not Assigned(rocmb) then Exit;
rocmb.isComboBoxEx:= not (AWinControl is TComboBox); rocmb.isComboBoxEx:= AWinControl is TCustomComboBoxEx;
rocmb.list:=TCocoaReadOnlyComboBoxList.Create(rocmb); rocmb.list:=TCocoaReadOnlyComboBoxList.Create(rocmb);
rocmb.setTarget(rocmb); rocmb.setTarget(rocmb);
rocmb.setAction(objcselector('comboboxAction:')); rocmb.setAction(objcselector('comboboxAction:'));