Tips for buttons. Where are they?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Tips for buttons. Where are they?

Post by *XPEHOPE3KA »

1. Open totalcmd.inc for editing :wink:
2. At the end fill in two strings like these:

[mycommands]=0
regedit.exe=9998;this is a tip

3. Now create a button for this command.
4. See what tip does TC show to you? I see "regedit.exe" (without quotes) instead of "this is a tip".

TC 6.54a. Can anyone confirm?

BTW, nice day today - three successful bugreports, and all unanswered by Ghisler :)
Last edited by XPEHOPE3KA on 2006-04-27, 16:45 UTC, edited 2 times in total.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

TC gets the string for the tips from the .mnu file - not from the .inc file - so since the command is not in the menu, you get no tip.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

[mycommands]=0
regedit.exe=9998;this is a tip
This violates the rules for the internal commands.

use instead cm_regedit.exe=9998;

and add (as petermad statet) a menuitem in you menufile

MENUITEM "This is a cool Tooltip", 9998

Then select in your button the new "cm_regedit.exe" entry and you will find that the tooltip is "This is a cool Tooltip"(unless your totalcmd.inc exceeds 500 lines and this cm_regedit.exe is beyond this 500 - but this is anohter item).
BTW, nice day today - three successful bugreports, and all unanswered by Ghisler Smile


Oh you should give him at least time to read them, shouldn't you?

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

Why do you think I was speaking about a menu command? I was speaking about a button using a new command.

Follow steps exactly as I stated - you shouldn't add anything neither to wincmd.ini nor to xxx.mnu, but the command (which runs regedit!) will work.

BTW, I also couldn't assign a hotkey to such a command. Imagine I could - there would be no need to change the start menu anymore for adding a hotkey to a new command!

2Sheepdog
This violates the rules for the internal commands.
Where do I read them?
Oh you should give him at least time to read them, shouldn't you?
Well, what I told was a joke.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
petergus
Member
Member
Posts: 164
Joined: 2003-02-06, 16:28 UTC
Location: Sweden, Enköping
Contact:

Re: [BUG] In totalcmd.inc

Post by *petergus »

XPEHOPE3KA wrote:BTW, nice day today - three successful bugreports, and all unanswered by Ghisler :)
We can hope that he is busy completing TC 7!

Keep the compiler running, Christian! :D

//Peter
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

XPEHOPE3KA wrote:Follow steps exactly as I stated - you shouldn't add anything neither to wincmd.ini nor to xxx.mnu, but the command (which runs regedit!) will work.
It works not because your entry "regedit.exe" became one of TC internal commands but because regedit.exe is in your windows folder so you don't have to write the full path, just file name only will work!

XPEHOPE3KA wrote:Where do I read them?
TC help> 4. Configuration and switches> c. Change main menu> Identifier topic
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

