Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DropList bug when removing last item
Re: DropList bug when removing last item [message #14804 is a reply to message #14791] Sat, 15 March 2008 15:10 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
Reproduced.

Well, I am not 100% sure what the right behaviour should be here. DropList is explicitely designed to allow having the value not in list. OTOH, the "SetIndex(0)" after removal was already there...

Well, I guess under circumstances, this is the right fix:

void  DropList::Adjust()
{
	int i = FindKey(value);
	if(i < 0)
		if(GetCount())
			SetIndex(0);
		else
			SetData(Null);
}


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Controls & classes design questions
Next Topic: exception failure
Goto Forum:
  


Current Time: Sun Apr 27 02:42:45 CEST 2025

Total time taken to generate the page: 0.02962 seconds