Am 10.06.2013 14:28, schrieb Angelo Naselli:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Il 10/06/2013 14:05, Gabriele Mohr ha scritto:
No, I only added additional return ValueChanged if item is toggled (which is conform to NCMultiSelectionBox).
see commit 0b69bb499fa5e2b011aa614dfcf0df884b45456a
NCTable::NCTable( YWidget * parent, YTableHeader *tableHeader, bool multiSelection ) : YTable( parent, tableHeader, multiSelection ) , NCPadWidget( parent ) @@ -529,6 +543,10 @@ NCursesEvent NCTable::wHandleInput( wint_t key ) else { toggleCurrentItem(); + if ( notify() && immediateMode() ) + { + return NCursesEvent::ValueChanged; + } } break;
Sorry that is not true -neither mine previous really- :) else
{ toggleCurrentItem(); + if ( notify() && immediateMode() ) + { + return NCursesEvent::ValueChanged; + } } break; Means that you return in the case you have a multi-selection so you skip the code below: if ( citem != getCurrentItem() ) { if ( notify() && immediateMode() ) ret = NCursesEvent::SelectionChanged;
if ( !multiselect ) selectCurrentItem(); }
Selection changed is not emitted, so it's not an additional event it's a different one in some cases... ;)
No, SelectionChanged wasn't emitted before because the position in the list is unchanged when item is toggled and the condition: if ( citem != getCurrentItem() ) hasn't applied. SelectionChanged is emitted for single and multi selection if position in list has changed (scrolled up/down).
Cheers, Angelo
P.S. and which is the explanation for notify() and/or immediateMode() instead?
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlG1xoQACgkQqEs9DA4DquA3EwCfQZB5hJhlsdKKSiXBa2XiQ4Vm kC4An3DWBqVhmn7/UGrRna4trTzIOPPf =po9u -----END PGP SIGNATURE-----
-- Gabriele Mohr SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstr. 5 Tel: +49 911 740 53 362 90409 Nürnberg Email: gs@suse.de ----------------------------------------------------------------- -- To unsubscribe, e-mail: libyui-devel+unsubscribe@opensuse.org To contact the owner, e-mail: libyui-devel+owner@opensuse.org