[yast-commit] r41493 - /branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
Author: sh-sh-sh Date: Fri Oct 19 19:07:10 2007 New Revision: 41493 URL: http://svn.opensuse.org/viewcvs/yast?rev=41493&view=rev Log: - Allow to set and get complete items list - fixed preselection Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc?rev=41493&r1=41492&r2=41493&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Fri Oct 19 19:07:10 2007 @@ -118,8 +118,12 @@ { // Check against null pointer and if the item actually belongs to this // widget, deselect any previously selected item and select the new one - YSelectionWidget::selectItem( item, selected ); - setText( item->label() ); + YSelectionWidget::selectItem( item, selected ); + + if ( selected ) + { + setText( item->label() ); + } } @@ -178,11 +182,13 @@ /* * @property itemID | string Value ID of the selected item or the text the user entered * @property string Label caption above the combo box + * @property itemList Items All items * @property string ValidChars set of valid input characters * @property integer InputMaxLength maximum number of input characters * @property string IconPath Base path for icons */ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) ); + propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); propSet.add( YProperty( YUIProperty_ValidChars, YStringProperty ) ); propSet.add( YProperty( YUIProperty_InputMaxLength, YIntegerProperty ) ); @@ -200,6 +206,7 @@ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch if ( propertyName == YUIProperty_Value ) return false; // Need special handling + else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() ); else if ( propertyName == YUIProperty_ValidChars ) setValidChars( val.stringVal() ); else if ( propertyName == YUIProperty_InputMaxLength ) setInputMaxLength( val.integerVal() ); @@ -219,6 +226,7 @@ propertySet().check( propertyName ); // throws exceptions if not found if ( propertyName == YUIProperty_Value ) return YPropertyValue( YOtherProperty ); + else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() ); else if ( propertyName == YUIProperty_ValidChars ) return YPropertyValue( validChars() ); else if ( propertyName == YUIProperty_InputMaxLength ) return YPropertyValue( inputMaxLength() ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org