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
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Shanny, what about suggested requests? I mean optional separator above 'More programs' submenu and optional hiding (moving to context menu or to 'More programs' submenu) last two menu items 'Settings' and 'About'? Theese things will improve menu look. (BTW 'About' item is in settings dialog anyway.)

BTW I think it may be useful to have custom separators in menu (especially if you have a lot of editors, and maybe if I have a lot of editors associated with same file type; or if I just have pinned a lot of editors to main menu :)). E.g. if item 5 is separator and F4Menu shows items 3 and then 8 it shows separator between them (in main menu or in 'More programs' submenu). Separator may be set e.g. as another editor with "-" as its name. In this case any people can add custom separator before 'More programs' item by adding last editor with name "-". :)

Also it would be great if F4Menu can remember config window size and positions of separators - it is a bit annoying to move them every time when I open config dialog.


And, a bug found by users from Russian board. When you have no pinned editors and no editors associated with current file type and you execute F4Menu, it crashes. E.g. I press F4 on F4Menu.exe.manifest file and I have no editors associated with manifest extension - F4Menu shows and then error occurs:
Translated error message wrote:Instruction at address "0x00409a59" tried to access to memory address "0x00000f36". Memory cannot be "read".
According to application code buggy instruction compares byte at address eax+0xF36 with 0. Just before this instruction some function was called that returned 0 - this function calls memset and GetMenuItemInfo(W). I think you should add some check for returned value here, or maybe some error in logic - as I said bug can be avoided if there are at least one pinned editor.


Also one little annoying thing - F4Menu closes if I try to pin some editor from 'More programs' submenu (BTW other context menu items for items from 'More programs' submenu also cause closing F4Menu - e.g. F4Menu closes too if I choose 'Associate'). It is expected that it will show main menu again after pinning.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

2 MVV
Thanks for the support from Russian:)
optional separator above 'More programs' submenu
That's OK, but how about mandatory? Just always show a separator above submenu, even there's no common editors between two separaptors, is it acceptable?
and optional hiding (moving to context menu or to 'More programs' submenu) last two menu items 'Settings' and 'About'? Theese things will improve menu look. (BTW 'About' item is in settings dialog anyway.)
I think put these two items to 'More programs' submenu is illogical for semantics, I still like to show them in main menu, sorry for that.
But for 'About' item, I'll consider your suggestion to remove it.

BTW I think it may be useful to have custom separators in menu (especially if you have a lot of editors, and maybe if I have a lot of editors associated with same file type; or if I just have pinned a lot of editors to main menu :)). E.g. if item 5 is separator and F4Menu shows items 3 and then 8 it shows separator between them (in main menu or in 'More programs' submenu). Separator may be set e.g. as another editor with "-" as its name. In this case any people can add custom separator before 'More programs' item by adding last editor with name "-". :)
That's a good idea, and I already put it into my TODO list in the first topic two years ago

Code: Select all

7. Allow separator on menu (zeroxia@DRL) 
However, since the menu item support drag-drop, so I want to make the menu item's type, order and logic to be as simple as possible.
I think the implementation of this feature seems a little difficult.
In your example, if all items shown in submenu, does F4Menu need show the separator5 in main menu?
and, if item 9 is also separator, and main menu show item 3 and 10, how many separators are shown between them?
And F4Menu should also handle many exception for separator menu item...

Anyway, I'll try to do this later, but may need a long time.

Also it would be great if F4Menu can remember config window size and positions of separators - it is a bit annoying to move them every time when I open config dialog.
Your F4Menu not support it? it should be supported from 0.1x or the first version.
Try it again, and remeber press OK after your adjustment.
And, a bug found by users from Russian board. When you have no pinned editors and no editors associated with current file type and you execute F4Menu, it crashes.
Many thanks for this bug report and your analysis, I'll fix it soon:)

