コード例 #1
0
/**
 *	@brief	Stops or restarts selection changed notification.
 *	@param[in]	doStop	true to stop, false to restart.
 */
void BeListViewAdapter::StopSelectionChangedNotification(bool doStop)
{
	BListView* listView = getListView();
	if (doStop)
	{
		if (0 == stoppedSelectionChangedNotificationCount)
		{
			BMessage* message = listView->SelectionMessage();
			if (NULL != message)
			{
				stoppedSelectionChangedCommand = message->what;
				message->what = ID_NULL;
			}
		}
		stoppedSelectionChangedNotificationCount++;
	}
	else
	{
		stoppedSelectionChangedNotificationCount--;
		if (0 == stoppedSelectionChangedNotificationCount)
		{
			BMessage* message = listView->SelectionMessage();
			if (NULL != message)
			{
				message->what = stoppedSelectionChangedCommand;
				stoppedSelectionChangedCommand = ID_NULL;
			}
		}
	}
}