mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 21:59:14 +02:00
cocoa: introducing lclSetColumnAlign to allow set allignment for cell and view based tables
git-svn-id: trunk@62724 -
This commit is contained in:
parent
7d8ad4dd58
commit
cc3d447e35
@ -125,6 +125,7 @@ type
|
|||||||
function lclGetIconRect(ARow, ACol: Integer; const BoundsRect: TRect): TRect; message 'lclGetIconRect:::';
|
function lclGetIconRect(ARow, ACol: Integer; const BoundsRect: TRect): TRect; message 'lclGetIconRect:::';
|
||||||
|
|
||||||
procedure lclInsDelRow(Arow: Integer; inserted: Boolean); message 'lclInsDelRow::';
|
procedure lclInsDelRow(Arow: Integer; inserted: Boolean); message 'lclInsDelRow::';
|
||||||
|
procedure lclSetColumnAlign(acolumn: NSTableColumn; aalignment: NSTextAlignment); message 'lclSetColumn:Align:';
|
||||||
|
|
||||||
// NSTableViewDataSourceProtocol
|
// NSTableViewDataSourceProtocol
|
||||||
function numberOfRowsInTableView(tableView: NSTableView): NSInteger; message 'numberOfRowsInTableView:';
|
function numberOfRowsInTableView(tableView: NSTableView): NSInteger; message 'numberOfRowsInTableView:';
|
||||||
@ -201,6 +202,7 @@ type
|
|||||||
procedure tableView_setObjectValue_forTableColumn_row(tableView: NSTableView; object_: id; tableColumn: NSTableColumn; row: NSInteger); message 'tableView:setObjectValue:forTableColumn:row:';
|
procedure tableView_setObjectValue_forTableColumn_row(tableView: NSTableView; object_: id; tableColumn: NSTableColumn; row: NSInteger); message 'tableView:setObjectValue:forTableColumn:row:';
|
||||||
function tableView_dataCellForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: NSInteger): NSCell; message 'tableView:dataCellForTableColumn:row:';
|
function tableView_dataCellForTableColumn_row(tableView: NSTableView; tableColumn: NSTableColumn; row: NSInteger): NSCell; message 'tableView:dataCellForTableColumn:row:';
|
||||||
procedure lclInsDelRow(Arow: Integer; inserted: Boolean); override;
|
procedure lclInsDelRow(Arow: Integer; inserted: Boolean); override;
|
||||||
|
procedure lclSetColumnAlign(acolumn: NSTableColumn; aalignment: NSTextAlignment); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCellCocoaTableListView1013 = objcclass(TCellCocoaTableListView, NSTableViewDelegateProtocol, NSTableViewDataSourceProtocol)
|
TCellCocoaTableListView1013 = objcclass(TCellCocoaTableListView, NSTableViewDelegateProtocol, NSTableViewDataSourceProtocol)
|
||||||
@ -467,6 +469,12 @@ begin
|
|||||||
// as well as number of total items in the table should be marked as modified
|
// as well as number of total items in the table should be marked as modified
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaTableListView.lclSetColumnAlign(acolumn: NSTableColumn;
|
||||||
|
aalignment: NSTextAlignment);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TCocoaTableListView.acceptsFirstResponder: LCLObjCBoolean;
|
function TCocoaTableListView.acceptsFirstResponder: LCLObjCBoolean;
|
||||||
begin
|
begin
|
||||||
Result := NSViewCanFocus(Self);
|
Result := NSViewCanFocus(Self);
|
||||||
@ -946,6 +954,14 @@ begin
|
|||||||
noteNumberOfRowsChanged;
|
noteNumberOfRowsChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCellCocoaTableListView.lclSetColumnAlign(acolumn: NSTableColumn;
|
||||||
|
aalignment: NSTextAlignment);
|
||||||
|
begin
|
||||||
|
if not Assigned(acolumn) then Exit;
|
||||||
|
NSCell(acolumn.headerCell).setAlignment( aalignment );
|
||||||
|
NSCell(acolumn.dataCell).setAlignment( aalignment );
|
||||||
|
end;
|
||||||
|
|
||||||
function TCellCocoaTableListView.tableView_objectValueForTableColumn_row(
|
function TCellCocoaTableListView.tableView_objectValueForTableColumn_row(
|
||||||
tableView: NSTableView; tableColumn: NSTableColumn; row: NSInteger): id;
|
tableView: NSTableView; tableColumn: NSTableColumn; row: NSInteger): id;
|
||||||
var
|
var
|
||||||
|
@ -1136,8 +1136,7 @@ const
|
|||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
if not CheckColumnParams(lTableLV, lNSColumn, ALV, AIndex) then Exit;
|
if not CheckColumnParams(lTableLV, lNSColumn, ALV, AIndex) then Exit;
|
||||||
NSCell(lNSColumn.headerCell).setAlignment( txtAlign[AAlignment] );
|
lTableLV.lclSetColumnAlign(lNSColumn, txtAlign[AAlignment]);
|
||||||
NSCell(lNSColumn.dataCell).setAlignment( txtAlign[AAlignment] );
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCocoaWSCustomListView.ColumnSetAutoSize(
|
class procedure TCocoaWSCustomListView.ColumnSetAutoSize(
|
||||||
|
Loading…
Reference in New Issue
Block a user