FarNet - .NET Far API and .NET plugin manager (English)
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
FarNet - .NET Far API and .NET plugin manager (English)
English speaking .NET developers are welcome to use and discuss the FarNet plugin
http://code.google.com/p/farnet/
http://code.google.com/p/farnet/
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.
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
Kanniyan Poongundran, Tamil Poet, 500 BC
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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?
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?
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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:
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.
Code: Select all
F2 <keys to open the menu> CtrlAltF
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.
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
Re: FarNet - .NET Far API and .NET plugin manager (English)
Thank you, CtrlAltF is really useful.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.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
Kanniyan Poongundran, Tamil Poet, 500 BC
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.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.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
Kanniyan Poongundran, Tamil Poet, 500 BC
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.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.
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
Re: FarNet - .NET Far API and .NET plugin manager (English)
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
Kanniyan Poongundran, Tamil Poet, 500 BC
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.
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
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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).
- NightRoman
- Posts: 6184
- Joined: Fri 18 Aug, 2006 13:52
- Location: Cambridge, UK
- Has thanked: 32 times
- Been thanked: 62 times
- Contact:
Re: FarNet - .NET Far API and .NET plugin manager (English)
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).
Re: FarNet - .NET Far API and .NET plugin manager (English)
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
Kanniyan Poongundran, Tamil Poet, 500 BC
Re: FarNet - .NET Far API and .NET plugin manager (English)
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.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).
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
Kanniyan Poongundran, Tamil Poet, 500 BC