mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 04:39:24 +02:00
Cocoa: Fix ItemIndex issue of TComboBox with csDropDownList at init
This commit is contained in:
parent
6aab479152
commit
7d22dc8d27
@ -489,6 +489,10 @@ begin
|
|||||||
end else
|
end else
|
||||||
FOwner.insertItemWithTitle_atIndex(astr, Index);
|
FOwner.insertItemWithTitle_atIndex(astr, Index);
|
||||||
|
|
||||||
|
// ItemIndex may be changed in addItemWithTitle() / insertItemWithTitle_atIndex()
|
||||||
|
// keep compatibility with LCL by resetting ItemIndex
|
||||||
|
FOwner.selectItemAtIndex(FOwner.lastSelectedItemIndex);
|
||||||
|
|
||||||
mn := FOwner.itemAtIndex(Index);
|
mn := FOwner.itemAtIndex(Index);
|
||||||
if not Assigned(mn) then Exit;
|
if not Assigned(mn) then Exit;
|
||||||
|
|
||||||
@ -1589,7 +1593,7 @@ begin
|
|||||||
if Assigned(selectedItem) then
|
if Assigned(selectedItem) then
|
||||||
Result:=selectedItem.title
|
Result:=selectedItem.title
|
||||||
else
|
else
|
||||||
Result:=inherited stringValue;
|
Result:=NSString.string_;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaReadOnlyComboBox.drawRect(dirtyRect: NSRect);
|
procedure TCocoaReadOnlyComboBox.drawRect(dirtyRect: NSRect);
|
||||||
|
Loading…
Reference in New Issue
Block a user