mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: support Finder Tag - step 11: select token by Mouse
This commit is contained in:
parent
967dcff2c3
commit
e1336aa137
1 changed files with 28 additions and 1 deletions
|
|
@ -120,7 +120,11 @@ type
|
|||
{ TFinderTagsListView }
|
||||
|
||||
TFinderTagsListView = objcclass( NSTableView )
|
||||
procedure drawRow_clipRect (row: NSInteger; clipRect: NSRect); override;
|
||||
function init: id; override;
|
||||
procedure drawRow_clipRect (row: NSInteger; clipRect: NSRect); override;
|
||||
function acceptsFirstResponder: ObjCBOOL; override;
|
||||
private
|
||||
procedure onDoubleClick( sender: id ); message 'onDoubleClick:';
|
||||
end;
|
||||
|
||||
{ TFinderTagsEditorPanel }
|
||||
|
|
@ -146,6 +150,7 @@ type
|
|||
function tableView_objectValueForTableColumn_row (
|
||||
tableView: NSTableView; tableColumn: NSTableColumn; row: NSInteger): id;
|
||||
public
|
||||
procedure insertCurrentFilterToken; message 'insertCurrentFilterToken';
|
||||
procedure updateFilter( substring: NSString );
|
||||
private
|
||||
function control_textView_doCommandBySelector (control: NSControl; textView: NSTextView; commandSelector: SEL): ObjCBOOL;
|
||||
|
|
@ -443,6 +448,13 @@ end;
|
|||
|
||||
{ TFinderTagsListView }
|
||||
|
||||
function TFinderTagsListView.init: id;
|
||||
begin
|
||||
Result:= inherited init;
|
||||
self.setTarget( self );
|
||||
self.setDoubleAction( objcselector('onDoubleClick:') ) ;
|
||||
end;
|
||||
|
||||
procedure TFinderTagsListView.drawRow_clipRect(row: NSInteger; clipRect: NSRect
|
||||
);
|
||||
var
|
||||
|
|
@ -471,6 +483,16 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function TFinderTagsListView.acceptsFirstResponder: ObjCBOOL;
|
||||
begin
|
||||
Result:= False;
|
||||
end;
|
||||
|
||||
procedure TFinderTagsListView.onDoubleClick(sender: id);
|
||||
begin
|
||||
TFinderTagsEditorPanel(self.dataSource).insertCurrentFilterToken;
|
||||
end;
|
||||
|
||||
{ TFinderTagsEditorPanel }
|
||||
|
||||
class function TFinderTagsEditorPanel.editorWithPath( const path: NSString ): id;
|
||||
|
|
@ -593,6 +615,11 @@ begin
|
|||
Result:= nil;
|
||||
end;
|
||||
|
||||
procedure TFinderTagsEditorPanel.insertCurrentFilterToken;
|
||||
begin
|
||||
_tagsTokenField.currentEditor.doCommandBySelector( ObjCSelector('insertNewline:') );
|
||||
end;
|
||||
|
||||
procedure TFinderTagsEditorPanel.updateFilter( substring: NSString );
|
||||
var
|
||||
tagName: NSString;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue