F4Menu for all v0.58

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

http://www.shanny.com.cn/f4menu/
0.50b8:
! Improve the drag experience in editor listview
! Set current dir as start path if the start path is null in menu mode
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Bug in b8 - after pinning editor from 'More programs' it closes instead of opening menu again. :!:

Also width of submenu 'More programs' is very small - e.g. even 'EmEditor (elevated)' text is truncated there... :!:


Thanks for setting path. Unfortunately there is another problem with it... As I see some editors use GetOpenFileName function w/o setting initial path so dumb Windows sets it using its dumb methods (e.g. it tries to set it to last path where such file type was opened/saved) and path setting is anyway bad idea (I got that first time with Imagine plugin when I started it and tried to save pasted from clipboard image so I asked author to pass current directory to GetOpenFileName/GetSaveFileName)... It seems that best idea is to detect current TC panel path and pass to editor this path with some default name like Untitled... Or maybe I can call my AskParam from F4Menu to ask user for filename and then start F4Menu again but with filename. Anyway here I need correct working path to be set when starting AskParam.


Another issue with F4Menu and current path: if someone passes just filename w/o full path, F4Menu appends wrong path to this filename (in my tests it appended its own path where F4Menu is placed) - working path that GetCurrentDirectory returns must be appended in this case. :!:

If you fix this issue, following workaround will be possible to start elevated editor with filename from F4Menu's menu mode in write-protected folder:

Code: Select all

[Program6]
Name=AskParam: F4Menu (elevated)
Path=%COMMANDER_PATH%\Addons\AskParam\AskParam.exe
Param=/c"F4Menu (elevated)" /p"Enter file name to edit:" %COMMANDER_PATH%\Sudo.exe %COMMANDER_PATH%\Addons\F4Menu\F4Menu.exe -m %1
So I press Shift+F4, enter no filename and press Enter, then I choose this editor, answer Yes to elevation request and then enter filename to AskParam dialog and press Enter again - and F4Menu launches corresponding editor with path to filename in current folder:)

BTW currently I can use following user command em_EditElevated to start eleavated F4Menu with path+entered filename:

Code: Select all

Command: "%COMMANDER_PATH%\Addons\AskParam\AskParam.exe" /c"Eleavated Edit" /p"Enter file name to edit:" "%COMMANDER_PATH%\Sudo.exe" "%COMMANDER_PATH%\Addons\F4Menu\F4Menu.exe"
Parameters: "%P%%1"
:)


And one more bug: if I start F4Menu using specified above user command, F4Menu works wrongly. E.g. F4Menu is started using command:

Code: Select all

"%COMMANDER_PATH%\Addons\F4Menu\F4Menu.exe" "D:\433.txt"
What I see - is that it opens focused in TC file instead of passed as parameter file! :!: Or, if I have ".." item focused, F4Menu opens right file but after TC warning that no files selected. It is a bit annoying... Problem is that F4Menu tries to get list of selected files but in this case it shouldn't do so because filename is passed manually! Maybe you can add some additional parameter that will tell F4Menu to ignore TC selection and just edit passed file?

BTW best thing is to detect if selection exists in active panel and to get it only in this case. Or you may check if passed as parameter filename is in selection that TC returns - so if passed filename is not in selection it is obvious that something is wrong. Of course you may check only first N filenames from retrieved list - according to 'Maximum number of open files' setting. So 31 compares in worst case - if path is not in selection. Of course if filename is passed to F4Menu w/o path working path should be appended before comparing.

And one more notice. :idea: When default editor is used and I have two files selected and one focused, TC passes focused file name to editor and not selected! So solution described above may help in such case too. And it will be like interesting feature: if user has some files selected and one of them is focused, F4Menu opens all selected files, if focused file is not selected, F4Menu opens only it like usual TC does.
Last edited by MVV on 2010-09-24, 12:43 UTC, edited 1 time in total.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

Bug in b8 - after pinning editor from 'More programs' it closes instead of opening menu again. :!:

