mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 14:27:41 +01:00
Cocoa: fix the issue that item state not set before TListView.OnChange() calling, issue #41151
This commit is contained in:
parent
45b079d896
commit
4696c84166
@ -98,7 +98,6 @@ type
|
||||
function isInitializing( tv: NSTableView ): Boolean; virtual; abstract;
|
||||
function getLCLControlCanvas( tv:NSTableView ): TCanvas; virtual; abstract;
|
||||
procedure onReloadData( tv: NSTableView ); virtual; abstract;
|
||||
procedure onSelectOneItem( tv: NSTableView; selection: NSIndexSet ); virtual; abstract;
|
||||
procedure onSelectionChanged( tv: NSTableView ); virtual; abstract;
|
||||
procedure onOwnerDrawItem( rowView: NSView ); virtual abstract;
|
||||
end;
|
||||
@ -110,7 +109,6 @@ type
|
||||
function getCallback( tv: NSTableView ): TLCLListControlCallback;
|
||||
public
|
||||
procedure onReloadData( tv: NSTableView ); override;
|
||||
procedure onSelectOneItem( tv: NSTableView; selection: NSIndexSet ); override;
|
||||
procedure onOwnerDrawItem( rowView: NSView ); override;
|
||||
end;
|
||||
|
||||
@ -216,19 +214,6 @@ begin
|
||||
ObjcSelector('restoreFromStableSelection'), nil, 0 );
|
||||
end;
|
||||
|
||||
procedure TCocoaTableListControlProcessor.onSelectOneItem(tv: NSTableView;
|
||||
selection: NSIndexSet);
|
||||
var
|
||||
lclcb: TLCLListControlCallback;
|
||||
begin
|
||||
lclcb:= self.getCallback(tv);
|
||||
if NOT Assigned(lclcb) then
|
||||
Exit;
|
||||
|
||||
lclcb.selectionIndexSet.removeAllIndexes;
|
||||
lclcb.selectionIndexSet.addIndexes( selection );
|
||||
end;
|
||||
|
||||
procedure TCocoaTableListControlProcessor.onOwnerDrawItem( rowView: NSView );
|
||||
begin
|
||||
hideAllSubviews( rowView );
|
||||
|
||||
@ -713,9 +713,7 @@ begin
|
||||
end;
|
||||
|
||||
if NOT selection.isEqualToIndexSet(self.selectedRowIndexes) then begin
|
||||
self.selectRowIndexesByProgram( selection );
|
||||
if Assigned(_processor) then
|
||||
_processor.onSelectOneItem( self, selection );
|
||||
self.selectRowIndexes_byExtendingSelection( selection, False );
|
||||
end;
|
||||
|
||||
selection.release;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user