Cocoa/ListView: fix the issue about Keys with vsIcon Style

This commit is contained in:
rich2014 2024-07-16 21:46:57 +08:00
parent e6562d82ea
commit 9304668b9d
2 changed files with 17 additions and 0 deletions

View File

@ -42,6 +42,7 @@ type
callback: TLCLListViewCallback;
function lclGetCallback: ICommonCallback; override;
procedure lclClearCallback; override;
procedure lclExpectedKeys(var wantTabs, wantKeys, wantReturn, wantAllKeys: Boolean); override;
procedure backend_setCallback( cb: TLCLListViewCallback );
procedure backend_reloadData;
@ -203,6 +204,16 @@ begin
callback:= nil;
end;
procedure TCocoaCollectionView.lclExpectedKeys(var wantTabs, wantKeys,
wantReturn, wantAllKeys: Boolean);
begin
wantTabs := false;
wantKeys := true;
wantReturn := false; // todo: this should be "true" for editting purposes.
// or false, to let LCL handle editting
wantAllKeys := false;
end;
procedure TCocoaCollectionView.backend_setCallback(cb: TLCLListViewCallback);
begin
self.callback:= cb;

View File

@ -219,6 +219,7 @@ type
callback: TLCLListViewCallback;
function lclGetCallback: ICommonCallback; override;
procedure lclClearCallback; override;
function lclContentView: NSView; override;
public
procedure setLclListView( lclListView: TCustomListView ); message 'setLclListView:';
procedure setViewStyle( viewStyle: TViewStyle ); message 'setViewStyle:';
@ -2143,6 +2144,11 @@ begin
callback:= nil;
end;
function TCocoaListView.lclContentView: NSView;
begin
Result:= documentView;
end;
procedure TCocoaListView.setLclListView(lclListView: TCustomListView);
begin
_lclListView:= lclListView;