It works not because your entry "regedit.exe" became one of TC internal commands but because regedit.exe is in your windows folder so you don't have to write the full path, just file name only will work!
Actually, I know that. The questions are:
1. Why does TC not show me the tip?
2. Why can't I assign a hotkey? It looks so simple...
3. Well, TC doesn't create a special command for my entry as its number is 9998 - doesn't reside in start menu. So if I add a button with a number 9998 (not getting the comand from the combobox), then (after pushing the button) TC says that the function is not implemented. But if I add a button with a number like 750 (I don't have a corresponding entry in my start menu), then the active panel blinks once and no message appear.
It looks like there are already 198 commands for 701...898 (or something) organized in a list or an array. Then the question is: why not to allow using such easy commands: write any command you want in totalcmd.inc, assign it to some number, then assign a hotkey for that command - see, no start menu entries needed.
Some of these steps actually work now: you can write anything as a command and assign it to any number, and then use it in some button. But you can't see the tip and you can't assighn a hotkey.

I guess TC does it like this:
1. When you create a button and use the combobox to insert a command, then the command from totalcmd.inc goes to your BAR file directly (without processing if it is a valid command);
2. But when you hover the button TC looks at the command:
if it starts with "cm_", then it looks for it in totalcmd.inc for its tip;
if it doesn't then the command itself is displayed
3. When you press the button TC looks at the command again:
if it starts with "cm_", then it looks for it in totalcmd.inc for its number and then invoke the corresponding command;
if it doesn't look like internal command, then TC sends the command itself (with necessary parameters handling) for execution. That's why simple adding of commands to totalcmd.inc works with buttons.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2. But when you hover the button TC looks at the command:
if it starts with "cm_", then it looks for it in totalcmd.inc for its tip;
NO, No, no - it looks in your .mnu file and uses the text correlated with the cm_ command as the tip - I already wrote that here: http://ghisler.ch/board/viewtopic.php?p=86052&sid=8015288ce5347afde6e4af8187e8e78f#86052

It is silly - it would make much more sence to take the description from totalcmd.inc - but that's not how it is!
Last edited by petermad on 2006-04-22, 21:21 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

What .mnu file are you speaking about??? In my WCMD_RUS.MNU I have no tips! That should be nothing common between the menu and the buttonbar. Maybe, you meant .bar instead of .mnu? If you did than I will say that's not true also, because I have only these strings in my default.bar:
button6=WCMICONS.DLL,10
cmd6=cm_MultiRenameFiles
But TC shows me my russian tip from totalcmd.inc.

When you add a button for a new command TC gets the tip from totalcmd.inc file and then stores it in the .bar file.
The method TC uses for getting the tip from totalcmd.inc as I see it is described above.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2XPEHOPE3KA
What .mnu file are you speaking about??? In my WCMD_RUS.MNU I have no tips!
The caption of the menu item is used as the tip!

Try this:

1. Edit the the text between "" in the first MENUITEM in your WCMD_RUS.MNU to something distinguishable - for example "Mickey Mouse".
2. Make a button in the button bar for the corresponding command (cm_Attrib - if it is the standard WCMD_RUS.MNU file).
3. Hover over the button - the tooltip shows "Mickey Mouse".

Get it now?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

XPEHOPE3KA wrote:What .mnu file are you speaking about??? In my WCMD_RUS.MNU I have no tips!
The menu caption is used as tool tip for a button bar if this button command is exist in your main menu, but the tip in .bar file has high priority, so to see the tips from your main menu delete the button tip from your .bar
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2XPEHOPE3KA
TC gets the tip from totalcmd.inc file and then stores it in the .bar file.
NO :!: look at the line "Tooltip" in the "Change button bar" dialog - nothing is put in there automatically when you choose an internal command for a button. And unless you enter a tooltip manually, there will be NO tooltip in the .bar file for internal commands.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

ABSOLUTELY !

Post by *Clo »

2petermad

:) Hello Peter !

- Absolutely ! If I forget to type an info text for a new button using an internal command, I get nothing !
• This is the behaviour for ages, and it's still the same !

:mrgreen: FR
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

petermad wrote:Get it now?
Strange & complicated way, but I got it and I agree it can be useful.
It is silly - it would make much more sence to take the description from totalcmd.inc - but that's not how it is!
Now I see that totalcmd.inc has nothing with tips, and I agree that what we have nowadays is silly.
Actually, I was fooled by the fact that totalcmd.inc entries and wcmd_rus.mnu entries are almost the same - so I didn't distinguish what was responsible for tips. But now I wonder what are the comments in totalcmd.inc for?
I guess what we are speaking about has some relationship with unified command system, has it? (too lazy to read all that never-will-be-implemented stuff)
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

XPEHOPE3KA wrote: But now I wonder what are the comments in totalcmd.inc for?
They are currently only explaining the command if you choose it from the dropdown list in

Create a button
Create a Startmenu entry
Redefine hotkeys (Keyboard remapping)

Did I miss one?

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Post Reply