bugGNU Octave - Bugs: bug #57128, no visual clue (graying) to...

 
 

bug #57128: no visual clue (graying) to enable=off for uicontrols

Submitted by:  A.R. Burgers <arb>
Submitted on:  Mon 28 Oct 2019 07:31:39 AM UTC  
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Mon 27 Apr 2020 04:18:37 PM UTC, comment #11: 

I think this bug report has been mostly resolved.  If there are further individual problems then new bug reports can be opened for those.  I filed a bug report about the white background of text objects as bug #58261.

Final changeset for this report updates the NEWS file for 7.1 to describe the changes.  See https://hg.savannah.gnu.org/hgweb/octave/rev/afc53bd3d71b.

Closing report.

Rik <rik5>
Project Administrator
Mon 27 Apr 2020 04:01:38 PM UTC, comment #10: 

I checked in a final changeset that implements "gray" for text/slider objects.  See https://hg.savannah.gnu.org/hgweb/octave/rev/be4a6f33d142

Rik <rik5>
Project Administrator
Mon 27 Apr 2020 12:12:22 PM UTC, comment #9: 

Yes, Matlab does something a bit funny with default background color. This was mentioned in bug #53805:
http://savannah.gnu.org/bugs/?53805#comment21

Guillaume <gyom>
Mon 27 Apr 2020 12:55:06 AM UTC, comment #8: 

On the coloring, Matlab seems to have a special quirk.  When the background is the default ([0.94, 0.94, 0.94]) it renders the background as white ([1 1 1]) instead.  It seems stupid to have that sort of special case.  Attached is a test script which shows that behavior.

figure;
str = repmat ("on ", 1, 100);
h = uicontrol (...
  'Style','edit', ...
  'Units','normalized', ...
  'Position',[0.25 0.25 0.5 0.2], ...
  'Max',2, ...
  'String', str);

disp ('Default background: '), get (h, 'backgroundcolor')
disp ("Notice background is white ([1 1 1])");
pause (2)
set (h, 'backgroundcolor', 'm');
disp ('Magenta background: '), get (h, 'backgroundcolor')
disp ("Background color now reflects backgroundcolor property");
pause (2)
set (h, 'backgroundcolor', [0.94, 0.94, 0.95]);
disp ('Backgroundcolor [0.94, 0.94, 0.95] (last value not default)');
disp ('Notice that background is now grey which matches the values set');
pause (2)
set (h, 'backgroundcolor', [0.94, 0.94, 0.94]);
disp ('Backgroundcolor [0.94, 0.94, 0.94] which is default, but shows up as white');

(file #48950)

Rik <rik5>
Project Administrator
Sun 26 Apr 2020 11:06:25 PM UTC, comment #7: 

The behavior of Inactive and Disabled is identical and they don't respond to any user interaction.

Guillaume <gyom>
Sun 26 Apr 2020 10:12:45 PM UTC, comment #6: 

I cheked in a change for popupmenu types which seems to work.  See https://hg.savannah.gnu.org/hgweb/octave/rev/20794455ea11.

Rik <rik5>
Project Administrator
Sun 26 Apr 2020 09:39:01 PM UTC, comment #5: 

I need help figuring out how Matlab behaves.  Could someone try downloading and running the attached script tst_radiobtn.m?

What happens when you try to click on the "inactive" radio button?  Does the circle become checked?  If the circle doesn't become checked, does it acknowledge the mouse click in any way such as a slight change in the radio button shape when the mouse button is depressed?

(file #48946)

Rik <rik5>
Project Administrator
Sun 26 Apr 2020 05:50:21 PM UTC, comment #4: 

I checked in a changeset for pushbuttons and togglebuttons here https://hg.savannah.gnu.org/hgweb/octave/rev/46a23dc62056.  I don't know if this is exactly how Matlab behaves for "inactive" buttons.  When the Octave property "Enable" is "inactive" I used the Qt function blockSignals().  This means you can still click on the button and the color changes, but no callbacks are executed.

Rik <rik5>
Project Administrator
Sun 26 Apr 2020 02:52:10 AM UTC, comment #3: 

I checked in the fix for Edit uicontrol objects (https://hg.savannah.gnu.org/hgweb/octave/rev/cba489221bab).  I will look at some of the other types now.

Rik <rik5>
Project Administrator
Sat 25 Apr 2020 08:52:58 PM UTC, comment #2: 

I tried your patch and it seems to work fine: when "Enable" is "off", the object is visually different.

Guillaume <gyom>
Fri 24 Apr 2020 11:19:53 PM UTC, comment #1: 

Attached is a patch that seems to work for me on the default branch for uicontrol "Edit" objects.  It also implements the "inactive" value correctly which seems to be active (same color scheme, scroll bar works), but the text is not modifiable (read-only).  If this patch is tested and works, I think I see how we can extend it to each type of uicontrol object.  The script I used for testing is attached as tst_uiscroll.m

(file #48930, file #48931)

Rik <rik5>
Project Administrator
Mon 28 Oct 2019 07:31:39 AM UTC, original submission:  

for uicontrols enable=off|inactive correctly prevents callbacks from being called, but for enable=off the widget should change color scheme to indicate it is ignoring mouse clicks.

The attached png gives a comparison between matlab and octave, and a script that produces this picture is attached as well.

I have a recollection that this has been reported before, but so far this issue did not surface in my bug search.

A.R. Burgers <arb>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #48950:  tst_edit_bg.m added by rik5 (795B - text/x-matlab)
file #48946:  tst_radiobtn.m added by rik5 (305B - text/x-matlab)
file #48930:  tst_uiscroll.m added by rik5 (290B - text/x-matlab)
file #48931:  bug57128.cset added by rik5 (5KiB - application/octet-stream)
file #47755:  enable_off_not_grayed.png added by arb (27KiB - image/png)
file #47756:  enable_off_not_grayed.m added by arb (762B - text/plain)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-04-27 rik5 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2020-04-27 rik5 Attached File- => Added tst_edit_bg.m, #48950
    2020-04-26 rik5 Attached File- => Added tst_radiobtn.m, #48946
    2020-04-26 rik5 StatusPatch Submitted => In Progress
    2020-04-25 rik5 Dependencies- => bugs #58186 is dependent
    2020-04-24 rik5 Attached File- => Added tst_uiscroll.m, #48930
        Attached File- => Added bug57128.cset, #48931
        StatusNone => Patch Submitted
        Release5.1.0 => dev
        Carbon-Copy- => Added gyom
    2019-10-28 arb Attached File- => Added enable_off_not_grayed.png, #47755
        Attached File- => Added enable_off_not_grayed.m, #47756

    Back to the top


    Powered by Savane 3.5