Also width of submenu 'More programs' is very small - e.g. even 'EmEditor (elevated)' text is truncated there... :!:
As we discussed before, I have no idea about this bug, just ignore it at present...
Thanks for setting path. Unfortunately there is another problem with it... As I see some editors use GetOpenFileName function w/o setting initial path so dumb Windows sets it using its dumb methods (e.g. it tries to set it to last path where such file type was opened/saved)
On the contrary, I just like GetOpenFileName() to remember the last path, because thus after choosing an editor, I can select the icon file in the same folder. I'd like to keep this behavior.
Another issue with F4Menu and current path: if someone passes just filename w/o full path, F4Menu appends wrong path to this filename
That's a bug, will be corrected soon.
And one more bug: if I start F4Menu using specified above user command, F4Menu works wrongly.
Actually it's an intentional feature, not a bug.
BTW best thing is to detect if selection exists in active panel and to get it only in this case.
if user has some files selected and one of them is focused, F4Menu opens all selected files, if focused file is not selected, F4Menu opens only it like usual TC does
Your solution sounds fantastic, but this feature changes F4Menu's behavior, maybe some users don't like it.
Anyway, I'll try to realize it later.
Thanks for your great suggestion again.
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Shanny, one little wish - please make F4Menu check if some key shortcut is used for more than one launch mode - it would be useful to see warning about it to avoid confusing user. :)

Shanny wrote:On the contrary, I just like GetOpenFileName() to remember the last path, because thus after choosing an editor, I can select the icon file in the same folder.
Agree, sometimes it is useful. But sometimes it is very ugly. And I don't know any way to control it w/o changing application code (maybe it exists).
Shanny wrote:I'd like to keep this behavior.
As I said, you can't change it:) it is hardcoded in each editor (and used if initial dir for GetOpenFileName is not specified).
Shanny wrote:
And one more bug: if I start F4Menu using specified above user command, F4Menu works wrongly.
Actually it's an intentional feature, not a bug.
Sorry but I don't understand for now how you distinguish this thing. Currently I don't see any way to disable such behaviour so it looks more like a bug than like a feature - I tried to set max opened files to 0 but F4Menu opens selected file instead of focused one anyway. Maybe some additional parameter that will tell F4Menu to use just passed names and don't copy selection from TC? :)
Your solution sounds fantastic, but this feature changes F4Menu's behavior, maybe some users don't like it.
You may add some option in config dialog: 1. Always open selected files (like now). 2. Always open passed files (like usual editor started from TC does on F4). 3. Open selected files if passed one is in selection else open passed one (euristic method).
BTW I think it would be useful to support command-line parameter to override configured mode (e.g. something like -ss, -sp, -sd).
Thanks for your great suggestion again.
Thanks for your little tool:)
Last edited by MVV on 2010-09-24, 03:41 UTC, edited 2 times in total.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Some Notes:
1. The placement of [Extensions] in the config Dialog is non-optimal. If it can't be configured, it would be beneficial for this particular TabStop to be the very next one (3rd) after the Programs "[Name]" and "[Path]".

2. MVV possibly has a point, ChoiceEditor's behaviour is:
  • If Files are selected, and cursor is on at least 1 of the selected files, Open them all.
  • If Files are selected, and cursor is NOT on one of the files, open the file at cursor only.
As well, ChoiceEditor doesn't force-select the file at the Cursor. That behaviour of F4Menu doesn't seem right - the only way around it is the setting "clear the selection of all opened files".

3. ContextMenu, "More Programs->"
Shouldn't be shown if the list is empty.

B. ContextMenu, An Option to hide the Windows SystemDefined Open for that extension (1st Item).
-- I want to see what I have defined for that extension, not what Windows thinks is the correct app...
As well this 1st item is even displayed when the .extension doesn't exist in the registry and there is no Associated Application.

C. The ContextMenu seems cluttered to me.
If I use TC's Internal Association I only get a list of Editors to choose from.
If I use ChoiceEditor, I get a list of Editors + 1 Extra [Other Program] option.

Option to move all of the "extra" items of the ContextMenu to a last item SubMenu
eg:
  • EmEditor
  • Notepad2
  • ---------------
  • Options ->
    • Notepad2k
    • ----------
    • Other Program
    • ----------
    • Config
    • About F4 Menu
Nice to see F4Menu able to handle multiple selected extensions that have defined different editors.
F4Menu Properly opened test.foobar in Emeditor and test.txt in Notepad2
TC's internal association fails at this, and ChoiceEditor can't open either of the files when you try this.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

MVV wrote:one little wish - please make F4Menu check if some key shortcut is used for more than one launch mode
No problem, but it needs addtional language string, I'll add it in next major version.
Currently I don't see any way to disable such behaviour so it looks more like a bug than like a feature
Maybe :D
but with your suggested feature, this problem should go away, right?
You may add some option in config dialog: 1. Always open ...2. Always ...3. Open selected files if passed one is in selection else open passed one (euristic method)
Actually I don't like to add too many options to annoy users, I'll just adopt the approach 3.
TCEE, TCPP, F4Menu -- Shanny
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

2 Balderstrom
1. The placement of [Extensions] in the config Dialog is non-optimal. If it can't be configured, it would be beneficial for this particular TabStop to be the very next one (3rd) after the Programs "[Name]" and "[Path]".
It's a matter of opinion, I think current placement is OK for me. And if just change the TabStop of [Extensions], may confuse some users.
2. MVV possibly has a point, ChoiceEditor's behaviour is:
I got his great idea, and will add this feature in next release:)
As well, ChoiceEditor doesn't force-select the file at the Cursor. That behaviour of F4Menu doesn't seem right - the only way around it is the setting "clear the selection of all opened files".
Actually it's a useful feature which invovled in v0.13, thus user can see which file is to open (at that time the first menu item is not filename)
However, with your remind, I find there's a bug in this case:
The file should be restored to unselect state when F4Menu exit.
3. ContextMenu, "More Programs->"
Shouldn't be shown if the list is empty.
Sure, it's a bug, but, can I ignore it? :D
B. ContextMenu, An Option to hide the Windows SystemDefined Open for that extension (1st Item).
-- I want to see what I have defined for that extension, not what Windows thinks is the correct app...
As well this 1st item is even displayed when the .extension doesn't exist in the registry and there is no Associated Application.
Actually this item is designed to show the file name which is to open now, show system associated app is an additionalfunction.
With above automatically select feature, maybe it seems useless if you only selected one file.
But if you selected multiple files, you should choose different editors for different exts, without this menu item, you cannot know which exts you are processing.
C. The ContextMenu seems cluttered to me.
It's also a matter of opinion, F4Menu should show the filename and default editor, so it's different from TC or ChoiceEditor.
Anyway, I'll consider your idea and try to make the menu structure more effective.
Nice to see F4Menu able to handle multiple selected extensions that have defined different editors.
Thanks for all your suggestion, your support helps F4Menu being better and better. :D
TCEE, TCPP, F4Menu -- Shanny
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Shanny wrote:2 Balderstrom
1. The placement of [Extensions] in the config Dialog is non-optimal. If it can't be configured, it would be beneficial for this particular TabStop to be the very next one (3rd) after the Programs "[Name]" and "[Path]".
It's a matter of opinion, I think current placement is OK for me. And if just change the TabStop of [Extensions], may confuse some users.
As well, ChoiceEditor doesn't force-select the file at the Cursor. That behaviour of F4Menu doesn't seem right - the only way around it is the setting "clear the selection of all opened files".
Actually it's a useful feature which invovled in v0.13, thus user can see which file is to open (at that time the first menu item is not filename)
However, with your remind, I find there's a bug in this case:
The file should be restored to unselect state when F4Menu exit.
Matter of Opinion, certainly, Though I would be hard-pressed to care what the path/start-path/or icon-path of a given editor is. --- Among all of the Editor variables --- those 3 are highly unlikely to ever change - until you install your OS into a different Drive than C ;-)
Whereas I'd definitely want to know what extension's an Editor is assigned to.

As for the latter, side note: That's one of the things I use TwinKey for - when TC isn't in the foreground (active-Window) TwinKey shows where the cursor is in both panes.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

new beta available, hope it's the last beta

http://www.shanny.com.cn/f4menu/
0.50b9:
! Only open the focused file if it is not selected, otherwise open all selected files (thanks to MVV@tc)
! For the filename only parameter, use current dir as its path (thanks to MVV@tc)
! The selection state of focued file should be restored when F4menu exit (thanks to Balderstrom@tc)
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great work :) now it uses same logic as TC but with bonus feature:)

