From ea61d1502b8a221dad9790576981166366c9730c Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Fri, 23 Dec 2016 19:37:49 +0000 Subject: [PATCH] carbon: Patch 30497Fix TListBox.ItemHeight git-svn-id: trunk@53770 - --- lcl/interfaces/carbon/carbonlistviews.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/carbon/carbonlistviews.pp b/lcl/interfaces/carbon/carbonlistviews.pp index 54e66f1792..f1a789eaf9 100644 --- a/lcl/interfaces/carbon/carbonlistviews.pp +++ b/lcl/interfaces/carbon/carbonlistviews.pp @@ -273,6 +273,7 @@ type procedure DrawItem(AIndex: Integer; AState: DataBrowserItemState); override; procedure SelectionChanged(AIndex: Integer; ASelect: Boolean); override; procedure FocusedChanged({%H-}AIndex: Integer); override; + procedure SetFont(const AFont: TFont); override; end; { TCarbonCheckListBox } @@ -1944,7 +1945,8 @@ begin ShowColumnHeaders(False); ShowCheckboxes(False); ShowAsList(True); - SetItemsHeight((LCLObject as TCustomListBox).ItemHeight); + if (LCLObject as TCustomListBox).Style = lbOwnerDrawFixed then + SetItemsHeight((LCLObject as TCustomListBox).ItemHeight); SetRowSelect(True); SetScrollBars(ssAutoVertical); SetSelectionMode((LCLObject as TCustomListBox).ExtendedSelect, @@ -2011,6 +2013,13 @@ begin LCLSendSelectionChangedMsg(LCLObject); end; +procedure TCarbonListBox.SetFont(const AFont: TFont); +begin + inherited SetFont(AFont); + if (LCLObject as TCustomListBox).Style = lbOwnerDrawFixed then + SetItemsHeight((LCLObject as TCustomListBox).ItemHeight); +end; + { TCarbonCheckListBox } procedure TCarbonCheckListBox.CreateWidget(const AParams: TCreateParams);