bugGNU Octave - Bugs: bug #52853, Broken ui dialogs by ampersands...

 
 

bug #52853: Broken ui dialogs by ampersands inserted into button texts (KDE)

Submitter:  Torsten Lilge <ttl>
Submitted:  Wed 10 Jan 2018 06:34:25 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  ttl
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Jan 2018 07:37:16 PM UTC, comment #4: 
Torsten Lilge <ttl>
Group Member
Thu 11 Jan 2018 06:32:39 PM UTC, comment #3: 

I followed approach #2 but with the extension that the clocked button text returned by the dialog is the one that was originally passed to the dialog. The internal check, which button text has to be returned, is done ignoring all "&" in the strings. By this, I hope not to change the interface to the programmer at all. The changeset is almost ready to be pushed.

Torsten Lilge <ttl>
Group Member
Thu 11 Jan 2018 06:14:23 PM UTC, comment #2: 

Conceptually, I like approach 2 a bit more.  Which sort of programmer has to be aware of this?  Is it someone writing in the Octave language and using uimenu, or is it more like core developers writing in C++?  If it is a the second smaller set then it is probably okay.

The documentation says that users must use doubled ampersands if they want a single ampersand in the menu field.

http://www.mathworks.com/help/matlab/ref/matlab.ui.container.menu-properties.html#property_d119e1093041


Menu label, specified as a character vector. This property specifies the label that appears on the menu (or menu item).

You can specify a mnemonic for the label using the ampersand (&) character. The character that follows the ampersand appears underlined in the menu. The user can select the menu item by pressing the Alt key followed by the underlined character.

In order for the mnemonic system to work, you must specify a mnemonic for all menu items you define in the UI.

If you want to display an ampersand in the menu label, specify two consecutive ampersands.


So I think your method #1 is possibly the way Matlab does things.



Rik <rik5>
Group administrator
Thu 11 Jan 2018 06:13:24 PM UTC, comment #1: 

Conceptually, I like approach 2 a bit more.  Which sort of programmer has to be aware of this?  Is it someone writing in the Octave language and using uimenu, or is it more like core developers writing in C++?  If it is a the second smaller set then it is probably okay.

The documentation says that users must use doubled ampersands if they want a single ampersand in the menu field.

http://www.mathworks.com/help/matlab/ref/matlab.ui.container.menu-properties.html#property_d119e1093041


Rik <rik5>
Group administrator
Wed 10 Jan 2018 06:34:25 AM UTC, original submission:  

KDE inserts an amersand somewhere into the button texts of octaves ui dialogs if the text does not already contain one. The text of the clicked button is returned by the dialog for determining which button was clicked. Since the returned text now differs from the text initially passed to the dialog function, the analysis of the dialog's result fails.

I see two general approaches here:

  1. An ampersand has to be inserted into the button texts each time a dialog is called. This leads to exactly known strings for comparing the dialog's results after a button was clicked. This would not really fixe the issue but requires some sort of discipline by the programmer.
  2. Any ampersand, which is directly followed by a digit or letter, is removed from the clicked button text before it is returned by the dialog. This only requires some attention by the programmer if the button texts passed to the dialog are already containing ampersand for enabling access via <Alt>+<Char>.


Torsten Lilge <ttl>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by ttl (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-11 ttl StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-01-11 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code