ModPlug Central

OpenMPT Development (Archive) => Bug Reports => Bug Report Archive => Topic started by: Saga Musix on October 07, 2007, 18:16:34

Title: .48 mnemonic bug with channel names
Post by: Saga Musix on October 07, 2007, 18:16:34
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
Title: .48 mnemonic bug with channel names
Post by: Sam_Zen on October 07, 2007, 23:34:39
Maybe it's a bug, but I got curious :
Is there a list of such characters which apparently are interpreted not as text ?
Title: .48 mnemonic bug with channel names
Post by: LPChip on October 08, 2007, 06:55:15
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?
Title: .48 mnemonic bug with channel names
Post by: bvanoudtshoorn on October 08, 2007, 09:02:44
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
Title: .48 mnemonic bug with channel names
Post by: Saga Musix on October 08, 2007, 13:37:53
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).
Title: .48 mnemonic bug with channel names
Post by: Sam_Zen on October 08, 2007, 22:43:07
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.
Title: .48 mnemonic bug with channel names
Post by: Saga Musix on October 08, 2007, 23:08:58
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.
Title: .48 mnemonic bug with channel names
Post by: Sam_Zen on October 08, 2007, 23:53:45
You convinced me.
Title: .48 mnemonic bug with channel names
Post by: bvanoudtshoorn on October 08, 2007, 23:59:53
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
Title: .48 mnemonic bug with channel names
Post by: LPChip on October 09, 2007, 06:47:46
Can someone confirm that && actually shows one &?
Title: .48 mnemonic bug with channel names
Post by: Saga Musix on October 09, 2007, 09:44:16
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.
Title: .48 mnemonic bug with channel names
Post by: LPChip on October 09, 2007, 16:54:19
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!
Title: .48 mnemonic bug with channel names
Post by: Saga Musix on October 13, 2008, 10:44:37
This one will be fixed in .53