From 4aaaa6c59aa55df6d573a2903c2f54d9d5e766cb Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 8 Mar 2020 05:54:37 +0000 Subject: [PATCH] cooca: adding support for listview column text alignment git-svn-id: trunk@62711 - --- lcl/interfaces/cocoa/cocoawscomctrls.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/cocoa/cocoawscomctrls.pas b/lcl/interfaces/cocoa/cocoawscomctrls.pas index 66484a6e02..e19f7825b3 100644 --- a/lcl/interfaces/cocoa/cocoawscomctrls.pas +++ b/lcl/interfaces/cocoa/cocoawscomctrls.pas @@ -1127,8 +1127,17 @@ end; class procedure TCocoaWSCustomListView.ColumnSetAlignment( const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AAlignment: TAlignment); +var + lTableLV: TCocoaTableListView; + lNSColumn: NSTableColumn; +const + txtAlign : array[TAlignment] of NSTextAlignment = ( + NSLeftTextAlignment, NSRightTextAlignment, NSCenterTextAlignment + ); begin - inherited ColumnSetAlignment(ALV, AIndex, AColumn, AAlignment); + if not CheckColumnParams(lTableLV, lNSColumn, ALV, AIndex) then Exit; + NSCell(lNSColumn.headerCell).setAlignment( txtAlign[AAlignment] ); + NSCell(lNSColumn.dataCell).setAlignment( txtAlign[AAlignment] ); end; class procedure TCocoaWSCustomListView.ColumnSetAutoSize(