Beispiel #1
0
BContainerWindow *
TTracker::FindContainerWindow(const entry_ref *entry, int32 number) const
{
	ASSERT(fWindowList.IsLocked());
	
	int32 count = fWindowList.CountItems();

	int32 windowsFound = 0;

	for (int32 index = 0; index < count; index++) {
		BContainerWindow *window = dynamic_cast<BContainerWindow *>
			(fWindowList.ItemAt(index));

		if (window && window->IsShowing(entry) && number == windowsFound++)
			return window;
	}
	return NULL;
}
Beispiel #2
0
BContainerWindow *
TTracker::FindParentContainerWindow(const entry_ref *ref) const
{
	BEntry entry(ref);
	BEntry parent;
	
	if (entry.GetParent(&parent) != B_OK)
		return NULL;
	
	entry_ref parentRef;
	parent.GetRef(&parentRef);

	ASSERT(fWindowList.IsLocked());
	
	int32 count = fWindowList.CountItems();
	for (int32 index = 0; index < count; index++) {
		BContainerWindow *window = dynamic_cast<BContainerWindow *>
			(fWindowList.ItemAt(index));
		if (window && window->IsShowing(&parentRef))
			return window;
	}
	return NULL;
}