Also one little annoying thing - F4Menu closes if I try to pin some editor from 'More programs' submenu (BTW other context menu items for items from 'More programs' submenu also cause closing F4Menu - e.g. F4Menu closes too if I choose 'Associate'). It is expected that it will show main menu again after pinning.
Actually that's also an annoying thing for me, but I have no idea to fix it by now.
When I use InsertMenuItem() to add a new menu item to main menu, the main menu always closed,
But when I just use SetMenuItemInfo() to update item, there's no problem
Do you have any idea?
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

how about mandatory? Just always show a separator above submenu, even there's no common editors between two separaptors, is it acceptable?
I think YES. It won't overload menu if it is empty. :)
That's a good idea, and I already put it into my TODO list in the first topic two years ago
Oh, I missed that... :)
However, since the menu item support drag-drop, so I want to make the menu item's type, order and logic to be as simple as possible.
Hm, yes, you may just add button 'Add separator' in config dialog and create item with "-" internally.
In your example, if all items shown in submenu, does F4Menu need show the separator5 in main menu?
If any item above and below separator is displayed then separator should be displayed too (if any of 1-4 items are displayed and any of 6-... are displayed too). In other words, you should show all separators but prevent displaying two or more separators together. :) I think this way is easier - if you're adding separator to menu, just check if last added item is separator too.
I don't think there are problems with separators - just don't process them at all, leave them as rocks in the river. :)
Your F4Menu not support it? it should be supported from 0.1x or the first version.
Try it again, and remeber press OK after your adjustment.
Oops... You're absolutely right, it really works! :D
Actually that's also an annoying thing for me, but I have no idea to fix it by now.
Why not to display main menu manually at same position after changing (like you already do after displaying dialogs/messages)?
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

MVV wrote:Why not to display main menu manually at same position after changing (like you already do after displaying dialogs/messages)?
That's not the real solution.
I believe the solution exist, but not found yet...
TCEE, TCPP, F4Menu -- Shanny
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

[2010-09-07 0.50 beta4]
! Fix may crash if there's no default editor (thanks to MVV@tc)
! Change the editor priority logic for highlight function
* Language update: Korea (thanks to dis1hades2)
* Language update: Polish (thanks to dong@tc)
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Hi, Shanny!

It seems that I found a bug. If I setup some program as editor and specify additional parameters for it, F4Menu passes theese parameters and filename when I'm using F4. But when I'm using Shift+F4 (I'm using -m parameter for F4Menu) and then try to start this editor, F4Menu doesn't pass theese custom parameters.

E.g. I have editor:

Code: Select all

Name=EmEditor (elevated)
Path=..\..\Sudo.exe
Param=D:\Programs\EmEditor\EmEditor.exe /sp
Icon=D:\Programs\EmEditor\EmEditor.exe,0
When I want to start it using Shift+F4 in order to create new file in current directory (which is write-protected for usual users so I can't create file using Shift+F4) F4Menu starts just ..\..\Sudo.exe w/o any parameters - so actual editor is not started.

I think F4Menu should pass additional parameters always - but maybe w/o filename if it has not it (like when started using Shift+F4 w/o filename).
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

2 MVV,
Actually it's an intended behavior, because I was afraid that pass parameter without filename may cause problem for some editors
However, your user case sounds reasonable, I'll try to pass parameters for -m mode.
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thanks, it would be great:)


BTW maybe you can use TC solution: parameters that are specified after path to application in 'Path' parameter are always passed to application and parameters that are specified in 'Param' parameter are passed only when filename is passed too (TC uses such behaviour for drag-n-dropped to buttonbar button files). But such thing will need to allow parameters in 'Path' string which is currently forbidden.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

MVV wrote:Thanks, it would be great:)


BTW maybe you can use TC solution: parameters that are specified after path to application in 'Path' parameter are always passed to application and parameters that are specified in 'Param' parameter are passed only when filename is passed too (TC uses such behaviour for drag-n-dropped to buttonbar button files). But such thing will need to allow parameters in 'Path' string which is currently forbidden.
Thanks for your suggestion.
TC's solution sounds good, I'll try it later if it's necessary.
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-09-18 0.50 beta6]
! Greatly improve the startup time (thanks to happyTC@newsmth)
! The position of tooltip may be improper in some cases
! Fix some other minor errors
* Start editors with parameter in menu mode (thanks to MVV@tc)
* Language update: Dutch (thanks to RolandD)
* Language update: Swedish (thanks to Leif Larsson@tc)
+ FAQ: How to use the shortcut key ESC+F4/F4 as before?

