Mercurial > octave
view test/bug-53599.tst @ 28244:cba489221bab
Implement Enable property values "inactive" and "off" for uicontrol Edit (bug #57128)
* BaseControl.cc (updatePalette): Call setColor() with additional argument of
"QPalette::Active" and again with "QPalette::Inactive" so that colors are set
only for specific roles. When Qt widget disabled it should now go gray.
* BaseControl.cc (init): Call 'setEnabled (! properties.enable_is ("off"))'
so that "Inactive" value still causes Qt Widget to be enabled.
* BaseControl.cc (update): Call 'setEnabled (! properties.enable_is ("off"))'
so that "Inactive" value still causes Qt Widget to be enabled.
* EditControl.cc (init): Check Octave "Enable" property and call Qt
setReadOnly() if value is "Inactive", but otherwise call Qt setEnabled() with
property value.
* EditControl.cc (updateSingleLine, updateMultiLine): Check Octave "Enable"
property and call Qt setReadOnly() if value is "Inactive", but otherwise call
Qt setEnabled() with property value.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 25 Apr 2020 19:44:57 -0700 |
parents | 34617dd78f02 |
children | 2838bbd84b87 |
line wrap: on
line source
%!function rval = sggval (val) %! global gval %! if (nargin == 1) %! gval = val; %! else %! rval = gval; %! endif %!endfunction %!test %! global gval %! assert (isempty (gval)) %! sggval (13); %! assert (sggval (), 13); %! assert (gval, 13); %! clear global gval %! assert (sggval (), []) %! gval = 42; %! assert (sggval (), []); %! clear gval %! global gval %! gval = 42; %! assert (sggval (), 42); %! clear -global gval; # cleanup after test