Button commands: Differ between focused and selected ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
gianni9999
Junior Member
Junior Member
Posts: 2
Joined: 2016-01-27, 16:01 UTC

Button commands: Differ between focused and selected ?

Post by *gianni9999 »

Command line parameters for the buttons in the button bar.

Hi,
congratulations for the great program! I use it continuously for all of my day-to-day work. However, I recently stumbled into an issue.
I wrote a small program that accepts input file names from the command line. I call the program through the TC button bar by specifying %S in the "Parameters" field of the button configuration dialog. This works nicely if there are some files that are selected. However, if there are no files actively selected, TC still puts in the command line the name of the file that has the focus (dotted rectangle), which is not a desired behavior. Even worse, if no file has the focus, possibly because the user clicked on the command line field, TC still puts a file name in command line. On the other hand, if the user selects one file, but the focus is on another file on the same panel, then TC passes to the command line only the file that is selected, and not the one that has the focus. This behavior is a bit inconsistent. Is there a way of passing to the command line only the files that are actually selected (red)?
Thanks
S.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, standard TC behaviour is to treat focused file as selected if there are no explicitly selected files. But if there are selected files, focused file is ignored.
These rules work in all TC commands, not only buttonbar buttons (e.g. copy/move/delete operations), when a command expects some file(s) for processing.
gianni9999
Junior Member
Junior Member
Posts: 2
Joined: 2016-01-27, 16:01 UTC

Post by *gianni9999 »

Hi MVV,
thanks for the quick reply. You're right, of course. Still, I find it inconsistent that a filename is passed to the command line even if no file is selected and no focus is active. It would be nice to have a switch in the button bar configuration dialog that allows to pass only selected files.
S.
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

gianni9999,
In case you don't want to pass anything, you need to put the cursor onto the [..] item.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply