bugGNU Octave - Bugs: bug #48214, Special characters in uicontrol's...

 
 

bug #48214: Special characters in uicontrol's string

Submitter:  Guillaume <gyom>
Submitted:  Mon 13 Jun 2016 10:54:09 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 16 Jun 2016 02:26:16 PM UTC, comment #7: 

Yes, please file a different bug report, considering I glossed over anything unrelated to the bug title :)

Mike Miller <mtmiller>
Group Member
Thu 16 Jun 2016 11:17:35 AM UTC, comment #6: 

Many thanks for fixing this.

Concerning #comment1 (default values for 'color' and 'checked' properties), do you think they should be modified to match Matlab's and if so, shall I open a new bug report?

Guillaume <gyom>
Thu 16 Jun 2016 01:24:50 AM UTC, comment #5: 

Fixed on the default branch with this change:

http://hg.savannah.gnu.org/hgweb/octave/rev/f500cde065f7

Mike Miller <mtmiller>
Group Member
Tue 14 Jun 2016 03:14:34 PM UTC, comment #4: 

Correct. And since those widgets all derive from BaseControl, the change is actually only needed in one place.

The edit, listbox, popupmenu, and text uicontrols do not use QAbstractButtons, so the same syntax does not apply.

Mike Miller <mtmiller>
Group Member
Tue 14 Jun 2016 11:28:22 AM UTC, comment #3: 

Am I right to understand that the "problem" is with Qt and all '&' have to be replaced with '&&' before being given to Qt's setText?

http://doc.qt.io/qt-4.8/qabstractbutton.html#text-prop

I'm just confused it happens with some uicontrols but not others.

Guillaume <gyom>
Mon 13 Jun 2016 04:52:10 PM UTC, comment #2: 

Thanks, confirmed here. Looks like an easy string replacement task in libgui/graphics.

Mike Miller <mtmiller>
Group Member
Mon 13 Jun 2016 10:56:10 AM UTC, comment #1: 

(note also the different default values between Octave and Matlab for background colors of uicontrols and figures, and 'checked' value of checkbox, radiobutton and togglebutton).

Guillaume <gyom>
Mon 13 Jun 2016 10:54:09 AM UTC, original submission:  

The character '&' is wrongly interpreted in the 'String' property of a uicontrol (this was already mentioned in item 4 of bug #44672):


F = figure;
uicontrol(F,'units','normalized','Style','checkbox','String','A & B','Position',[0.3 0.8 0.4 0.09]);
uicontrol(F,'units','normalized','Style','edit','String','A & B','Position',[0.3 0.7 0.4 0.09]);
uicontrol(F,'units','normalized','Style','listbox','String','A & B','Position',[0.3 0.6 0.4 0.09]);
uicontrol(F,'units','normalized','Style','popupmenu','String','A & B','Position',[0.3 0.5 0.4 0.09]);
uicontrol(F,'units','normalized','Style','pushbutton','String','A & B','Position',[0.3 0.4 0.4 0.09]);
uicontrol(F,'units','normalized','Style','radiobutton','String','A & B','Position',[0.3 0.3 0.4 0.09]);
uicontrol(F,'units','normalized','Style','text','String','A & B','Position',[0.3 0.2 0.4 0.09]);
uicontrol(F,'units','normalized','Style','togglebutton','String','A & B','Position',[0.3 0.1 0.4 0.09]);


A screenshot of the display in Octave and Matlab is attached: the problem is with checkbox, pushbutton, radiobutton and togglebutton.

The underscore seems to correspond to an access key, meaning that the '&' is interpreted in the way it is for uimenus; using '&&' for the problematic uicontrols fixes the display.

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #37463:  uicontrol.png added by gyom (30KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by gyom (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-16 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2016-06-13 mtmiller Item GroupNone Matlab Compatibility
        StatusNone Confirmed
    2016-06-13 gyom Attached File- Added uicontrol.png, #37463

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code