Пример #1
0
void
listview::UpdateList(char *buffname, bool need_save)
{
//	(new BAlert("Niue", "Updating..", "Ok", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();

	BString string, newstring;

	for(int i=0; i < fList->CountItems(); i++)
	{
		string = buffname;
		TListItem *item = dynamic_cast<TListItem *>(fList->ItemAt(i));
					
		if(item->is_source == true)
		{
			newstring = item->GetName();

			Window()->Lock();			
			if(string == newstring)
			{

				if(need_save)
				{
//					(new BAlert("Niue", "Updating.., need save", "Ok", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
					item->save = false;
//					item->fIcon= NULL;
					item->DrawItem(this->fList,BRect(0,(i*42),item->Width(), item->Height()+2), true);
//					item->Update(this->fList, be_plain_font);
				}
				else
				{
//					(new BAlert("Niue", "Updating.., no need save", "Ok", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
					item->save = true;
//					item->fIcon= NULL;
					item->DrawItem(this->fList,BRect(0,(i*42),item->Width(), item->Height()+2), true);
//					item->Update(this->fList, be_plain_font);
				}
				fList->Invalidate();
			}
			
//				BuildList(startref);
				Window()->Unlock();
		}
		else
			item->save = true;
	}	
}