FAQs: How to create an button

English support forum

Moderators: Stefan2, white, sheep, Hacker

Post Reply
User avatar
Stefan2
Power Member
Power Member
Posts: 2588
Joined: 2007-09-13, 22:20 UTC
Location: Europa

FAQs: How to create an button

Post by *Stefan2 » 2018-07-25, 07:26 UTC

How to create an button

Right click on the button bar at the top and select "Change..."
(or utilize “Configuration > Button bar…”)

In the "Change button bar" dialog, click "Add", then fill in the properties as follows:

Code: Select all

Command: 
Parameters:  
Start path: 
Icon file: WCMICONS.DLL
Tooltip: your text
Enable "[_]Run minimized" or "[_]Run maximized", if wanted.
Press F1 key while in dialog for more.
Then click OK to create the button.
Picture: https://image.ibb.co/e9H36J/Buttonbar_Change_Eng.png




Note:
Note
Show
- If you see no button bar, utilize menu "Configuration > Options..." and enable "Layout" > [X] Show button bar.

- While the button is open for modification, press F1-key for more help.

- You do not need to fill out all of the fields.
-- "Command" is mandatory, "Icon" too, else the button is not visible.
-- "Parameters" and "Start path" only if need.

- Always quote ("...") your paths and parameters, just in case your (path/file name/user name) contain spaces.
-- But then, some parameters are automaticaly quoted by TC if TC find space.
-- You have to try and test if you need to quote and or not to quote.
-- Also, different Interpreters / Applications / Coding languages have different rules if and how to quote.




More Information:

Code: Select all

Command    = 
<Your script or application with full or relative path (use %Commander_Path%). 
Or a TC internal CM_commands or user defined EM_commands "UDC" (see "Magnifying glass" symbol)>

Parameters = 
<Parameters for your application, if need. Or TCs parameter for your script (press F1 key for help)>

Start path = 
<If need. Or leave empty (recommended), as TC use current path as "Start path".>

Icon file  = 
<e.g.: WCMICONS.DLL
For more Icon resources / libraries visit: https://ghisler.ch/board/viewtopic.php?f=3&t=43593&p=305387#p305387>

Tooltip    = 
<a hint for you, so you know what this button will do. Use pipe-symbol '|' to insert line breaks.>

Enable "[_]Run minimized" or "[_]Run maximized", if wanted.



Visible Command options:
Command: '-1' insert an separator between two buttons (an free space, and with option '[x]Flat Icons' a pipe-like symbol '|')
Command: '-2' insert a line break in button bar to get two rows.

ghisler(Author) wrote:
The button bar auto-wraps when it becomes too wide
Total Commander 7.5 will support both a user-defined line break in the bar (command: -2)
and an unlimited number of lines!






Examples:

Code: Select all

Command    = cmd /c
Parameters = FOR /F "tokens=*" %%a in ('type "%L"') DO call C:\temp\tc-test.cmd "%%a"
Start path = 
Icon file  = C:\Windows\system32\cmd.exe
Tooltip    = ForEachFile Do call tc-test.cmd

Code: Select all

Command    = "%Commander_Path%\TOOLs\IrfanView\i_view32.exe"
Parameters = "%P" /thumbs /ini="%Commander_Path%\TOOLs\IrfanView\INI-Thumbs500"
Start path = 
Icon file  = "%Commander_Path%\TOOLs\IrfanView\i_view32.exe"
Tooltip    = Launch i_view32 with "/THUMBs 500x500"

Code: Select all

Command    = "%Commander_Path%\Tests\xxx"
Parameters = "%WL"
Start path = 
Icon file  = WCMICONS.DLL
Tooltip    = Denotation|Description|Explanation

- - -

FAQs: How to create an button
https://ghisler.ch/board/viewtopic.php?f=3&t=50632&p=344803

FAQs: Button-code: How-to Copy Share Paste a button ('TOTALCMD#BAR#DATA')
https://ghisler.ch/board/viewtopic.php?f=3&t=50633&p=335879

FAQs: User-Defined Command (UDC) (usercmd.ini) em_command
https://ghisler.ch/board/viewtopic.php?p=344777#p344777


- - -
 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

Post Reply