But please add support for command line parameter to ignore retrieving selection from TC. Now I try to execute my above described user-command (em_EditElevated) from TC buttonbar and: if '..' is focused then (1) TC warns that no selection, (2) F4Menu warns that thumb mode is not supported and then (3) opens right file passed as parameter; if other file is selected but '..' item is focused or no files selected and some file is focused F4Menu (0) opens nothing. So it would be great to have possibility just to open passed filenames (so F4Menu may not search TC window and send messages to it at all if this parameter is passed).

And it seems that Readme should be updated. :wink:
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

But please add support for command line parameter to ignore retrieving selection from TC.
No problem, but it's a new feature indeed, I'll add it in next major version.
And it seems that Readme should be updated.
Sure, if there's no serious bug in b9, I'll collect the recent beta update into 0.50 final :)
TCEE, TCPP, F4Menu -- Shanny
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

Download: http://www.shanny.com.cn/f4menu

[2010-10-01 0.50 final]
+ Parameter mode: -p, only retrieve filelist from command line and ignore TC selection (thanks to MVV@tc)
+ Only open the focused file if it is not selected, otherwise open all selected files (thanks to MVV@tc)
+ Improve the drag experience in editors listview (thanks to MVV@tc)
! Automatic highlight may not work when the default editor is unavailable
! Drag editor may crash/damage the config file (thanks to MVV@tc)
! The focus item incorrect after drag/drop in editor list (thanks to MVV@tc)
! Set current dir as start path if the start path is null in menu mode (thanks to MVV@tc)
! For the filename only parameter, use current dir as its path (thanks to MVV@tc)
! The selection state of focued file should be restored when F4menu exit (thanks to Balderstrom@tc)
+ Parameter: -a/-r, add/remove context menu for windows explorer, temporarily
TCEE, TCPP, F4Menu -- Shanny
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

I dont understand the behavior of this version :s

For instance, if I have a folder which containing a .TXT file, followed by a .EXE file, and i select on TC the .TXT file only, TC will naturally move the cursor to the next file without selecting it (.EXE)

At that moment, if I press F4 to edit the .TXT, it NOT opens the selected .TXT file, but the .EXE file !

I'm lost...
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Don't know what you mean byblo.

MouseMode: Left
In TC, if you select TestFile.txt (cursor does NOT move), via
1) LeftClick
2) RightClick -> FileSelected, ContextMenu pops up. (Press ESC to dismiss ContextMenu); TestFile.txt unselected.
3) Ctrl+LeftClick -> TestFile.txt Selected or UnSelected.
4) Ctrl+Space -> TestFile.txt Selected or UnSelected.
5) Space -> TestFile.txt Selected or Unselected, Cursor MIGHT move if your ini setting allows it.
6) Insert -> TestFile.txt Selected or Unselected, cursor moves down
MouseMode: Right
In TC, if you select TestFile.txt (cursor does NOT move), via
1) LeftClick
2) RightClick -> FileSelected or Unselected.
3) Ctrl+LeftClick -> TestFile.txt can be Selected only, RB-Mode breaks Ctrl+LeftClick's proper functionality.
4) Ctrl+Space -> TestFile.txt Selected or UnSelected.
5) Space -> TestFile.txt Selected or Unselected, Cursor MIGHT move if your ini setting allows it.
6) Insert -> TestFile.txt Selected or Unselected, cursor moves down
Ctrl+Insert has no effect, as opposed to Ctrl+Space.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If I put cursor onto TXT file, F4Menu opens just it. byblo, maybe you have some special settings? I think you may share your INI to test.

If I select some files and put cursor onto non-selected file and use F4, F4Menu opens just it - just like TC. :)

Shanny, great thanks for -p option! And for final version:)

Tested -a and -r parameters, work fine. BTW, will their message text be added to LNG?
And, what exactly does parameter -fp? Is there difference between -fp and -p? :)
Last edited by MVV on 2010-10-01, 21:21 UTC, edited 1 time in total.
Post Reply