FarNet - .NET Far API and .NET plugin manager (English)

Here you can discuss about your favorite plug-in.
User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Sun 08 Mar, 2009 16:44

English speaking .NET developers are welcome to use and discuss the FarNet plugin
http://code.google.com/p/farnet/

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Sun 03 Apr, 2011 04:05

I have folder full of shortcuts to access my favorite folders from Run box. To access these folders in FAR I tried few approaches, FAR Folder Shortcuts, I can have only 10 shortcuts and I need more. I have been using User Menu to do this. So far so good, except that I have to remember HotKey for each folder.

So I wrote a simple FarNet ModuleCommand, it takes the shortcut name and opens the target in the active panel.
I have few questions on this,
1. ModuleCommand must end with ":" , Is it true? How do I change this to some other character like ";"?
2. Can you provide a little code snippet to Open a superPanel with few files in it? I am going to take a look at your Explore command and see if it helps me anyway.

Thank you as always.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Sun 03 Apr, 2011 05:19

1) The symbol that separates command prefix and text is ":"; it is defined by Far Manager and it is not configurable, as far as I know.

2) One code snippet is the class FarNet.Tools.SearchFileCommand (see void Invoke(Panel sourcePanel)):
http://farnet.googlecode.com/svn/trunk/ ... Command.cs


But why you are going to use the super panel is not quite clear to me. Basically "super" means that it is "panel with files from other panels". That implies you have to have your panel with your files in the first place, then you can use the super panel (for search results, as a temp panel, etc.). Do you already have your own panels/explorers in order to use them with the super panel?

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Sun 03 Apr, 2011 05:35

Perhaps you actually want to write you own panel (a child of the Panel class with its child of the Explorer class that provides files), not use the super panel. Having your panel opened and some files in it you can indeed use the Explore module/command in order to search your files; but this part does not need any programming, it's a tool ready to use.

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Sun 03 Apr, 2011 05:55

A few thoughts about your original task. I also use Far Folder Shortcuts -- yes, only for a few very often used folders. For others I also use the user menu. For some reason I do not have issues with keeping hotkeys in mind :). But if I have I would create a macro like this:

Code: Select all

F2 <keys to open the menu> CtrlAltF
The last CtrlAltF (often overlooked feature) activates incremental filtering in the result menu: type any substring that you can remember and the filter is applied incrementally to the menu items as far as you are typing. Needles to say, that menu item names are your folder shortcut names.

User avatar
HaRT
Moderator
Posts: 8023
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 67 times
Been thanked: 99 times

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by HaRT » Sun 03 Apr, 2011 16:54

senpost
To open folders by their assigned designatins is what the NamedFolders plugin has been doing for years. Give it a try — it's very powerful.
Фар есть инструмент, а не нянька. © 2009 DrKnS

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Sun 03 Apr, 2011 23:57

NightRoman wrote:
The last CtrlAltF (often overlooked feature) activates incremental filtering in the result menu: type any substring that you can remember and the filter is applied incrementally to the menu items as far as you are typing. Needles to say, that menu item names are your folder shortcut names.
Thank you, CtrlAltF is really useful.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Mon 04 Apr, 2011 00:03

NightRoman wrote:Perhaps you actually want to write you own panel (a child of the Panel class with its child of the Explorer class that provides files), not use the super panel.
Maybe I dont want to use SuperPanel. If I want to list some random files in a panel, What kind of panel I have to use. Can you post some code snippet please.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Mon 04 Apr, 2011 05:36

If I want to list some random files in a panel, What kind of panel I have to use. Can you post some code snippet please.
You mean any files and you need any example code? Then take a look at Test-Explorer-.ps1 from PowerShellFar. It is a PowerShell script but it gives an idea how C# code for panels should look like. The only difference is that in C# you derive your classes from Panel and Explorer and override proper methods.

Also, the PowerShellFar module itself uses several panels, you may want to take a look at the sources. That code is more difficult for learning than demos but on the other hand it might be more useful for doing real things: http://code.google.com/p/farnet/source/ ... r%2FPanels

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Thu 14 Jul, 2011 15:22

Is there a way, I can create a panel with a text box on top and viewer & list box on the bottom. Idea behind this is to let user type some command in the text box and then display results in the viewer or list box.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
HaRT
Moderator
Posts: 8023
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 67 times
Been thanked: 99 times

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by HaRT » Thu 14 Jul, 2011 15:26

senpost
AFAIK, a PowerShellFar plugin panel can display objects returned by a PowerShell script run inside Far.
And the FarCmds plugin can open console program's text output in an editor/viewer. It hides the panels though.
Фар есть инструмент, а не нянька. © 2009 DrKnS

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Thu 14 Jul, 2011 15:29

It is possible. Is it going to be a dialog (i.e. not panel)? Panel is a completely different beast. I would use a list box for results (or a custom control).

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Thu 14 Jul, 2011 15:39

Or is this going to be really a panel with a box on top and a list at bottom? I do not think this is a good way to go (even if this is possible).

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Thu 14 Jul, 2011 15:43

How FAR displays tree view or Info panel? Those are kind of different than panel, Can a plugin create some custom control and host it in any one of the panels?
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by senpost » Thu 14 Jul, 2011 15:48

NightRoman wrote:Or is this going to be really a panel with a box on top and a list at bottom? I do not think this is a good way to go (even if this is possible).
Why do you think that? You may argue that I can use command line with FAR command to achieve this. I kind of want it to take this little further with my own custom panel/window.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC

User avatar
NightRoman
Posts: 5849
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 8 times
Been thanked: 8 times
Contact:

Re: FarNet - .NET Far API and .NET plugin manager (English)

Post by NightRoman » Thu 14 Jul, 2011 15:58

senpost
I am not trying to stop you. But where did you see such a UI in Far? FarNet cannot do something that Far or plugins do not do (in UI, at least).

Post Reply

Return to “General Plug-In Discussions”