.48 mnemonic bug with channel names

Started by Saga Musix, October 07, 2007, 18:16:34

Previous topic - Next topic

Saga Musix

Full Version:
OpenMPT v1.17.02.48

Has the bug occured in previous versions? If yes, please specify version(s): (This option is optional, and doesn't need research. But in case you know...)
Also happened in original Modplug Tracker


Description of the bug:
If there is the mnemonic sign (&) in a channel name, it's handled as an mnenonic (the next char will be underlined). "D&B" will be converted into "DB" in this case:
(picture removed as it's no more necessary)

How to reproduce (step by step description):
Insert a "&" sign in a channel's name.

Fixed in OpenMPT 1.17.02.53
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Sam_Zen

Maybe it's a bug, but I got curious :
Is there a list of such characters which apparently are interpreted not as text ?
0.618033988

LPChip

I can clarify why this happens and also add that it can't be fixed.

This is a function from MS Visual Studio. It also exists in VB and such. Basically when you add a & in a menu or most controls, it underlines the next letter. This is made so you can show the letter to quick access the menu item.

I believe making a && will put 1 & in it that isn't underlined.

Perhaps Rewbs can fix it by converting all &'s to &&'s when you look in the pattern editor. But then again, is it really necessary to fix this?
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

bvanoudtshoorn

Perhaps this bug could be exploited. For example, if you set a channel name to &Piano, hitting [Ctrl]+[Alt]+[P] (or something) would jump straight to that channel? That way, it'd stop being a bug, and become a feature. =P

Saga Musix

I don't think that this would work, as the underlined characters have to be pressed when their parent control (e.g. the menu) has the focus, there's also no shortcut... An underlined "O" in the file menu for example would make it possible to press O while in this menu to open a file, for example. this can't be done in the pattern editor (at least, it would be rather compliacted).
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Sam_Zen

I don't see a reason to fix this. It's the same issue as having more than one dot in a filename, or a space char. in an URL.
Apparently some characters here are indeed mnemonics of a protocol, so maybe just shouldn't be used.
0.618033988

Saga Musix

IMHO you are not right about that. What would you f.e. think of a text editor that does not display questionmarks because they're part of a special syntax? What would you think of a sample editor that does not allow special sample bytes because they could interfere with other settings? This is quite limiting to the user. And so is this little bug. These mnemonics were defined as help for the programmer, not as a feature for the user of a program. That's why they have to be escaped.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Sam_Zen

0.618033988

bvanoudtshoorn

The easiest solution would, of course, be to prevent people from putting an ampersand into the channel name at all. But then, that's a bit limiting.

You could also go through and escape all ampersands when you're in the pattern editor.

My favourite solution, though, would be to delve into the code that actually draws the pattern editor. I know that in Delphi (not sure about C), there's an alternative to the standard DrawText function (I think that's what it's called) which doesn't draw the accelerator characters. Don't quote me on this, but I think it's the same function which allows you to draw rotated text. Of course, I'm speaking from a Delphi perspective, and although I know that a lot of these low level routines are just translated C header files for Delphi, some of them aren't, so this suggestion might not work at all. =P Of course, you could just rewrite the entire program to use GD and FreeType. =D

LPChip

Can someone confirm that && actually shows one &?
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

It does, at least in Visual Basic... There's also a object property called "UseMnemonic" in Visual Basic which can be used to disable Mnemonics. This is the option to go for... If there's one in C aswell.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LPChip

Quote from: "Jojo"It does, at least in Visual Basic... There's also a object property called "UseMnemonic" in Visual Basic which can be used to disable Mnemonics. This is the option to go for... If there's one in C aswell.

I've just confirmed that in OpenMPT writing 2 &'s will show it as one & in the pattern tab, so I bet there's such function too!
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.