Menu With Icons.

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
Sombra
Power Member
Power Member
Posts: 811
Joined: 2005-12-27, 22:23 UTC
Location: Zaragoza, Spain

Post by *Sombra »

Sir_SiLvA wrote:
Looks really nice BUT
if u have checkmarks but no Icons it looks ugly:
http://home.arcor.de/rosa.elefant/tc/pics/menu01.jpg
and what looks even uglier is Menus without Pics/Checkmarks whatever because of to big menu items without reason:
http://home.arcor.de/rosa.elefant/tc/pics/menu02.jpg
I´m right with you.

A little suggestion: This is only a idea, I don't know if really this would be possible.
Is possible set the selected option like at the new toolbar of TC?
With this way wouldn't be necessary the indent of 20px.

Here is an example (fake screenshot) with full view selected and extension order selected. http://www.breto.net/temp/menu_selected.png
I can read English, but... I write like Tarzan. (sorry)
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Sorry I currently don't see a way to control the placement of the icon using this approach. I really wonder why the icon are placed on the left side using these flags
Looks like we are comming to mentioned "flexibility problem" :D

EDIT:

2 leftious
I tested the above code in AHK. It works very well, except few AHK related problems.
Habemus majkam!
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I think I have solution for your problems related to icon position.

I tested in AHK and it works perfectly

So, to put icon on any place in the menu, you can do like this:

1. Reserve enough place for an icon in the menu. You do this by constructing the string from the menu item title, adding pseudospaces (ALT 0160) on trailing positions so to expand the string enough as windows will use strings length to set the size of the menu window.

2. In MeasureItem event, return 0 for width, and icon height for height

3. In DrawItem, draw on any place you like. Windows will draw the text after you draw the icon. It will have white background by default but it can be set to transparent with SETBKMODE(hdc, 1) api function in the same event.

You can use even better mechanisam without changing the title but you must use GetTextExtent32 func to get the size of the text and add it with icon size to calculate the item rect the more precisely.

I have AHK code for this if you are interested
Habemus majkam!
User avatar
StickyNomad
Power Member
Power Member
Posts: 1933
Joined: 2004-01-10, 00:15 UTC
Location: Germany

Post by *StickyNomad »

2majkinetor !
Wow, seems you have found the other half of your brain again :D
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

seems so :D
Habemus majkam!
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2majkinetor !
Are you sure your approach is screen-reader compatible?
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

screen-reader compatible?

What do you mean ?

The goal is to put the icons on the right side right ?
Last edited by majkinetor ! on 2006-11-14, 11:33 UTC, edited 1 time in total.
Habemus majkam!
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Yes it is. You don't have to use ALT 0160 but plain space as I guess windows is not treaming the text to display. I put pseudospace just to be shure, as it turnes out that spaces are trimed on many places around (not talking about API only, I have triming problems in Web Forms using dotNet etc...)

Also, it can be checked how the string trailed with ALT 0160 is readed by the screen reader. I supose it is skiped as non readable charachter.
Habemus majkam!
User avatar
petermad
Power Member
Power Member
Posts: 14855
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Lefteous
[menu_mappings] which would be added to Wcmicons.inc where the mappings for the menu are defined
If menu mapping should have any meaning it should be linked to the menu file by file name - e.g. if I use the menu wcmd_xxx.mnu then an icon mapping in a file named wcmd_xxx.ico should be used - then it is possible to publish the mapping and the menu file together.

If the mapping has to be inside wcmicons.inc then you have to instruct the user of a custom menu to cut and paste the mapping to the wcmicons.inc file - that is way to complicated for the user, and has the same flaws as the cm_UserMenuX commands in totalcmd.inc - they can't be easily distributed either - whereas the em_commands in the new wcmd_xxx.ini files can be easily distributed as part of a .lng/.mnu/.inc/.ini file set.

So I suggest that icon mapping can be read from a .ico file that can be part of a .lng/.mnu/.inc/.ini/.ico customization set.
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
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2petermad
You didn't list the command icon library as part of your "customization set" so how could the menu designer know which lib is used?

I guess I have a better idea than my previous. What could be invented is some kind of a mask*. That means no special mappings are added for the menu but a mask is defined. This could be indead stored in an extra file as the mask is independent from the mapping to the command icon library.

* A mask just says yes or no to an existing mapping.
User avatar
petermad
Power Member
Power Member
Posts: 14855
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Lefteous
You didn't list the command icon library as part of your "customization set" so how could the menu designer know which lib is used?
You are right. That leads me to introducing a sixth file type to the customization set - a wcmd_xxx.dll icon file that must be used if present. If it isn't present the wcmicons.dll should be used.

A mask just says yes or no to an existing mapping
I am not quit sure that I understand that. Do you suggest that only some predefined mappings can be used for defining which icons should be used in any customized menu - that sounds too restrictive. The menu and the icons that has to be used is an entity that should be freely configurable.
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
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2petermad
I suggest a mask which deactivates displaying of some unwanted icons. The default would be to display all available icons (current implementation).
That leads me to introducing a sixth file type to the customization set - a wcmd_xxx.dll icon file that must be used if present. If it isn't present the wcmicons.dll should be used.
I just wanted to point out that you need always both dll and inc.
User avatar
petermad
Power Member
Power Member
Posts: 14855
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

suggest a mask which deactivates displaying of some unwanted icons. The default would be to display all available icons (current implementation).
The problem is that the current mapping isn't displaying icons for all related commands. For example do I think that these commands/icons should be added to wcmicons.inc:

2007=45
2008=45
2029=45
2030=45
2036=45
2037=45
2038=45
3311=39
3312=39
3313=39

and I am sure other people has other additions.

With a mask, only already added commands/icons can be selected/deselected, but nonexisting combinations that you might want is not obtainable.
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
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Beta2

After switching back and forth quite a bit I like setting IconsInMenus=17 best, followed closely by IconsInMenus=1.

2 and 18 are bad because the menu icons look too much like buttons, which they are not.

17 is more space efficient and near "standard" practice. 1 is less "standard" but has an appealing spaciousness to it.

Using icons in the menus highlights a few shortcomings in the current default icon library: If the implementation is to highlight "toggle" icons ("all files", for instance) with a surrounding box, then the icons that already have surrounding boxes (such as 22, 23, and 37) just add confusion. Probably best to redesign those icons.

How do I hide icons on individual menu items?
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
Post Reply