FAQ9. How to use the shortcut key ESC+F4/F4 as before?
A: Some users are used to the old shortcut key ESC+F4/F4, actually the new version still supports it:
Just need to set 'ESC' as the shortcut key of foreground/background mode, then pressing ESC+F4/F4 can launch F4menu in different mode.
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Thanks for passing parameters in menu mode:)


BTW I found another bug with menu mode. When I'm starting editor in normal mode F4Menu sets its working directory correctly. But if I start same editor from menu mode F4Menu doesn't set its working directory (actually editor's working directory is F4Menu directory). So I need to manually browse to current folder in order to save new file in editor.

Little suggestion - can you add some modifier to enable dragging of menu items? E.g. drag may only work when Ctrl or Shift is held - sometimes wrong drags occur.


And some bugs from Russian board:) bugs with dragging items in menu. When I drag editor to position of default editor or back, F4Menu opens properties of wrong editor via context menu until I restart program. Also when I try to move default editor down F4Menu crashes and kills my editor (after restarting F4Menu I see two copy of editor that was at place where I dropped my default editor).

Also a bug I found in config dialog. After dragging some editor it keeps focus but if I click Modify button it shows me properties of another editor - i.e. focused item index is detected incorrectly.
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

MVV
But if I start same editor from menu mode F4Menu doesn't set its working directory (actually editor's working directory is F4Menu directory).
It's not a bug, since the file is null, so F4Menu cannot get the path from file name. If the start path is not set for this editor, then use F4Menu's start path.
Anyway, this idea is good, maybe F4Menu can try to get the current working directory from TC.
Little suggestion - can you add some modifier to enable dragging of menu items? E.g. drag may only work when Ctrl or Shift is held - sometimes wrong drags occur.
I think current solution is OK, you know, on IE Favorite menu, drag an item also need not pressing Ctrl or Shift.
Do you mean drag items in editor list window? That's maybe a problem, I'll try to improve it later.
And some bugs from Russian board:)
Also a bug I found in config dialog.
Thanks so much for your bug reporting.
The first one is really a fatal issue which I also noticed.
I have fixed them in 0.50b7, please help to verify, thanks!
Last edited by Shanny on 2010-09-19, 16:32 UTC, edited 1 time in total.
TCEE, TCPP, F4Menu -- Shanny
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

http://www.shanny.com.cn/f4menu/
0.50b7:
! Drag editor may crash/damage the config file
! The focus item incorrect after drag/drop in editor list
TCEE, TCPP, F4Menu -- Shanny
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Great, bugs with item index and default item are fixed:)
It's not a bug, since the file is null, so F4Menu cannot get the path from file name. If the start path is not set for this editor, then use F4Menu's start path.
Anyway, this idea is good, maybe F4Menu can try to get the current working directory from TC.
Actually TC sets working directory while starting editor by F4 so you may call GetCurrentDirectory before you change dir and you'll get TC current dir - just play with it, I'm sure you'll get it. :)

I don't using IE (and don't think it may be treated as standard :)) but it would be great to have chance to 'lock' menu - i.e. disable drag-n-drop in menu (or disable it but allow dragging with modifier - maybe as an option?).
User avatar
Shanny
Member
Member
Posts: 177
Joined: 2003-02-24, 08:38 UTC

Post by *Shanny »

Thanks for your suggestion, seems it works:)
I don't using IE (and don't think it may be treated as standard :)) but it would be great to have chance to 'lock' menu - i.e. disable drag-n-drop in menu (or disable it but allow dragging with modifier - maybe as an option?).
Sorry, I still think it's unnecessary
Anyway, I'll improve the drag experience in editor list dialog later.
TCEE, TCPP, F4Menu -- Shanny
Post Reply