Open a button menu using a command

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Display it where the MouseCursor is...like a contextMenu is done.

Of course the context-menu button on my keyboard itself, doesn't seem to be related to the mouse cursor at all. In opera it seems to open primarily milddle of the screen, and in TC it seems to bounce around.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka/Makiivka
Contact:

Post by *LonerD »

Support++
Support++
Support++

TCMenu can do it but not support by author. Native realization in TC will be a wonderful.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

As far as deciding where to open the menu, one or two wincmd.ini settings, with sane defaults would settle that issue.

OpenManualButtonBarLocation=
1: TopLeft of active panel.
2: TopRight of active panel.
4: Outside of active panel:
__ TopLeft, if panel is left.
__ TopRight, if panel is right.
8: Inside of active panel:
__ TopRight, if panel is left.
__ TopLeft, is panel is right.
16: At the cursor position
1024: At the mouse cursor, if it is within TC's window.
__ Else one of the previous settings (1-16)

The code used to display a drop-down button-bar menu on the existing Main button-bar is all that would be needed --- so long as we can indicate where the menu should open as noted above.
A few more positions could be added easily enough - if suggestions were requested for any other needed positions before implementing the feature.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
igarny
Junior Member
Junior Member
Posts: 58
Joined: 2023-01-26, 19:01 UTC

Re:

Post by *igarny »

Hi guys,

As far as I understand this is the closest thread that discusses my challenge and unfortunately it appears with no resolution ... even worse the specific inquiry had been shifted and lost.
StickyNomad wrote: 2009-05-11, 14:56 UTC OPENBAR opens another BAR-file and replaces the currently displayed buttonbar with the specified one. Lefteous looks for a way to open the pulldown menu of a button (when 'show as menu' is activated) with a command.

I support this request if this isn't possible already.

As @StickyNomad commented the point is to start/activate/click a specific item/position/button from a button bar
The question is if there is such a command or eventually one could be crafted so that based on number parameter activates the button on the respective position in the current active button bar.
Please note: the point is not to open a new button bar, but activate a button from the active button bar with a command to which I hopefully can assign a shortcut key.
The parameter would open position from either the left side = positive numbers or the right side = negative numbers
Please check the picture, where on top are the positive number positions as proposed for a number and below the button bar is the negative positioning Image: https://ibb.co/ngyxf2S

I hope @Lefteous had the same thing in mind in 2009
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Open a button menu using a command

Post by *Fla$her »

I've also wanted this for a long time. Support +++

2igarny
I understand that this is not exactly the same, but you can call the menu separately using autorun.wdx.
Example of an entry in autorun.cfg:

Code: Select all

LoadLibrary Plugins\Autorun_Tweaks.dll

# Open the menu under the top of the panels middle by Ctrl + Alt + 1:
SetHotkeyAction /K:C /K:A /H:1 ShowPopupMenu /A:128:8192 '%COMMANDER_PATH%\Bars\My.bar'
Overquoting is evil! 👎
igarny
Junior Member
Junior Member
Posts: 58
Joined: 2023-01-26, 19:01 UTC

Re: Open a button menu using a command

Post by *igarny »

Unfortunately this doesn't click / activate a button on the current active bar, but opens a new one
# Open the menu under the top of the panels middle by Ctrl + Alt + 1:
SetHotkeyAction /K:C /K:A /H:1 ShowPopupMenu /A:128:8192 '%COMMANDER_PATH%\Bars\My.bar'
I would even be happy, if there is an option / commands for moving selection / focus left or right and activating these. Hoping to be able to combine these with menu commands of TC to achieve the same goal
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Open a button menu using a command

Post by *Fla$her »

igarny wrote: 2023-04-14, 16:04 UTCUnfortunately this doesn't click / activate a button on the current active bar, but opens a new one
I wrote that it's not the same. It may not be so beautiful, but from the point of view of benefits it's no worse.
igarny wrote: 2023-04-14, 16:04 UTCI would even be happy, if there is an option / commands for moving selection / focus left or right and activating these.
In my experience, moving the focus only with the arrows is slow. It looks more acceptable to pre-move through the separators using Ctrl+Right.
For example, with TCFS2 you can press the 4th button after the 5th separator:

Code: Select all

%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef tcm(4004) send(`^{RIGHT 5}{RIGHT 3}{ENTER}`)
Or the 3rd button to the left of the 6th separator:

Code: Select all

%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef tcm(4004) send(`^{RIGHT 6}+{LEFT 3}{ENTER}`)
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Open a button menu using a command

Post by *Fla$her »

2ghisler(Author)
1. How easy is it technically to implement the ability to instantly move the focus to a button with a certain number and press?
2. Or implement the display of a drop-down menu under your button by calling it by index on the current toolbar? OPENBARMENUBYINDEX ?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48231
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Open a button menu using a command

Post by *ghisler(Author) »

It's not quite clear what you want to achieve, and why. For example, why do you want to show the menu for a certain button and not for a certain bar file?
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2388
Joined: 2020-01-18, 04:03 UTC

Re: Open a button menu using a command

Post by *Fla$her »

ghisler(Author) wrote: 2023-05-19, 13:59 UTC For example, why do you want to show the menu for a certain button and not for a certain bar file?
2 reasons when using hotkeys:
1. It is more convenient from the point of view of visual perception, when you look at the buttons and without having to remember the intended purpose, you understand which of them should show the menu.
2. Visually, it looks much more aesthetically pleasing when the menu opens under the corresponding button on the current toolbar, and not somewhere on the left side of the window.
Overquoting is evil! 👎
Post Reply